blob: 8a23469ad6d15f1eb2d5556dffd2749240355d6c [file] [log] [blame]
Darren Tucker5c6a91a2003-07-14 16:21:44 +10001# $Id: configure.ac,v 1.133 2003/07/14 06:21:44 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*)
57 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000058 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110059 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millereab4bae2003-04-29 23:22:40 +100060 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
61 if (test -z "$blibpath"); then
62 blibpath="/usr/lib:/lib:/usr/local/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110063 fi
Damien Millereab4bae2003-04-29 23:22:40 +100064 saved_LDFLAGS="$LDFLAGS"
65 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
66 if (test -z "$blibflags"); then
67 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
68 AC_TRY_LINK([], [], [blibflags=$tryflags])
69 fi
70 done
71 if (test -z "$blibflags"); then
72 AC_MSG_RESULT(not found)
73 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
74 else
75 AC_MSG_RESULT($blibflags)
76 fi
77 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +100078 dnl Check for authenticate. Might be in libs.a on older AIXes
79 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -070080 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +100081 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -070082 LIBS="$LIBS -ls"
83 ])
84 ])
Darren Tucker5c6a91a2003-07-14 16:21:44 +100085 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
86 AC_CHECK_DECL(loginfailed,
87 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
88 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +100089 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +100090 [(void)loginfailed("user","host","tty",0);],
91 [AC_MSG_RESULT(yes)
92 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +100093 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +100094 )],
95 [],
96 [#include <usersec.h>]
97 )
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)
Damien Miller35276252003-06-03 10:14:28 +1000144 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700145 LIBS="$LIBS -lsec -lsecpw"
146 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000147 disable_ptmx_check=yes
148 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100149*-*-hpux10*)
150 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000151 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100152 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000153 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100154 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000155 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000156 AC_DEFINE(LOGIN_NO_ENDOPT)
157 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100158 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100159 AC_DEFINE(DISABLE_UTMP)
Damien Miller35276252003-06-03 10:14:28 +1000160 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700161 LIBS="$LIBS -lsec"
162 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100163 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000164*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000165 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100166 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100167 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100168 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000169 AC_DEFINE(LOGIN_NO_ENDOPT)
170 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100171 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100172 AC_DEFINE(DISABLE_UTMP)
Damien Miller35276252003-06-03 10:14:28 +1000173 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700174 LIBS="$LIBS -lsec"
175 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000176 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100177*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000178 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000179 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100180 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000181 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000182 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller1808f382000-01-06 12:03:12 +1100183 ;;
184*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000185 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000186 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100187 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000188 AC_DEFINE(WITH_IRIX_ARRAY)
189 AC_DEFINE(WITH_IRIX_PROJECT)
190 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000191 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000192 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000193 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100194 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100195*-*-linux*)
196 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100197 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100198 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000199 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller35276252003-06-03 10:14:28 +1000200 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100201 inet6_default_4in6=yes
Darren Tuckerc437cda2003-05-10 17:05:46 +1000202 # openpty can be in libutil, needed for controlling tty test
203 AC_SEARCH_LIBS(openpty, util)
204 # make sure that openpty does not reacquire controlling terminal
205 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
206 AC_TRY_RUN(
207 [
208#include <stdio.h>
209#include <sys/fcntl.h>
210#include <sys/types.h>
211#include <sys/wait.h>
212
213int
214main()
215{
216 pid_t pid;
217 int fd, ptyfd, ttyfd, status;
218
219 pid = fork();
220 if (pid < 0) { /* failed */
221 exit(1);
222 } else if (pid > 0) { /* parent */
223 waitpid(pid, &status, 0);
224 if (WIFEXITED(status))
225 exit(WEXITSTATUS(status));
226 else
227 exit(2);
228 } else { /* child */
229 close(0); close(1); close(2);
230 setsid();
231 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
232 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
233 if (fd >= 0)
234 exit(3); /* Acquired ctty: broken */
235 else
236 exit(0); /* Did not acquire ctty: OK */
237 }
238}
239 ],
240 [
241 AC_MSG_RESULT(yes)
242 ],
243 [
244 AC_MSG_RESULT(no)
245 AC_DEFINE(SSHD_ACQUIRES_CTTY)
246 ]
247 )
Darren Tucker3c016542003-05-02 20:48:21 +1000248 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000249 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000250 AC_DEFINE(BROKEN_CMSG_TYPE)
251 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000252 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100253 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000254mips-sony-bsd|mips-sony-newsos4)
255 AC_DEFINE(HAVE_NEWS4)
256 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000257 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100258*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000259 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100260 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100261 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100262*-*-freebsd*)
263 check_for_libcrypt_later=1
264 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000265*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000266 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100267 conf_utmp_location=/etc/utmp
268 conf_wtmp_location=/usr/adm/wtmp
269 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000270 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000271 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000272 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100273 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000274 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000275 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000276 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100277*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000278 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000279 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100280 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100281 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000282 AC_DEFINE(LOGIN_NEEDS_UTMPX)
283 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000284 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckerc437cda2003-05-10 17:05:46 +1000285 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
286 AC_DEFINE(SSHD_ACQUIRES_CTTY)
andre2ff7b5d2000-06-03 14:57:40 +0000287 # hardwire lastlog location (can't detect it on some versions)
288 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000289 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
290 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
291 if test "$sol2ver" -ge 8; then
292 AC_MSG_RESULT(yes)
293 AC_DEFINE(DISABLE_UTMP)
294 AC_DEFINE(DISABLE_WTMP)
295 else
296 AC_MSG_RESULT(no)
297 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100298 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000299*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000300 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000301 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100302 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000303 conf_utmp_location=/etc/utmp
304 conf_wtmp_location=/var/adm/wtmp
305 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000306 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000307 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000308*-ncr-sysv*)
309 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
310 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700311 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000312 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000313 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000314 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000315*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000316 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700317 # /usr/ucblib MUST NOT be searched on ReliantUNIX
318 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100319 IPADDR_IN_DISPLAY=yes
320 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000321 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000322 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700323 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
324 # Attention: always take care to bind libsocket and libnsl before libc,
325 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000326 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100327*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000328 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100329 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100330 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100331 ;;
332*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000333 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100334 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100335 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100336 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100337*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000338 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100339 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100340 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100341*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000342 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100343 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700344 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100345 RANLIB=true
346 no_dev_ptmx=1
347 AC_DEFINE(BROKEN_SYS_TERMIO_H)
348 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000349 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000350 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100351 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100352 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700353 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700354 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100355 ;;
356*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800357 if test -z "$GCC"; then
358 CFLAGS="$CFLAGS -belf"
359 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000360 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000361 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100362 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000363 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100364 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000365 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000366 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700367 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100368 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700369 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000370 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000371*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000372 AC_DEFINE(USE_PIPES)
373 AC_DEFINE(DISABLE_FD_PASSING)
374 LDFLAGS="$LDFLAGS"
375 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
376 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000377 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000378*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000379 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700380 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700381 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000382 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
383 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
384 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700385 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000386*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000387 AC_MSG_CHECKING(for Digital Unix SIA)
388 no_osfsia=""
389 AC_ARG_WITH(osfsia,
390 [ --with-osfsia Enable Digital Unix SIA],
391 [
392 if test "x$withval" = "xno" ; then
393 AC_MSG_RESULT(disabled)
394 no_osfsia=1
395 fi
396 ],
397 )
398 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000399 if test -f /etc/sia/matrix.conf; then
400 AC_MSG_RESULT(yes)
401 AC_DEFINE(HAVE_OSF_SIA)
402 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000403 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000404 LIBS="$LIBS -lsecurity -ldb -lm -laud"
405 else
406 AC_MSG_RESULT(no)
407 fi
408 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000409 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000410 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000411
412*-*-nto-qnx)
413 AC_DEFINE(USE_PIPES)
414 AC_DEFINE(NO_X11_UNIX_SOCKETS)
415 AC_DEFINE(MISSING_NFDBITS)
416 AC_DEFINE(MISSING_HOWMANY)
417 AC_DEFINE(MISSING_FD_MASK)
418 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100419esac
420
Damien Millere37bfc12000-06-05 09:37:43 +1000421# Allow user to specify flags
422AC_ARG_WITH(cflags,
423 [ --with-cflags Specify additional flags to pass to compiler],
424 [
425 if test "x$withval" != "xno" ; then
426 CFLAGS="$CFLAGS $withval"
427 fi
428 ]
429)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000430AC_ARG_WITH(cppflags,
431 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
432 [
433 if test "x$withval" != "xno"; then
434 CPPFLAGS="$CPPFLAGS $withval"
435 fi
436 ]
437)
Damien Millere37bfc12000-06-05 09:37:43 +1000438AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000439 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000440 [
441 if test "x$withval" != "xno" ; then
442 LDFLAGS="$LDFLAGS $withval"
443 fi
444 ]
445)
446AC_ARG_WITH(libs,
447 [ --with-libs Specify additional libraries to link with],
448 [
449 if test "x$withval" != "xno" ; then
450 LIBS="$LIBS $withval"
451 fi
452 ]
453)
454
Darren Tucker6eb93042003-06-29 21:30:41 +1000455AC_MSG_CHECKING(compiler and flags for sanity)
456AC_TRY_RUN([
457#include <stdio.h>
458int main(){exit(0);}
459 ],
460 [ AC_MSG_RESULT(yes) ],
461 [
462 AC_MSG_RESULT(no)
463 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
464 ]
465)
466
Tim Rice4cec93f2002-02-26 08:40:48 -0800467# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000468AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Damien Millerb16f8742003-02-24 12:47:15 +1100469 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800470 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000471 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000472 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000473 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
474 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000475 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700476 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800477 util.h utime.h utmp.h utmpx.h)
478
Damien Millera22ba012000-03-02 23:09:20 +1100479# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700480AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
481AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000482
Damien Millerdf288022001-02-18 13:07:07 +1100483dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700484if test "x$with_tcp_wrappers" != "xno" ; then
485 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
486 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
487 fi
488fi
Damien Millerdf288022001-02-18 13:07:07 +1100489
Tim Rice13aae5e2001-10-21 17:53:58 -0700490AC_CHECK_FUNC(getspnam, ,
491 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700492
Damien Miller150c8b52002-02-13 23:06:56 +1100493AC_ARG_WITH(rpath,
494 [ --without-rpath Disable auto-added -R linker paths],
495 [
496 if test "x$withval" = "xno" ; then
497 need_dash_r=""
498 fi
499 if test "x$withval" = "xyes" ; then
500 need_dash_r=1
501 fi
502 ]
503)
504
Tim Rice13aae5e2001-10-21 17:53:58 -0700505dnl zlib is required
506AC_ARG_WITH(zlib,
507 [ --with-zlib=PATH Use zlib in PATH],
508 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000509 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100510 AC_MSG_ERROR([*** zlib is required ***])
511 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700512 if test -d "$withval/lib"; then
513 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700514 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700515 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700516 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700517 fi
518 else
519 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700520 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700521 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700522 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700523 fi
524 fi
525 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700526 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700527 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700528 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700529 fi
530 ]
531)
532
Tim Rice17b93e52001-10-23 22:36:54 -0700533AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100534
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000535dnl UnixWare 2.x
536AC_CHECK_FUNC(strcasecmp,
537 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
538)
539AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700540 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
541 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000542)
Damien Millerab18c411999-11-11 10:40:23 +1100543
Tim Ricee589a292001-11-03 11:09:32 -0800544dnl Checks for libutil functions
545AC_CHECK_HEADERS(libutil.h)
546AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
547AC_CHECK_FUNCS(logout updwtmp logwtmp)
548
Ben Lindstrom8697e082001-02-24 21:41:10 +0000549AC_FUNC_STRFTIME
550
Damien Miller3c027682001-03-14 11:39:45 +1100551# Check for ALTDIRFUNC glob() extension
552AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
553AC_EGREP_CPP(FOUNDIT,
554 [
555 #include <glob.h>
556 #ifdef GLOB_ALTDIRFUNC
557 FOUNDIT
558 #endif
559 ],
560 [
561 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
562 AC_MSG_RESULT(yes)
563 ],
564 [
565 AC_MSG_RESULT(no)
566 ]
567)
Damien Millerab18c411999-11-11 10:40:23 +1100568
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000569# Check for g.gl_matchc glob() extension
570AC_MSG_CHECKING(for gl_matchc field in glob_t)
571AC_EGREP_CPP(FOUNDIT,
572 [
573 #include <glob.h>
574 int main(void){glob_t g; g.gl_matchc = 1;}
575 ],
576 [
577 AC_DEFINE(GLOB_HAS_GL_MATCHC)
578 AC_MSG_RESULT(yes)
579 ],
580 [
581 AC_MSG_RESULT(no)
582 ]
583)
584
Damien Miller18bb4732001-03-28 14:35:30 +1000585AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
586AC_TRY_RUN(
587 [
588#include <sys/types.h>
589#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700590int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000591 ],
592 [AC_MSG_RESULT(yes)],
593 [
594 AC_MSG_RESULT(no)
595 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
596 ]
597)
598
Damien Millerc547bf12001-02-16 10:18:12 +1100599# Check whether user wants S/Key support
600SKEY_MSG="no"
601AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700602 [ --with-skey[[=PATH]] Enable S/Key support
603 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100604 [
605 if test "x$withval" != "xno" ; then
606
607 if test "x$withval" != "xyes" ; then
608 CPPFLAGS="$CPPFLAGS -I${withval}/include"
609 LDFLAGS="$LDFLAGS -L${withval}/lib"
610 fi
611
612 AC_DEFINE(SKEY)
613 LIBS="-lskey $LIBS"
614 SKEY_MSG="yes"
615
Tim Rice4cec93f2002-02-26 08:40:48 -0800616 AC_MSG_CHECKING([for s/key support])
617 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100618 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800619#include <stdio.h>
620#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700621int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800622 ],
623 [AC_MSG_RESULT(yes)],
624 [
625 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100626 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
627 ])
628 fi
629 ]
630)
631
632# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700633TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100634AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700635 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
636 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100637 [
638 if test "x$withval" != "xno" ; then
639 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700640 saved_LDFLAGS="$LDFLAGS"
641 saved_CPPFLAGS="$CPPFLAGS"
642 if test -n "${withval}" -a "${withval}" != "yes"; then
643 if test -d "${withval}/lib"; then
644 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700645 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700646 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700647 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700648 fi
649 else
650 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700651 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700652 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700653 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700654 fi
655 fi
656 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700657 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700658 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700659 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700660 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700661 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800662 LIBWRAP="-lwrap"
663 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100664 AC_MSG_CHECKING(for libwrap)
665 AC_TRY_LINK(
666 [
667#include <tcpd.h>
668 int deny_severity = 0, allow_severity = 0;
669 ],
670 [hosts_access(0);],
671 [
672 AC_MSG_RESULT(yes)
673 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800674 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700675 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100676 ],
677 [
678 AC_MSG_ERROR([*** libwrap missing])
679 ]
680 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800681 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100682 fi
683 ]
684)
685
Damien Millerfe1f1432003-02-24 15:45:42 +1100686dnl Checks for library functions. Please keep in alphabetical order
687AC_CHECK_FUNCS(\
Damien Miller5fe46a42003-06-05 09:53:31 +1000688 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
689 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Damien Millerfe1f1432003-02-24 15:45:42 +1100690 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000691 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100692 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000693 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
694 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
695 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Damien Miller5fe46a42003-06-05 09:53:31 +1000696 setproctitle setregid setresgid setresuid setreuid setrlimit \
697 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
698 strlcat strlcpy strmode strnvis sysconf tcgetpgrp truncate utimes \
699 vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100700)
Tim Rice13aae5e2001-10-21 17:53:58 -0700701
Damien Millercd6853c2003-01-28 11:33:42 +1100702AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
Damien Millereab4bae2003-04-29 23:22:40 +1000703AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
Damien Millercd6853c2003-01-28 11:33:42 +1100704
Darren Tuckerf1159b52003-07-07 19:44:01 +1000705dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000706AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000707AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000708
Tim Rice13aae5e2001-10-21 17:53:58 -0700709dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700710AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700711 AC_CHECK_LIB(gen, dirname,[
712 AC_CACHE_CHECK([for broken dirname],
713 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700714 save_LIBS="$LIBS"
715 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700716 AC_TRY_RUN(
717 [
718#include <libgen.h>
719#include <string.h>
720
721int main(int argc, char **argv) {
722 char *s, buf[32];
723
724 strncpy(buf,"/etc", 32);
725 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700726 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700727 exit(1);
728 } else {
729 exit(0);
730 }
731}
732 ],
733 [ ac_cv_have_broken_dirname="no" ],
734 [ ac_cv_have_broken_dirname="yes" ]
735 )
Tim Rice17b93e52001-10-23 22:36:54 -0700736 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700737 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700738 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700739 LIBS="$LIBS -lgen"
740 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700741 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700742 fi
743 ])
744])
745
Damien Millerad833b32000-08-23 10:46:23 +1000746dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000747AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000748dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000749AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000750AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000751dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000752AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000753AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100754
Damien Miller04f80141999-11-19 15:32:34 +1100755AC_CHECK_FUNC(daemon,
756 [AC_DEFINE(HAVE_DAEMON)],
757 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
758)
759
Damien Miller9fb07e42000-03-05 16:22:59 +1100760AC_CHECK_FUNC(getpagesize,
761 [AC_DEFINE(HAVE_GETPAGESIZE)],
762 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
763)
764
Damien Millercb170cb2000-07-01 16:52:55 +1000765# Check for broken snprintf
766if test "x$ac_cv_func_snprintf" = "xyes" ; then
767 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
768 AC_TRY_RUN(
769 [
770#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700771int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000772 ],
773 [AC_MSG_RESULT(yes)],
774 [
775 AC_MSG_RESULT(no)
776 AC_DEFINE(BROKEN_SNPRINTF)
777 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
778 ]
779 )
780fi
781
Damien Millere8328192003-01-07 15:18:32 +1100782dnl see whether mkstemp() requires XXXXXX
783if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
784AC_MSG_CHECKING([for (overly) strict mkstemp])
785AC_TRY_RUN(
786 [
787#include <stdlib.h>
788main() { char template[]="conftest.mkstemp-test";
789if (mkstemp(template) == -1)
790 exit(1);
791unlink(template); exit(0);
792}
793 ],
794 [
795 AC_MSG_RESULT(no)
796 ],
797 [
798 AC_MSG_RESULT(yes)
799 AC_DEFINE(HAVE_STRICT_MKSTEMP)
800 ],
801 [
802 AC_MSG_RESULT(yes)
803 AC_DEFINE(HAVE_STRICT_MKSTEMP)
804 ]
805)
806fi
807
Damien Miller606f8802000-09-16 15:39:56 +1100808AC_FUNC_GETPGRP
809
Damien Millera64b57a2001-01-17 10:44:13 +1100810# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000811PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100812AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100813 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100814 [
Damien Millera64b57a2001-01-17 10:44:13 +1100815 if test "x$withval" != "xno" ; then
816 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
817 AC_MSG_ERROR([PAM headers not found])
818 fi
819
820 AC_CHECK_LIB(dl, dlopen, , )
821 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
822 AC_CHECK_FUNCS(pam_getenvlist)
823
824 disable_shadow=yes
825 PAM_MSG="yes"
826
827 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800828 if test $ac_cv_lib_dl_dlopen = yes; then
829 LIBPAM="-lpam -ldl"
830 else
831 LIBPAM="-lpam"
832 fi
833 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100834 fi
835 ]
836)
Damien Millera22ba012000-03-02 23:09:20 +1100837
Damien Millera64b57a2001-01-17 10:44:13 +1100838# Check for older PAM
839if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100840 # Check PAM strerror arguments (old PAM)
841 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
842 AC_TRY_COMPILE(
843 [
Damien Miller81171112000-04-23 11:14:01 +1000844#include <stdlib.h>
845#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100846 ],
847 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
848 [AC_MSG_RESULT(no)],
849 [
850 AC_DEFINE(HAVE_OLD_PAM)
851 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000852 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100853 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100854 )
Damien Millera22ba012000-03-02 23:09:20 +1100855fi
856
Damien Millerfc93d4b2002-09-04 23:26:29 +1000857# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
858# because the system crypt() is more featureful.
859if test "x$check_for_libcrypt_before" = "x1"; then
860 AC_CHECK_LIB(crypt, crypt)
861fi
862
Tim Riceaef73712002-05-11 13:17:42 -0700863# Search for OpenSSL
864saved_CPPFLAGS="$CPPFLAGS"
865saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100866AC_ARG_WITH(ssl-dir,
867 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
868 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000869 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700870 if test -d "$withval/lib"; then
871 if test -n "${need_dash_r}"; then
872 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
873 else
874 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
875 fi
876 else
877 if test -n "${need_dash_r}"; then
878 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
879 else
880 LDFLAGS="-L${withval} ${LDFLAGS}"
881 fi
882 fi
883 if test -d "$withval/include"; then
884 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
885 else
886 CPPFLAGS="-I${withval} ${CPPFLAGS}"
887 fi
Damien Millera22ba012000-03-02 23:09:20 +1100888 fi
889 ]
890)
Tim Riceaef73712002-05-11 13:17:42 -0700891LIBS="$LIBS -lcrypto"
892AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000893 [
Tim Riceaef73712002-05-11 13:17:42 -0700894 dnl Check default openssl install dir
895 if test -n "${need_dash_r}"; then
896 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000897 else
Tim Riceaef73712002-05-11 13:17:42 -0700898 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000899 fi
Tim Riceaef73712002-05-11 13:17:42 -0700900 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
901 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
902 [
903 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
904 ]
905 )
906 ]
907)
908
Tim Riced730b782002-08-13 18:52:10 -0700909# Determine OpenSSL header version
910AC_MSG_CHECKING([OpenSSL header version])
911AC_TRY_RUN(
912 [
913#include <stdio.h>
914#include <string.h>
915#include <openssl/opensslv.h>
916#define DATA "conftest.sslincver"
917int main(void) {
918 FILE *fd;
919 int rc;
920
921 fd = fopen(DATA,"w");
922 if(fd == NULL)
923 exit(1);
924
925 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
926 exit(1);
927
928 exit(0);
929}
930 ],
931 [
932 ssl_header_ver=`cat conftest.sslincver`
933 AC_MSG_RESULT($ssl_header_ver)
934 ],
935 [
936 AC_MSG_RESULT(not found)
937 AC_MSG_ERROR(OpenSSL version header not found.)
938 ]
939)
940
941# Determine OpenSSL library version
942AC_MSG_CHECKING([OpenSSL library version])
943AC_TRY_RUN(
944 [
945#include <stdio.h>
946#include <string.h>
947#include <openssl/opensslv.h>
948#include <openssl/crypto.h>
949#define DATA "conftest.ssllibver"
950int main(void) {
951 FILE *fd;
952 int rc;
953
954 fd = fopen(DATA,"w");
955 if(fd == NULL)
956 exit(1);
957
958 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
959 exit(1);
960
961 exit(0);
962}
963 ],
964 [
965 ssl_library_ver=`cat conftest.ssllibver`
966 AC_MSG_RESULT($ssl_library_ver)
967 ],
968 [
969 AC_MSG_RESULT(not found)
970 AC_MSG_ERROR(OpenSSL library not found.)
971 ]
972)
Damien Millera22ba012000-03-02 23:09:20 +1100973
Damien Millerec932372002-01-22 22:16:03 +1100974# Sanity check OpenSSL headers
975AC_MSG_CHECKING([whether OpenSSL's headers match the library])
976AC_TRY_RUN(
977 [
978#include <string.h>
979#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700980int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100981 ],
982 [
983 AC_MSG_RESULT(yes)
984 ],
985 [
986 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +1000987 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
988Check config.log for details.
989Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +1100990 ]
991)
992
Damien Millera64b57a2001-01-17 10:44:13 +1100993# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
994# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +1000995if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100996 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100997fi
998
Damien Miller6c21c512002-01-22 21:57:53 +1100999
1000### Configure cryptographic random number support
1001
1002# Check wheter OpenSSL seeds itself
1003AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1004AC_TRY_RUN(
1005 [
1006#include <string.h>
1007#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001008int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001009 ],
1010 [
1011 OPENSSL_SEEDS_ITSELF=yes
1012 AC_MSG_RESULT(yes)
1013 ],
1014 [
1015 AC_MSG_RESULT(no)
1016 # Default to use of the rand helper if OpenSSL doesn't
1017 # seed itself
1018 USE_RAND_HELPER=yes
1019 ]
1020)
1021
1022
1023# Do we want to force the use of the rand helper?
1024AC_ARG_WITH(rand-helper,
1025 [ --with-rand-helper Use subprocess to gather strong randomness ],
1026 [
1027 if test "x$withval" = "xno" ; then
1028 # Force use of OpenSSL's internal RNG, even if
1029 # the previous test showed it to be unseeded.
1030 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1031 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1032 OPENSSL_SEEDS_ITSELF=yes
1033 USE_RAND_HELPER=""
1034 fi
1035 else
1036 USE_RAND_HELPER=yes
1037 fi
1038 ],
1039)
1040
1041# Which randomness source do we use?
1042if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1043 # OpenSSL only
1044 AC_DEFINE(OPENSSL_PRNG_ONLY)
1045 RAND_MSG="OpenSSL internal ONLY"
1046 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001047elif test ! -z "$USE_RAND_HELPER" ; then
1048 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001049 RAND_MSG="ssh-rand-helper"
1050 INSTALL_SSH_RAND_HELPER="yes"
1051fi
1052AC_SUBST(INSTALL_SSH_RAND_HELPER)
1053
1054### Configuration of ssh-rand-helper
1055
1056# PRNGD TCP socket
1057AC_ARG_WITH(prngd-port,
1058 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1059 [
Damien Millere996d722002-01-23 11:20:59 +11001060 case "$withval" in
1061 no)
1062 withval=""
1063 ;;
1064 [[0-9]]*)
1065 ;;
1066 *)
1067 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1068 ;;
1069 esac
1070 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001071 PRNGD_PORT="$withval"
1072 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1073 fi
1074 ]
1075)
1076
1077# PRNGD Unix domain socket
1078AC_ARG_WITH(prngd-socket,
1079 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1080 [
Damien Millere996d722002-01-23 11:20:59 +11001081 case "$withval" in
1082 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001083 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001084 ;;
1085 no)
1086 withval=""
1087 ;;
1088 /*)
1089 ;;
1090 *)
1091 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1092 ;;
1093 esac
1094
1095 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001096 if test ! -z "$PRNGD_PORT" ; then
1097 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1098 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001099 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001100 AC_MSG_WARN(Entropy socket is not readable)
1101 fi
1102 PRNGD_SOCKET="$withval"
1103 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1104 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001105 ],
1106 [
1107 # Check for existing socket only if we don't have a random device already
1108 if test "$USE_RAND_HELPER" = yes ; then
1109 AC_MSG_CHECKING(for PRNGD/EGD socket)
1110 # Insert other locations here
1111 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1112 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1113 PRNGD_SOCKET="$sock"
1114 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1115 break;
1116 fi
1117 done
1118 if test ! -z "$PRNGD_SOCKET" ; then
1119 AC_MSG_RESULT($PRNGD_SOCKET)
1120 else
1121 AC_MSG_RESULT(not found)
1122 fi
1123 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001124 ]
1125)
1126
1127# Change default command timeout for hashing entropy source
1128entropy_timeout=200
1129AC_ARG_WITH(entropy-timeout,
1130 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1131 [
1132 if test "x$withval" != "xno" ; then
1133 entropy_timeout=$withval
1134 fi
1135 ]
1136)
Damien Miller6c21c512002-01-22 21:57:53 +11001137AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1138
Damien Millerd3f6ad22002-06-25 10:24:47 +10001139SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001140AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001141 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001142 [
1143 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001144 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001145 fi
1146 ]
1147)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001148AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1149AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001150
Tim Rice88f2ab52002-03-17 12:17:34 -08001151# We do this little dance with the search path to insure
1152# that programs that we select for use by installed programs
1153# (which may be run by the super-user) come from trusted
1154# locations before they come from the user's private area.
1155# This should help avoid accidentally configuring some
1156# random version of a program in someone's personal bin.
1157
1158OPATH=$PATH
1159PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001160test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001161test -d /sbin && PATH=$PATH:/sbin
1162test -d /usr/sbin && PATH=$PATH:/usr/sbin
1163PATH=$PATH:/etc:$OPATH
1164
Damien Miller6c21c512002-01-22 21:57:53 +11001165# These programs are used by the command hashing source to gather entropy
1166OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1167OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1168OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1169OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1170OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1171OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1172OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1173OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1174OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1175OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1176OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1177OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1178OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1179OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1180OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1181OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001182# restore PATH
1183PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001184
1185# Where does ssh-rand-helper get its randomness from?
1186INSTALL_SSH_PRNG_CMDS=""
1187if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1188 if test ! -z "$PRNGD_PORT" ; then
1189 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1190 elif test ! -z "$PRNGD_SOCKET" ; then
1191 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1192 else
1193 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1194 RAND_HELPER_CMDHASH=yes
1195 INSTALL_SSH_PRNG_CMDS="yes"
1196 fi
1197fi
1198AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1199
1200
Ben Lindstromb5628642000-10-18 00:02:25 +00001201# Cheap hack to ensure NEWS-OS libraries are arranged right.
1202if test ! -z "$SONY" ; then
1203 LIBS="$LIBS -liberty";
1204fi
1205
Damien Millera22ba012000-03-02 23:09:20 +11001206# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001207AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001208AC_CHECK_SIZEOF(short int, 2)
1209AC_CHECK_SIZEOF(int, 4)
1210AC_CHECK_SIZEOF(long int, 4)
1211AC_CHECK_SIZEOF(long long int, 8)
1212
Damien Millerfa2bb692002-04-23 23:22:25 +10001213# Sanity check long long for some platforms (AIX)
1214if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1215 ac_cv_sizeof_long_long_int=0
1216fi
1217
Damien Millera22ba012000-03-02 23:09:20 +11001218# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001219AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1220 AC_TRY_COMPILE(
1221 [ #include <sys/types.h> ],
1222 [ u_int a; a = 1;],
1223 [ ac_cv_have_u_int="yes" ],
1224 [ ac_cv_have_u_int="no" ]
1225 )
1226])
1227if test "x$ac_cv_have_u_int" = "xyes" ; then
1228 AC_DEFINE(HAVE_U_INT)
1229 have_u_int=1
1230fi
1231
Damien Miller61e50f12000-05-08 20:49:37 +10001232AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1233 AC_TRY_COMPILE(
1234 [ #include <sys/types.h> ],
1235 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1236 [ ac_cv_have_intxx_t="yes" ],
1237 [ ac_cv_have_intxx_t="no" ]
1238 )
1239])
1240if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1241 AC_DEFINE(HAVE_INTXX_T)
1242 have_intxx_t=1
1243fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001244
1245if (test -z "$have_intxx_t" && \
1246 test "x$ac_cv_header_stdint_h" = "xyes")
1247then
1248 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1249 AC_TRY_COMPILE(
1250 [ #include <stdint.h> ],
1251 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1252 [
1253 AC_DEFINE(HAVE_INTXX_T)
1254 AC_MSG_RESULT(yes)
1255 ],
1256 [ AC_MSG_RESULT(no) ]
1257 )
1258fi
1259
Damien Miller578783e2000-09-23 14:12:24 +11001260AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1261 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001262 [
1263#include <sys/types.h>
1264#ifdef HAVE_STDINT_H
1265# include <stdint.h>
1266#endif
1267#include <sys/socket.h>
1268#ifdef HAVE_SYS_BITYPES_H
1269# include <sys/bitypes.h>
1270#endif
1271 ],
Damien Miller578783e2000-09-23 14:12:24 +11001272 [ int64_t a; a = 1;],
1273 [ ac_cv_have_int64_t="yes" ],
1274 [ ac_cv_have_int64_t="no" ]
1275 )
1276])
1277if test "x$ac_cv_have_int64_t" = "xyes" ; then
1278 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001279fi
1280
Damien Miller61e50f12000-05-08 20:49:37 +10001281AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1282 AC_TRY_COMPILE(
1283 [ #include <sys/types.h> ],
1284 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1285 [ ac_cv_have_u_intxx_t="yes" ],
1286 [ ac_cv_have_u_intxx_t="no" ]
1287 )
1288])
1289if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1290 AC_DEFINE(HAVE_U_INTXX_T)
1291 have_u_intxx_t=1
1292fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001293
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001294if test -z "$have_u_intxx_t" ; then
1295 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1296 AC_TRY_COMPILE(
1297 [ #include <sys/socket.h> ],
1298 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1299 [
1300 AC_DEFINE(HAVE_U_INTXX_T)
1301 AC_MSG_RESULT(yes)
1302 ],
1303 [ AC_MSG_RESULT(no) ]
1304 )
1305fi
1306
Damien Miller578783e2000-09-23 14:12:24 +11001307AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1308 AC_TRY_COMPILE(
1309 [ #include <sys/types.h> ],
1310 [ u_int64_t a; a = 1;],
1311 [ ac_cv_have_u_int64_t="yes" ],
1312 [ ac_cv_have_u_int64_t="no" ]
1313 )
1314])
1315if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1316 AC_DEFINE(HAVE_U_INT64_T)
1317 have_u_int64_t=1
1318fi
1319
Tim Rice4cec93f2002-02-26 08:40:48 -08001320if test -z "$have_u_int64_t" ; then
1321 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1322 AC_TRY_COMPILE(
1323 [ #include <sys/bitypes.h> ],
1324 [ u_int64_t a; a = 1],
1325 [
1326 AC_DEFINE(HAVE_U_INT64_T)
1327 AC_MSG_RESULT(yes)
1328 ],
1329 [ AC_MSG_RESULT(no) ]
1330 )
1331fi
1332
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001333if test -z "$have_u_intxx_t" ; then
1334 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1335 AC_TRY_COMPILE(
1336 [
1337#include <sys/types.h>
1338 ],
1339 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1340 [ ac_cv_have_uintxx_t="yes" ],
1341 [ ac_cv_have_uintxx_t="no" ]
1342 )
1343 ])
1344 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1345 AC_DEFINE(HAVE_UINTXX_T)
1346 fi
1347fi
1348
1349if test -z "$have_uintxx_t" ; then
1350 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1351 AC_TRY_COMPILE(
1352 [ #include <stdint.h> ],
1353 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1354 [
1355 AC_DEFINE(HAVE_UINTXX_T)
1356 AC_MSG_RESULT(yes)
1357 ],
1358 [ AC_MSG_RESULT(no) ]
1359 )
1360fi
1361
Damien Milleredb82922000-06-20 13:25:52 +10001362if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1363 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001364then
1365 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1366 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001367 [
1368#include <sys/bitypes.h>
1369 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001370 [
Damien Miller70494d12000-04-03 15:57:06 +10001371 int8_t a; int16_t b; int32_t c;
1372 u_int8_t e; u_int16_t f; u_int32_t g;
1373 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001374 ],
1375 [
1376 AC_DEFINE(HAVE_U_INTXX_T)
1377 AC_DEFINE(HAVE_INTXX_T)
1378 AC_MSG_RESULT(yes)
1379 ],
1380 [AC_MSG_RESULT(no)]
1381 )
1382fi
1383
Damien Miller58be7382001-09-15 21:31:54 +10001384
1385AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1386 AC_TRY_COMPILE(
1387 [
1388#include <sys/types.h>
1389 ],
1390 [ u_char foo; foo = 125; ],
1391 [ ac_cv_have_u_char="yes" ],
1392 [ ac_cv_have_u_char="no" ]
1393 )
1394])
1395if test "x$ac_cv_have_u_char" = "xyes" ; then
1396 AC_DEFINE(HAVE_U_CHAR)
1397fi
1398
Tim Rice13aae5e2001-10-21 17:53:58 -07001399TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001400
Tim Rice200a5c02002-02-26 22:12:34 -08001401AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001402
Damien Miller61e50f12000-05-08 20:49:37 +10001403AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1404 AC_TRY_COMPILE(
1405 [
1406#include <sys/types.h>
1407 ],
1408 [ size_t foo; foo = 1235; ],
1409 [ ac_cv_have_size_t="yes" ],
1410 [ ac_cv_have_size_t="no" ]
1411 )
1412])
1413if test "x$ac_cv_have_size_t" = "xyes" ; then
1414 AC_DEFINE(HAVE_SIZE_T)
1415fi
Damien Miller95058511999-12-29 10:36:45 +11001416
Damien Miller615f9392000-05-17 22:53:33 +10001417AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1418 AC_TRY_COMPILE(
1419 [
1420#include <sys/types.h>
1421 ],
1422 [ ssize_t foo; foo = 1235; ],
1423 [ ac_cv_have_ssize_t="yes" ],
1424 [ ac_cv_have_ssize_t="no" ]
1425 )
1426])
1427if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1428 AC_DEFINE(HAVE_SSIZE_T)
1429fi
1430
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001431AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1432 AC_TRY_COMPILE(
1433 [
1434#include <time.h>
1435 ],
1436 [ clock_t foo; foo = 1235; ],
1437 [ ac_cv_have_clock_t="yes" ],
1438 [ ac_cv_have_clock_t="no" ]
1439 )
1440])
1441if test "x$ac_cv_have_clock_t" = "xyes" ; then
1442 AC_DEFINE(HAVE_CLOCK_T)
1443fi
1444
Damien Millerb54b40e2000-06-23 08:23:34 +10001445AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1446 AC_TRY_COMPILE(
1447 [
1448#include <sys/types.h>
1449#include <sys/socket.h>
1450 ],
1451 [ sa_family_t foo; foo = 1235; ],
1452 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001453 [ AC_TRY_COMPILE(
1454 [
1455#include <sys/types.h>
1456#include <sys/socket.h>
1457#include <netinet/in.h>
1458 ],
1459 [ sa_family_t foo; foo = 1235; ],
1460 [ ac_cv_have_sa_family_t="yes" ],
1461
Damien Millerb54b40e2000-06-23 08:23:34 +10001462 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001463 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001464 )
1465])
1466if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1467 AC_DEFINE(HAVE_SA_FAMILY_T)
1468fi
1469
Damien Miller0f91b4e2000-06-18 15:43:25 +10001470AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1471 AC_TRY_COMPILE(
1472 [
1473#include <sys/types.h>
1474 ],
1475 [ pid_t foo; foo = 1235; ],
1476 [ ac_cv_have_pid_t="yes" ],
1477 [ ac_cv_have_pid_t="no" ]
1478 )
1479])
1480if test "x$ac_cv_have_pid_t" = "xyes" ; then
1481 AC_DEFINE(HAVE_PID_T)
1482fi
1483
1484AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1485 AC_TRY_COMPILE(
1486 [
1487#include <sys/types.h>
1488 ],
1489 [ mode_t foo; foo = 1235; ],
1490 [ ac_cv_have_mode_t="yes" ],
1491 [ ac_cv_have_mode_t="no" ]
1492 )
1493])
1494if test "x$ac_cv_have_mode_t" = "xyes" ; then
1495 AC_DEFINE(HAVE_MODE_T)
1496fi
1497
Damien Miller61e50f12000-05-08 20:49:37 +10001498
1499AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1500 AC_TRY_COMPILE(
1501 [
Damien Miller81171112000-04-23 11:14:01 +10001502#include <sys/types.h>
1503#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001504 ],
1505 [ struct sockaddr_storage s; ],
1506 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1507 [ ac_cv_have_struct_sockaddr_storage="no" ]
1508 )
1509])
1510if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1511 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1512fi
Damien Miller34132e52000-01-14 15:45:46 +11001513
Damien Miller61e50f12000-05-08 20:49:37 +10001514AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1515 AC_TRY_COMPILE(
1516 [
Damien Miller7b22d652000-06-18 14:07:04 +10001517#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001518#include <netinet/in.h>
1519 ],
1520 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1521 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1522 [ ac_cv_have_struct_sockaddr_in6="no" ]
1523 )
1524])
1525if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1526 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1527fi
Damien Miller34132e52000-01-14 15:45:46 +11001528
Damien Miller61e50f12000-05-08 20:49:37 +10001529AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1530 AC_TRY_COMPILE(
1531 [
Damien Miller7b22d652000-06-18 14:07:04 +10001532#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001533#include <netinet/in.h>
1534 ],
1535 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1536 [ ac_cv_have_struct_in6_addr="yes" ],
1537 [ ac_cv_have_struct_in6_addr="no" ]
1538 )
1539])
1540if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1541 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1542fi
Damien Miller34132e52000-01-14 15:45:46 +11001543
Damien Miller61e50f12000-05-08 20:49:37 +10001544AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1545 AC_TRY_COMPILE(
1546 [
Damien Miller81171112000-04-23 11:14:01 +10001547#include <sys/types.h>
1548#include <sys/socket.h>
1549#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001550 ],
1551 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1552 [ ac_cv_have_struct_addrinfo="yes" ],
1553 [ ac_cv_have_struct_addrinfo="no" ]
1554 )
1555])
1556if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1557 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1558fi
1559
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001560AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1561 AC_TRY_COMPILE(
1562 [ #include <sys/time.h> ],
1563 [ struct timeval tv; tv.tv_sec = 1;],
1564 [ ac_cv_have_struct_timeval="yes" ],
1565 [ ac_cv_have_struct_timeval="no" ]
1566 )
1567])
1568if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1569 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1570 have_struct_timeval=1
1571fi
1572
Tim Rice4e4dc562003-03-18 10:21:40 -08001573AC_CHECK_TYPES(struct timespec)
1574
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001575# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001576if test "x$ac_cv_have_int64_t" = "xno" -a \
1577 "x$ac_cv_sizeof_long_int" != "x8" -a \
1578 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001579 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1580 echo "an alternative compiler (I.E., GCC) before continuing."
1581 echo ""
1582 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001583else
1584dnl test snprintf (broken on SCO w/gcc)
1585 AC_TRY_RUN(
1586 [
1587#include <stdio.h>
1588#include <string.h>
1589#ifdef HAVE_SNPRINTF
1590main()
1591{
1592 char buf[50];
1593 char expected_out[50];
1594 int mazsize = 50 ;
1595#if (SIZEOF_LONG_INT == 8)
1596 long int num = 0x7fffffffffffffff;
1597#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001598 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001599#endif
1600 strcpy(expected_out, "9223372036854775807");
1601 snprintf(buf, mazsize, "%lld", num);
1602 if(strcmp(buf, expected_out) != 0)
1603 exit(1);
1604 exit(0);
1605}
1606#else
1607main() { exit(0); }
1608#endif
1609 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1610 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001611fi
1612
Damien Miller78315eb2000-09-29 23:01:36 +11001613dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001614OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1615OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1616OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1617OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1618OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001619OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001620OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1621OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001622OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001623OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1624OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1625OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1626OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001627OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1628OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1629OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1630OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001631
1632AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001633
Damien Miller61e50f12000-05-08 20:49:37 +10001634AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1635 ac_cv_have_ss_family_in_struct_ss, [
1636 AC_TRY_COMPILE(
1637 [
Damien Miller81171112000-04-23 11:14:01 +10001638#include <sys/types.h>
1639#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001640 ],
1641 [ struct sockaddr_storage s; s.ss_family = 1; ],
1642 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1643 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1644 )
1645])
1646if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1647 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1648fi
1649
Damien Miller61e50f12000-05-08 20:49:37 +10001650AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1651 ac_cv_have___ss_family_in_struct_ss, [
1652 AC_TRY_COMPILE(
1653 [
Damien Miller81171112000-04-23 11:14:01 +10001654#include <sys/types.h>
1655#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001656 ],
1657 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1658 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1659 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1660 )
1661])
1662if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1663 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1664fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001665
Damien Millerad833b32000-08-23 10:46:23 +10001666AC_CACHE_CHECK([for pw_class field in struct passwd],
1667 ac_cv_have_pw_class_in_struct_passwd, [
1668 AC_TRY_COMPILE(
1669 [
Damien Millerad833b32000-08-23 10:46:23 +10001670#include <pwd.h>
1671 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001672 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001673 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1674 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1675 )
1676])
1677if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1678 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1679fi
1680
Kevin Steves82456952001-06-22 21:14:18 +00001681AC_CACHE_CHECK([for pw_expire field in struct passwd],
1682 ac_cv_have_pw_expire_in_struct_passwd, [
1683 AC_TRY_COMPILE(
1684 [
1685#include <pwd.h>
1686 ],
1687 [ struct passwd p; p.pw_expire = 0; ],
1688 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1689 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1690 )
1691])
1692if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1693 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1694fi
1695
1696AC_CACHE_CHECK([for pw_change field in struct passwd],
1697 ac_cv_have_pw_change_in_struct_passwd, [
1698 AC_TRY_COMPILE(
1699 [
1700#include <pwd.h>
1701 ],
1702 [ struct passwd p; p.pw_change = 0; ],
1703 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1704 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1705 )
1706])
1707if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1708 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1709fi
Damien Miller61e50f12000-05-08 20:49:37 +10001710
Tim Rice28bbb0c2002-05-27 17:37:32 -07001711dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001712AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1713 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001714 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001715 [
Tim Riceae49fe62002-04-12 10:26:21 -07001716#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001717#include <sys/socket.h>
1718#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001719int main() {
1720#ifdef msg_accrights
1721exit(1);
1722#endif
1723struct msghdr m;
1724m.msg_accrights = 0;
1725exit(0);
1726}
Kevin Steves939c9db2002-03-22 17:23:25 +00001727 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001728 [ ac_cv_have_accrights_in_msghdr="yes" ],
1729 [ ac_cv_have_accrights_in_msghdr="no" ]
1730 )
1731])
1732if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1733 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1734fi
1735
Kevin Stevesa44e0352002-04-07 16:18:03 +00001736AC_CACHE_CHECK([for msg_control field in struct msghdr],
1737 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001738 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001739 [
Tim Riceae49fe62002-04-12 10:26:21 -07001740#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001741#include <sys/socket.h>
1742#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001743int main() {
1744#ifdef msg_control
1745exit(1);
1746#endif
1747struct msghdr m;
1748m.msg_control = 0;
1749exit(0);
1750}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001751 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001752 [ ac_cv_have_control_in_msghdr="yes" ],
1753 [ ac_cv_have_control_in_msghdr="no" ]
1754 )
1755])
1756if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1757 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1758fi
1759
Damien Miller61e50f12000-05-08 20:49:37 +10001760AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1761 AC_TRY_LINK([],
1762 [ extern char *__progname; printf("%s", __progname); ],
1763 [ ac_cv_libc_defines___progname="yes" ],
1764 [ ac_cv_libc_defines___progname="no" ]
1765 )
1766])
1767if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1768 AC_DEFINE(HAVE___PROGNAME)
1769fi
1770
Kevin Steves4846f4a2002-03-22 18:19:53 +00001771AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1772 AC_TRY_LINK([
1773#include <stdio.h>
1774],
1775 [ printf("%s", __FUNCTION__); ],
1776 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1777 [ ac_cv_cc_implements___FUNCTION__="no" ]
1778 )
1779])
1780if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1781 AC_DEFINE(HAVE___FUNCTION__)
1782fi
1783
1784AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1785 AC_TRY_LINK([
1786#include <stdio.h>
1787],
1788 [ printf("%s", __func__); ],
1789 [ ac_cv_cc_implements___func__="yes" ],
1790 [ ac_cv_cc_implements___func__="no" ]
1791 )
1792])
1793if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1794 AC_DEFINE(HAVE___func__)
1795fi
1796
Damien Miller4f8e6692001-07-14 13:22:53 +10001797AC_CACHE_CHECK([whether getopt has optreset support],
1798 ac_cv_have_getopt_optreset, [
1799 AC_TRY_LINK(
1800 [
1801#include <getopt.h>
1802 ],
1803 [ extern int optreset; optreset = 0; ],
1804 [ ac_cv_have_getopt_optreset="yes" ],
1805 [ ac_cv_have_getopt_optreset="no" ]
1806 )
1807])
1808if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1809 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1810fi
Damien Millera22ba012000-03-02 23:09:20 +11001811
Damien Millerecbb26d2000-07-15 14:59:14 +10001812AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1813 AC_TRY_LINK([],
1814 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1815 [ ac_cv_libc_defines_sys_errlist="yes" ],
1816 [ ac_cv_libc_defines_sys_errlist="no" ]
1817 )
1818])
1819if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1820 AC_DEFINE(HAVE_SYS_ERRLIST)
1821fi
1822
1823
Damien Miller11fa2cc2000-08-16 10:35:58 +10001824AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1825 AC_TRY_LINK([],
1826 [ extern int sys_nerr; printf("%i", sys_nerr);],
1827 [ ac_cv_libc_defines_sys_nerr="yes" ],
1828 [ ac_cv_libc_defines_sys_nerr="no" ]
1829 )
1830])
1831if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1832 AC_DEFINE(HAVE_SYS_NERR)
1833fi
1834
Damien Miller85de5802001-09-18 14:01:11 +10001835SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001836# Check whether user wants sectok support
1837AC_ARG_WITH(sectok,
1838 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001839 [
1840 if test "x$withval" != "xno" ; then
1841 if test "x$withval" != "xyes" ; then
1842 CPPFLAGS="$CPPFLAGS -I${withval}"
1843 LDFLAGS="$LDFLAGS -L${withval}"
1844 if test ! -z "$need_dash_r" ; then
1845 LDFLAGS="$LDFLAGS -R${withval}"
1846 fi
1847 if test ! -z "$blibpath" ; then
1848 blibpath="$blibpath:${withval}"
1849 fi
1850 fi
1851 AC_CHECK_HEADERS(sectok.h)
1852 if test "$ac_cv_header_sectok_h" != yes; then
1853 AC_MSG_ERROR(Can't find sectok.h)
1854 fi
1855 AC_CHECK_LIB(sectok, sectok_open)
1856 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1857 AC_MSG_ERROR(Can't find libsectok)
1858 fi
1859 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001860 AC_DEFINE(USE_SECTOK)
1861 SCARD_MSG="yes, using sectok"
1862 fi
1863 ]
1864)
1865
1866# Check whether user wants OpenSC support
1867AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001868 AC_HELP_STRING([--with-opensc=PFX],
1869 [Enable smartcard support using OpenSC]),
1870 opensc_config_prefix="$withval", opensc_config_prefix="")
1871if test x$opensc_config_prefix != x ; then
1872 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1873 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1874 if test "$OPENSC_CONFIG" != "no"; then
1875 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1876 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1877 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1878 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1879 AC_DEFINE(SMARTCARD)
1880 AC_DEFINE(USE_OPENSC)
1881 SCARD_MSG="yes, using OpenSC"
1882 fi
1883fi
Damien Miller85de5802001-09-18 14:01:11 +10001884
Damien Miller7abe09b2003-05-15 10:53:49 +10001885# Check whether user wants DNS support
1886DNS_MSG="no"
1887AC_ARG_WITH(dns,
1888 [ --with-dns Support for fetching keys from DNS (experimental)],
1889 [
1890 if test "x$withval" != "xno" ; then
Damien Millerd9ec3702003-05-15 12:27:08 +10001891 DNS_MSG="yes"
1892 AC_DEFINE(DNS)
1893 AC_SEARCH_LIBS(getrrsetbyname, resolv,
Damien Miller200d0a72003-06-30 19:21:36 +10001894 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1895 [
1896 # Needed by our getrrsetbyname()
1897 AC_SEARCH_LIBS(res_query, resolv)
1898 AC_SEARCH_LIBS(dn_expand, resolv)
1899 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10001900 fi
1901 ]
1902)
1903
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001904# Check whether user wants Kerberos 5 support
1905KRB5_MSG="no"
1906AC_ARG_WITH(kerberos5,
1907 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1908 [
1909 if test "x$withval" != "xno" ; then
1910 if test "x$withval" = "xyes" ; then
1911 KRB5ROOT="/usr/local"
1912 else
1913 KRB5ROOT=${withval}
1914 fi
1915 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1916 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1917 AC_DEFINE(KRB5)
1918 KRB5_MSG="yes"
1919 AC_MSG_CHECKING(whether we are using Heimdal)
1920 AC_TRY_COMPILE([ #include <krb5.h> ],
1921 [ char *tmp = heimdal_version; ],
1922 [ AC_MSG_RESULT(yes)
1923 AC_DEFINE(HEIMDAL)
1924 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1925 ],
1926 [ AC_MSG_RESULT(no)
1927 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1928 ]
1929 )
1930 if test ! -z "$need_dash_r" ; then
1931 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1932 fi
1933 if test ! -z "$blibpath" ; then
1934 blibpath="$blibpath:${KRB5ROOT}/lib"
1935 fi
Damien Miller200d0a72003-06-30 19:21:36 +10001936 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001937
1938 KRB5=yes
1939 fi
1940 ]
1941)
1942# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001943KRB4_MSG="no"
1944AC_ARG_WITH(kerberos4,
1945 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1946 [
1947 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001948 if test "x$withval" != "xyes" ; then
1949 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1950 LDFLAGS="$LDFLAGS -L${withval}/lib"
1951 if test ! -z "$need_dash_r" ; then
1952 LDFLAGS="$LDFLAGS -R${withval}/lib"
1953 fi
1954 if test ! -z "$blibpath" ; then
1955 blibpath="$blibpath:${withval}/lib"
1956 fi
1957 else
1958 if test -d /usr/include/kerberosIV ; then
1959 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1960 fi
1961 fi
1962
1963 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001964 if test "$ac_cv_header_krb_h" != yes; then
1965 AC_MSG_WARN([Cannot find krb.h, build may fail])
1966 fi
Damien Miller98344742001-03-28 14:37:06 +10001967 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001968 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001969 AC_CHECK_LIB(krb4, main)
1970 if test "$ac_cv_lib_krb4_main" != yes; then
1971 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1972 else
1973 KLIBS="-lkrb4"
1974 fi
1975 else
1976 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001977 fi
Damien Miller98344742001-03-28 14:37:06 +10001978 AC_CHECK_LIB(des, des_cbc_encrypt)
1979 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1980 AC_CHECK_LIB(des425, des_cbc_encrypt)
1981 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1982 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1983 else
1984 KLIBS="-ldes425"
1985 fi
1986 else
1987 KLIBS="-ldes"
1988 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001989 AC_CHECK_LIB(resolv, dn_expand, , )
1990 KRB4=yes
1991 KRB4_MSG="yes"
1992 AC_DEFINE(KRB4)
1993 fi
1994 ]
1995)
1996
1997# Check whether user wants AFS support
1998AFS_MSG="no"
1999AC_ARG_WITH(afs,
2000 [ --with-afs=PATH Enable AFS support],
2001 [
2002 if test "x$withval" != "xno" ; then
2003
2004 if test "x$withval" != "xyes" ; then
2005 CPPFLAGS="$CPPFLAGS -I${withval}/include"
2006 LDFLAGS="$LDFLAGS -L${withval}/lib"
2007 fi
2008
2009 if test -z "$KRB4" ; then
2010 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
2011 fi
2012
2013 LIBS="-lkafs $LIBS"
2014 if test ! -z "$AFS_LIBS" ; then
2015 LIBS="$LIBS $AFS_LIBS"
2016 fi
2017 AC_DEFINE(AFS)
2018 AFS_MSG="yes"
2019 fi
2020 ]
2021)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002022LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002023
Damien Millera22ba012000-03-02 23:09:20 +11002024# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002025
Damien Millerf58c6722002-05-13 13:15:42 +10002026PRIVSEP_PATH=/var/empty
2027AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002028 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002029 [
2030 if test "x$withval" != "$no" ; then
2031 PRIVSEP_PATH=$withval
2032 fi
2033 ]
2034)
2035AC_SUBST(PRIVSEP_PATH)
2036
Damien Millera22ba012000-03-02 23:09:20 +11002037AC_ARG_WITH(xauth,
2038 [ --with-xauth=PATH Specify path to xauth program ],
2039 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002040 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002041 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002042 fi
2043 ],
2044 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002045 TestPath="$PATH"
2046 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2047 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2048 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2049 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2050 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002051 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002052 xauth_path="/usr/openwin/bin/xauth"
2053 fi
2054 ]
2055)
2056
Damien Miller7d901272003-01-13 16:55:22 +11002057STRIP_OPT=-s
2058AC_ARG_ENABLE(strip,
2059 [ --disable-strip Disable calling strip(1) on install],
2060 [
2061 if test "x$enableval" = "xno" ; then
2062 STRIP_OPT=
2063 fi
2064 ]
2065)
2066AC_SUBST(STRIP_OPT)
2067
Damien Millera19cf472000-11-29 13:28:50 +11002068if test -z "$xauth_path" ; then
2069 XAUTH_PATH="undefined"
2070 AC_SUBST(XAUTH_PATH)
2071else
Damien Millera22ba012000-03-02 23:09:20 +11002072 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002073 XAUTH_PATH=$xauth_path
2074 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002075fi
Damien Millera22ba012000-03-02 23:09:20 +11002076
2077# Check for mail directory (last resort if we cannot get it from headers)
2078if test ! -z "$MAIL" ; then
2079 maildir=`dirname $MAIL`
2080 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2081fi
2082
Damien Millera22ba012000-03-02 23:09:20 +11002083if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002084 if test "x$disable_ptmx_check" != "xyes" ; then
2085 AC_CHECK_FILE("/dev/ptmx",
2086 [
2087 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2088 have_dev_ptmx=1
2089 ]
2090 )
2091 fi
Damien Millera22ba012000-03-02 23:09:20 +11002092fi
Damien Miller204ad072000-03-02 23:56:12 +11002093AC_CHECK_FILE("/dev/ptc",
2094 [
2095 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2096 have_dev_ptc=1
2097 ]
2098)
2099
Damien Millera22ba012000-03-02 23:09:20 +11002100# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002101AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002102 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002103 [
Damien Miller897741e2001-04-16 10:41:46 +10002104 case "$withval" in
2105 man|cat|doc)
2106 MANTYPE=$withval
2107 ;;
2108 *)
2109 AC_MSG_ERROR(invalid man type: $withval)
2110 ;;
2111 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002112 ]
2113)
Ben Lindstrombc709922001-04-18 18:04:21 +00002114if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002115 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2116 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002117 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2118 MANTYPE=doc
2119 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2120 MANTYPE=man
2121 else
2122 MANTYPE=cat
2123 fi
2124fi
Damien Miller670a4b82000-01-22 13:53:11 +11002125AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002126if test "$MANTYPE" = "doc"; then
2127 mansubdir=man;
2128else
2129 mansubdir=$MANTYPE;
2130fi
2131AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002132
Damien Millera22ba012000-03-02 23:09:20 +11002133# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002134MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002135AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002136 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002137 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002138 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002139 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002140 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002141 fi
2142 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002143)
2144
Damien Millera22ba012000-03-02 23:09:20 +11002145# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002146AC_ARG_WITH(shadow,
2147 [ --without-shadow Disable shadow password support],
2148 [
2149 if test "x$withval" = "xno" ; then
2150 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002151 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002152 fi
2153 ]
2154)
2155
Damien Miller1f335fb2000-06-26 11:31:33 +10002156if test -z "$disable_shadow" ; then
2157 AC_MSG_CHECKING([if the systems has expire shadow information])
2158 AC_TRY_COMPILE(
2159 [
2160#include <sys/types.h>
2161#include <shadow.h>
2162 struct spwd sp;
2163 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2164 [ sp_expire_available=yes ], []
2165 )
2166
2167 if test "x$sp_expire_available" = "xyes" ; then
2168 AC_MSG_RESULT(yes)
2169 AC_DEFINE(HAS_SHADOW_EXPIRE)
2170 else
2171 AC_MSG_RESULT(no)
2172 fi
2173fi
2174
Damien Millera22ba012000-03-02 23:09:20 +11002175# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002176if test ! -z "$IPADDR_IN_DISPLAY" ; then
2177 DISPLAY_HACK_MSG="yes"
2178 AC_DEFINE(IPADDR_IN_DISPLAY)
2179else
2180 DISPLAY_HACK_MSG="no"
2181 AC_ARG_WITH(ipaddr-display,
2182 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2183 [
2184 if test "x$withval" != "xno" ; then
2185 AC_DEFINE(IPADDR_IN_DISPLAY)
2186 DISPLAY_HACK_MSG="yes"
2187 fi
2188 ]
2189 )
2190fi
Damien Miller76112de1999-12-21 11:18:08 +11002191
Tim Rice43a1c132002-04-17 21:19:14 -07002192dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2193if test $ac_cv_func_login_getcapbool = "yes" -a \
2194 $ac_cv_header_login_cap_h = "yes" ; then
2195 USES_LOGIN_CONF=yes
2196fi
Damien Millera22ba012000-03-02 23:09:20 +11002197# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002198SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002199AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002200 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002201 [
Tim Rice43a1c132002-04-17 21:19:14 -07002202 if test "$USES_LOGIN_CONF" = "yes" ; then
2203 AC_MSG_WARN([
2204--with-default-path=PATH has no effect on this system.
2205Edit /etc/login.conf instead.])
2206 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002207 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002208 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002209 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002210 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002211 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2212 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2213 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002214 AC_TRY_RUN(
2215 [
2216/* find out what STDPATH is */
2217#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002218#ifdef HAVE_PATHS_H
2219# include <paths.h>
2220#endif
2221#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002222# ifdef _PATH_USERPATH /* Irix */
2223# define _PATH_STDPATH _PATH_USERPATH
2224# else
2225# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2226# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002227#endif
2228#include <sys/types.h>
2229#include <sys/stat.h>
2230#include <fcntl.h>
2231#define DATA "conftest.stdpath"
2232
2233main()
2234{
2235 FILE *fd;
2236 int rc;
2237
2238 fd = fopen(DATA,"w");
2239 if(fd == NULL)
2240 exit(1);
2241
2242 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2243 exit(1);
2244
2245 exit(0);
2246}
2247 ], [ user_path=`cat conftest.stdpath` ],
2248 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2249 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2250 )
2251# make sure $bindir is in USER_PATH so scp will work
2252 t_bindir=`eval echo ${bindir}`
2253 case $t_bindir in
2254 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2255 esac
2256 case $t_bindir in
2257 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2258 esac
2259 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2260 if test $? -ne 0 ; then
2261 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2262 if test $? -ne 0 ; then
2263 user_path=$user_path:$t_bindir
2264 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2265 fi
2266 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002267 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002268)
Tim Rice43a1c132002-04-17 21:19:14 -07002269if test "$USES_LOGIN_CONF" != "yes" ; then
2270 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2271 AC_SUBST(user_path)
2272fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002273
Damien Millera18bbd32002-05-13 10:48:57 +10002274# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002275AC_ARG_WITH(superuser-path,
2276 [ --with-superuser-path= Specify different path for super-user],
2277 [
2278 if test "x$withval" != "xno" ; then
2279 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2280 superuser_path=$withval
2281 fi
2282 ]
2283)
2284
2285
Damien Miller61e50f12000-05-08 20:49:37 +10002286AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002287IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002288AC_ARG_WITH(4in6,
2289 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2290 [
2291 if test "x$withval" != "xno" ; then
2292 AC_MSG_RESULT(yes)
2293 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002294 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002295 else
2296 AC_MSG_RESULT(no)
2297 fi
2298 ],[
2299 if test "x$inet6_default_4in6" = "xyes"; then
2300 AC_MSG_RESULT([yes (default)])
2301 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002302 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002303 else
2304 AC_MSG_RESULT([no (default)])
2305 fi
2306 ]
2307)
2308
Damien Miller60396b02001-02-18 17:01:00 +11002309# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002310BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002311AC_ARG_WITH(bsd-auth,
2312 [ --with-bsd-auth Enable BSD auth support],
2313 [
2314 if test "x$withval" != "xno" ; then
2315 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002316 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002317 fi
2318 ]
2319)
2320
Damien Millera22ba012000-03-02 23:09:20 +11002321# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002322piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002323# make sure the directory exists
2324if test ! -d $piddir ; then
2325 piddir=`eval echo ${sysconfdir}`
2326 case $piddir in
2327 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2328 esac
2329fi
2330
Tim Rice88f2ab52002-03-17 12:17:34 -08002331AC_ARG_WITH(pid-dir,
2332 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2333 [
2334 if test "x$withval" != "xno" ; then
2335 piddir=$withval
2336 if test ! -d $piddir ; then
2337 AC_MSG_WARN([** no $piddir directory on this system **])
2338 fi
2339 fi
2340 ]
2341)
2342
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002343AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002344AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002345
andre2ff7b5d2000-06-03 14:57:40 +00002346dnl allow user to disable some login recording features
2347AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002348 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002349 [
2350 if test "x$enableval" = "xno" ; then
2351 AC_DEFINE(DISABLE_LASTLOG)
2352 fi
2353 ]
andre2ff7b5d2000-06-03 14:57:40 +00002354)
2355AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002356 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002357 [
2358 if test "x$enableval" = "xno" ; then
2359 AC_DEFINE(DISABLE_UTMP)
2360 fi
2361 ]
andre2ff7b5d2000-06-03 14:57:40 +00002362)
2363AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002364 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002365 [
2366 if test "x$enableval" = "xno" ; then
2367 AC_DEFINE(DISABLE_UTMPX)
2368 fi
2369 ]
andre2ff7b5d2000-06-03 14:57:40 +00002370)
2371AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002372 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002373 [
2374 if test "x$enableval" = "xno" ; then
2375 AC_DEFINE(DISABLE_WTMP)
2376 fi
2377 ]
andre2ff7b5d2000-06-03 14:57:40 +00002378)
2379AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002380 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002381 [
2382 if test "x$enableval" = "xno" ; then
2383 AC_DEFINE(DISABLE_WTMPX)
2384 fi
2385 ]
andre2ff7b5d2000-06-03 14:57:40 +00002386)
2387AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002388 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002389 [
2390 if test "x$enableval" = "xno" ; then
2391 AC_DEFINE(DISABLE_LOGIN)
2392 fi
2393 ]
andre2ff7b5d2000-06-03 14:57:40 +00002394)
2395AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002396 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002397 [
2398 if test "x$enableval" = "xno" ; then
2399 AC_DEFINE(DISABLE_PUTUTLINE)
2400 fi
2401 ]
andre2ff7b5d2000-06-03 14:57:40 +00002402)
2403AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002404 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002405 [
2406 if test "x$enableval" = "xno" ; then
2407 AC_DEFINE(DISABLE_PUTUTXLINE)
2408 fi
2409 ]
andre2ff7b5d2000-06-03 14:57:40 +00002410)
2411AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002412 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002413 [
2414 if test "x$withval" = "xno" ; then
2415 AC_DEFINE(DISABLE_LASTLOG)
2416 else
2417 conf_lastlog_location=$withval
2418 fi
2419 ]
2420)
andre2ff7b5d2000-06-03 14:57:40 +00002421
2422dnl lastlog, [uw]tmpx? detection
2423dnl NOTE: set the paths in the platform section to avoid the
2424dnl need for command-line parameters
2425dnl lastlog and [uw]tmp are subject to a file search if all else fails
2426
2427dnl lastlog detection
2428dnl NOTE: the code itself will detect if lastlog is a directory
2429AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2430AC_TRY_COMPILE([
2431#include <sys/types.h>
2432#include <utmp.h>
2433#ifdef HAVE_LASTLOG_H
2434# include <lastlog.h>
2435#endif
Damien Miller2994e082000-06-04 15:51:47 +10002436#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002437# include <paths.h>
2438#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002439#ifdef HAVE_LOGIN_H
2440# include <login.h>
2441#endif
andre2ff7b5d2000-06-03 14:57:40 +00002442 ],
2443 [ char *lastlog = LASTLOG_FILE; ],
2444 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002445 [
2446 AC_MSG_RESULT(no)
2447 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2448 AC_TRY_COMPILE([
2449#include <sys/types.h>
2450#include <utmp.h>
2451#ifdef HAVE_LASTLOG_H
2452# include <lastlog.h>
2453#endif
2454#ifdef HAVE_PATHS_H
2455# include <paths.h>
2456#endif
2457 ],
2458 [ char *lastlog = _PATH_LASTLOG; ],
2459 [ AC_MSG_RESULT(yes) ],
2460 [
andree441aa32000-06-12 22:34:38 +00002461 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002462 system_lastlog_path=no
2463 ])
2464 ]
andre2ff7b5d2000-06-03 14:57:40 +00002465)
Damien Miller2994e082000-06-04 15:51:47 +10002466
andre2ff7b5d2000-06-03 14:57:40 +00002467if test -z "$conf_lastlog_location"; then
2468 if test x"$system_lastlog_path" = x"no" ; then
2469 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002470 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002471 conf_lastlog_location=$f
2472 fi
2473 done
2474 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002475 AC_MSG_WARN([** Cannot find lastlog **])
2476 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002477 fi
2478 fi
2479fi
2480
2481if test -n "$conf_lastlog_location"; then
2482 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2483fi
2484
2485dnl utmp detection
2486AC_MSG_CHECKING([if your system defines UTMP_FILE])
2487AC_TRY_COMPILE([
2488#include <sys/types.h>
2489#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002490#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002491# include <paths.h>
2492#endif
2493 ],
2494 [ char *utmp = UTMP_FILE; ],
2495 [ AC_MSG_RESULT(yes) ],
2496 [ AC_MSG_RESULT(no)
2497 system_utmp_path=no ]
2498)
2499if test -z "$conf_utmp_location"; then
2500 if test x"$system_utmp_path" = x"no" ; then
2501 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2502 if test -f $f ; then
2503 conf_utmp_location=$f
2504 fi
2505 done
2506 if test -z "$conf_utmp_location"; then
2507 AC_DEFINE(DISABLE_UTMP)
2508 fi
2509 fi
2510fi
2511if test -n "$conf_utmp_location"; then
2512 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2513fi
2514
2515dnl wtmp detection
2516AC_MSG_CHECKING([if your system defines WTMP_FILE])
2517AC_TRY_COMPILE([
2518#include <sys/types.h>
2519#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002520#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002521# include <paths.h>
2522#endif
2523 ],
2524 [ char *wtmp = WTMP_FILE; ],
2525 [ AC_MSG_RESULT(yes) ],
2526 [ AC_MSG_RESULT(no)
2527 system_wtmp_path=no ]
2528)
2529if test -z "$conf_wtmp_location"; then
2530 if test x"$system_wtmp_path" = x"no" ; then
2531 for f in /usr/adm/wtmp /var/log/wtmp; do
2532 if test -f $f ; then
2533 conf_wtmp_location=$f
2534 fi
2535 done
2536 if test -z "$conf_wtmp_location"; then
2537 AC_DEFINE(DISABLE_WTMP)
2538 fi
2539 fi
2540fi
2541if test -n "$conf_wtmp_location"; then
2542 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2543fi
2544
2545
2546dnl utmpx detection - I don't know any system so perverse as to require
2547dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2548dnl there, though.
2549AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2550AC_TRY_COMPILE([
2551#include <sys/types.h>
2552#include <utmp.h>
2553#ifdef HAVE_UTMPX_H
2554#include <utmpx.h>
2555#endif
Damien Miller2994e082000-06-04 15:51:47 +10002556#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002557# include <paths.h>
2558#endif
2559 ],
2560 [ char *utmpx = UTMPX_FILE; ],
2561 [ AC_MSG_RESULT(yes) ],
2562 [ AC_MSG_RESULT(no)
2563 system_utmpx_path=no ]
2564)
2565if test -z "$conf_utmpx_location"; then
2566 if test x"$system_utmpx_path" = x"no" ; then
2567 AC_DEFINE(DISABLE_UTMPX)
2568 fi
2569else
2570 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2571fi
2572
2573dnl wtmpx detection
2574AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2575AC_TRY_COMPILE([
2576#include <sys/types.h>
2577#include <utmp.h>
2578#ifdef HAVE_UTMPX_H
2579#include <utmpx.h>
2580#endif
Damien Miller2994e082000-06-04 15:51:47 +10002581#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002582# include <paths.h>
2583#endif
2584 ],
2585 [ char *wtmpx = WTMPX_FILE; ],
2586 [ AC_MSG_RESULT(yes) ],
2587 [ AC_MSG_RESULT(no)
2588 system_wtmpx_path=no ]
2589)
2590if test -z "$conf_wtmpx_location"; then
2591 if test x"$system_wtmpx_path" = x"no" ; then
2592 AC_DEFINE(DISABLE_WTMPX)
2593 fi
2594else
2595 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2596fi
2597
Damien Miller4018c192000-04-30 09:30:44 +10002598
Damien Miller29ea30d2000-03-17 10:54:15 +11002599if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002600 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2601 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002602fi
2603
Tim Rice4cec93f2002-02-26 08:40:48 -08002604dnl remove pam and dl because they are in $LIBPAM
2605if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002606 LIBS=`echo $LIBS | sed 's/-lpam //'`
2607fi
2608if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2609 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002610fi
2611
Damien Millerbac2d8a2000-09-05 16:13:06 +11002612AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002613AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2614AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002615
Damien Miller7b22d652000-06-18 14:07:04 +10002616# Print summary of options
2617
Damien Miller7b22d652000-06-18 14:07:04 +10002618# Someone please show me a better way :)
2619A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2620B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2621C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2622D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002623E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002624F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002625G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002626H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2627I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2628J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002629
2630echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002631echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002632echo " User binaries: $B"
2633echo " System binaries: $C"
2634echo " Configuration files: $D"
2635echo " Askpass program: $E"
2636echo " Manual pages: $F"
2637echo " PID file: $G"
2638echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002639if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002640echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002641else
Damien Millerf58c6722002-05-13 13:15:42 +10002642echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002643fi
Damien Millera18bbd32002-05-13 10:48:57 +10002644if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002645echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002646fi
Damien Millerf58c6722002-05-13 13:15:42 +10002647echo " Manpage format: $MANTYPE"
Damien Miller9d2be482003-05-15 11:12:19 +10002648echo " DNS support: $DNS_MSG"
Damien Miller7abe09b2003-05-15 10:53:49 +10002649echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002650echo " KerberosIV support: $KRB4_MSG"
2651echo " KerberosV support: $KRB5_MSG"
2652echo " Smartcard support: $SCARD_MSG"
2653echo " AFS support: $AFS_MSG"
2654echo " S/KEY support: $SKEY_MSG"
2655echo " TCP Wrappers support: $TCPW_MSG"
2656echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002657echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002658echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2659echo " BSD Auth support: $BSD_AUTH_MSG"
2660echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002661if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002662echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002663fi
2664
Damien Miller7b22d652000-06-18 14:07:04 +10002665echo ""
2666
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002667echo " Host: ${host}"
2668echo " Compiler: ${CC}"
2669echo " Compiler flags: ${CFLAGS}"
2670echo "Preprocessor flags: ${CPPFLAGS}"
2671echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002672echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002673
2674echo ""
2675
Damien Miller82cf0ce2000-12-20 13:34:48 +11002676if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002677 echo "PAM is enabled. You may need to install a PAM control file "
2678 echo "for sshd, otherwise password authentication may fail. "
2679 echo "Example PAM control files can be found in the contrib/ "
2680 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002681 echo ""
2682fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002683
Damien Miller6c21c512002-01-22 21:57:53 +11002684if test ! -z "$RAND_HELPER_CMDHASH" ; then
2685 echo "WARNING: you are using the builtin random number collection "
2686 echo "service. Please read WARNING.RNG and request that your OS "
2687 echo "vendor includes kernel-based random number collection in "
2688 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002689 echo ""
2690fi
Damien Miller60396b02001-02-18 17:01:00 +11002691