blob: 8d9143e6c8ea449ad107dda37b6c7c120f12c049 [file] [log] [blame]
Darren Tuckerf1159b52003-07-07 19:44:01 +10001# $Id: configure.ac,v 1.131 2003/07/07 09:44:01 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"
Tim Ricee958ed32002-07-05 07:12:33 -070078 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
79 [AC_CHECK_LIB(s,authenticate,
80 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
81 LIBS="$LIBS -ls"
82 ])
83 ])
Damien Millereca71f82000-01-20 22:38:27 +110084 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +100085 AC_DEFINE(BROKEN_REALPATH)
andre60f3c982000-06-03 16:18:19 +000086 dnl AIX handles lastlog as part of its login message
87 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +000088 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +100089 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +110090 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110091*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +110092 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -080093 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110094 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000095 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +110096 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +110097 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +000098 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +000099 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700100 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000101 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100102 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000103*-*-dgux*)
104 AC_DEFINE(IP_TOS_IS_BROKEN)
105 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000106*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000107 AC_MSG_CHECKING(if we have working getaddrinfo)
108 AC_TRY_RUN([#include <mach-o/dyld.h>
109main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
110 exit(0);
111 else
112 exit(1);
113}], [AC_MSG_RESULT(working)],
114 [AC_MSG_RESULT(buggy)
115 AC_DEFINE(BROKEN_GETADDRINFO)],
116 [AC_MSG_RESULT(assume it is working)])
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000117 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000118*-*-hpux10.26)
119 if test -z "$GCC"; then
120 CFLAGS="$CFLAGS -Ae"
121 fi
122 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
123 IPADDR_IN_DISPLAY=yes
124 AC_DEFINE(HAVE_SECUREWARE)
125 AC_DEFINE(USE_PIPES)
126 AC_DEFINE(LOGIN_NO_ENDOPT)
127 AC_DEFINE(LOGIN_NEEDS_UTMPX)
128 AC_DEFINE(DISABLE_SHADOW)
129 AC_DEFINE(DISABLE_UTMP)
Damien Miller35276252003-06-03 10:14:28 +1000130 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700131 LIBS="$LIBS -lsec -lsecpw"
132 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000133 disable_ptmx_check=yes
134 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100135*-*-hpux10*)
136 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000137 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100138 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000139 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100140 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000141 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000142 AC_DEFINE(LOGIN_NO_ENDOPT)
143 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100144 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100145 AC_DEFINE(DISABLE_UTMP)
Damien Miller35276252003-06-03 10:14:28 +1000146 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700147 LIBS="$LIBS -lsec"
148 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100149 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000150*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000151 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100152 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100153 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100154 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000155 AC_DEFINE(LOGIN_NO_ENDOPT)
156 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100157 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100158 AC_DEFINE(DISABLE_UTMP)
Damien Miller35276252003-06-03 10:14:28 +1000159 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700160 LIBS="$LIBS -lsec"
161 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000162 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100163*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000164 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000165 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100166 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000167 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000168 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller1808f382000-01-06 12:03:12 +1100169 ;;
170*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000171 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000172 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100173 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000174 AC_DEFINE(WITH_IRIX_ARRAY)
175 AC_DEFINE(WITH_IRIX_PROJECT)
176 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000177 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000178 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000179 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100180 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100181*-*-linux*)
182 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100183 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100184 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000185 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller35276252003-06-03 10:14:28 +1000186 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100187 inet6_default_4in6=yes
Darren Tuckerc437cda2003-05-10 17:05:46 +1000188 # openpty can be in libutil, needed for controlling tty test
189 AC_SEARCH_LIBS(openpty, util)
190 # make sure that openpty does not reacquire controlling terminal
191 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
192 AC_TRY_RUN(
193 [
194#include <stdio.h>
195#include <sys/fcntl.h>
196#include <sys/types.h>
197#include <sys/wait.h>
198
199int
200main()
201{
202 pid_t pid;
203 int fd, ptyfd, ttyfd, status;
204
205 pid = fork();
206 if (pid < 0) { /* failed */
207 exit(1);
208 } else if (pid > 0) { /* parent */
209 waitpid(pid, &status, 0);
210 if (WIFEXITED(status))
211 exit(WEXITSTATUS(status));
212 else
213 exit(2);
214 } else { /* child */
215 close(0); close(1); close(2);
216 setsid();
217 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
218 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
219 if (fd >= 0)
220 exit(3); /* Acquired ctty: broken */
221 else
222 exit(0); /* Did not acquire ctty: OK */
223 }
224}
225 ],
226 [
227 AC_MSG_RESULT(yes)
228 ],
229 [
230 AC_MSG_RESULT(no)
231 AC_DEFINE(SSHD_ACQUIRES_CTTY)
232 ]
233 )
Darren Tucker3c016542003-05-02 20:48:21 +1000234 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000235 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000236 AC_DEFINE(BROKEN_CMSG_TYPE)
237 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000238 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100239 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000240mips-sony-bsd|mips-sony-newsos4)
241 AC_DEFINE(HAVE_NEWS4)
242 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000243 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100244*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000245 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100246 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100247 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100248*-*-freebsd*)
249 check_for_libcrypt_later=1
250 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000251*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000252 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100253 conf_utmp_location=/etc/utmp
254 conf_wtmp_location=/usr/adm/wtmp
255 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000256 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000257 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000258 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100259 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000260 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000261 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000262 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100263*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000264 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000265 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100266 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100267 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000268 AC_DEFINE(LOGIN_NEEDS_UTMPX)
269 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000270 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckerc437cda2003-05-10 17:05:46 +1000271 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
272 AC_DEFINE(SSHD_ACQUIRES_CTTY)
andre2ff7b5d2000-06-03 14:57:40 +0000273 # hardwire lastlog location (can't detect it on some versions)
274 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000275 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
276 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
277 if test "$sol2ver" -ge 8; then
278 AC_MSG_RESULT(yes)
279 AC_DEFINE(DISABLE_UTMP)
280 AC_DEFINE(DISABLE_WTMP)
281 else
282 AC_MSG_RESULT(no)
283 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100284 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000285*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000286 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000287 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100288 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000289 conf_utmp_location=/etc/utmp
290 conf_wtmp_location=/var/adm/wtmp
291 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000292 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000293 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000294*-ncr-sysv*)
295 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
296 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700297 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000298 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000299 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000300 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000301*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000302 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700303 # /usr/ucblib MUST NOT be searched on ReliantUNIX
304 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100305 IPADDR_IN_DISPLAY=yes
306 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000307 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000308 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700309 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
310 # Attention: always take care to bind libsocket and libnsl before libc,
311 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000312 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100313*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000314 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100315 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100316 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100317 ;;
318*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000319 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100320 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100321 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100322 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100323*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000324 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100325 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100326 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100327*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000328 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100329 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700330 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100331 RANLIB=true
332 no_dev_ptmx=1
333 AC_DEFINE(BROKEN_SYS_TERMIO_H)
334 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000335 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000336 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100337 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100338 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700339 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700340 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100341 ;;
342*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800343 if test -z "$GCC"; then
344 CFLAGS="$CFLAGS -belf"
345 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000346 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000347 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100348 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000349 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100350 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000351 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000352 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700353 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100354 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700355 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000356 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000357*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000358 AC_DEFINE(USE_PIPES)
359 AC_DEFINE(DISABLE_FD_PASSING)
360 LDFLAGS="$LDFLAGS"
361 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
362 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000363 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000364*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000365 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700366 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700367 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000368 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
369 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
370 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700371 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000372*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000373 AC_MSG_CHECKING(for Digital Unix SIA)
374 no_osfsia=""
375 AC_ARG_WITH(osfsia,
376 [ --with-osfsia Enable Digital Unix SIA],
377 [
378 if test "x$withval" = "xno" ; then
379 AC_MSG_RESULT(disabled)
380 no_osfsia=1
381 fi
382 ],
383 )
384 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000385 if test -f /etc/sia/matrix.conf; then
386 AC_MSG_RESULT(yes)
387 AC_DEFINE(HAVE_OSF_SIA)
388 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000389 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000390 LIBS="$LIBS -lsecurity -ldb -lm -laud"
391 else
392 AC_MSG_RESULT(no)
393 fi
394 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000395 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000396 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000397
398*-*-nto-qnx)
399 AC_DEFINE(USE_PIPES)
400 AC_DEFINE(NO_X11_UNIX_SOCKETS)
401 AC_DEFINE(MISSING_NFDBITS)
402 AC_DEFINE(MISSING_HOWMANY)
403 AC_DEFINE(MISSING_FD_MASK)
404 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100405esac
406
Damien Millere37bfc12000-06-05 09:37:43 +1000407# Allow user to specify flags
408AC_ARG_WITH(cflags,
409 [ --with-cflags Specify additional flags to pass to compiler],
410 [
411 if test "x$withval" != "xno" ; then
412 CFLAGS="$CFLAGS $withval"
413 fi
414 ]
415)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000416AC_ARG_WITH(cppflags,
417 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
418 [
419 if test "x$withval" != "xno"; then
420 CPPFLAGS="$CPPFLAGS $withval"
421 fi
422 ]
423)
Damien Millere37bfc12000-06-05 09:37:43 +1000424AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000425 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000426 [
427 if test "x$withval" != "xno" ; then
428 LDFLAGS="$LDFLAGS $withval"
429 fi
430 ]
431)
432AC_ARG_WITH(libs,
433 [ --with-libs Specify additional libraries to link with],
434 [
435 if test "x$withval" != "xno" ; then
436 LIBS="$LIBS $withval"
437 fi
438 ]
439)
440
Darren Tucker6eb93042003-06-29 21:30:41 +1000441AC_MSG_CHECKING(compiler and flags for sanity)
442AC_TRY_RUN([
443#include <stdio.h>
444int main(){exit(0);}
445 ],
446 [ AC_MSG_RESULT(yes) ],
447 [
448 AC_MSG_RESULT(no)
449 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
450 ]
451)
452
Tim Rice4cec93f2002-02-26 08:40:48 -0800453# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000454AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Damien Millerb16f8742003-02-24 12:47:15 +1100455 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800456 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000457 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000458 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tucker5d0ccf32003-05-15 21:42:59 +1000459 strings.h sys/strtio.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
Damien Millera8ed44b2003-01-10 09:53:12 +1100460 sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000461 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700462 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800463 util.h utime.h utmp.h utmpx.h)
464
Damien Millera22ba012000-03-02 23:09:20 +1100465# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700466AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
467AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000468
Damien Millerdf288022001-02-18 13:07:07 +1100469dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700470if test "x$with_tcp_wrappers" != "xno" ; then
471 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
472 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
473 fi
474fi
Damien Millerdf288022001-02-18 13:07:07 +1100475
Tim Rice13aae5e2001-10-21 17:53:58 -0700476AC_CHECK_FUNC(getspnam, ,
477 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700478
Damien Miller150c8b52002-02-13 23:06:56 +1100479AC_ARG_WITH(rpath,
480 [ --without-rpath Disable auto-added -R linker paths],
481 [
482 if test "x$withval" = "xno" ; then
483 need_dash_r=""
484 fi
485 if test "x$withval" = "xyes" ; then
486 need_dash_r=1
487 fi
488 ]
489)
490
Tim Rice13aae5e2001-10-21 17:53:58 -0700491dnl zlib is required
492AC_ARG_WITH(zlib,
493 [ --with-zlib=PATH Use zlib in PATH],
494 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000495 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100496 AC_MSG_ERROR([*** zlib is required ***])
497 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700498 if test -d "$withval/lib"; then
499 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700500 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700501 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700502 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700503 fi
504 else
505 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700506 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700507 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700508 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700509 fi
510 fi
511 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700512 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700513 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700514 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700515 fi
516 ]
517)
518
Tim Rice17b93e52001-10-23 22:36:54 -0700519AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100520
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000521dnl UnixWare 2.x
522AC_CHECK_FUNC(strcasecmp,
523 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
524)
525AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700526 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
527 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000528)
Damien Millerab18c411999-11-11 10:40:23 +1100529
Tim Ricee589a292001-11-03 11:09:32 -0800530dnl Checks for libutil functions
531AC_CHECK_HEADERS(libutil.h)
532AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
533AC_CHECK_FUNCS(logout updwtmp logwtmp)
534
Ben Lindstrom8697e082001-02-24 21:41:10 +0000535AC_FUNC_STRFTIME
536
Damien Miller3c027682001-03-14 11:39:45 +1100537# Check for ALTDIRFUNC glob() extension
538AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
539AC_EGREP_CPP(FOUNDIT,
540 [
541 #include <glob.h>
542 #ifdef GLOB_ALTDIRFUNC
543 FOUNDIT
544 #endif
545 ],
546 [
547 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
548 AC_MSG_RESULT(yes)
549 ],
550 [
551 AC_MSG_RESULT(no)
552 ]
553)
Damien Millerab18c411999-11-11 10:40:23 +1100554
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000555# Check for g.gl_matchc glob() extension
556AC_MSG_CHECKING(for gl_matchc field in glob_t)
557AC_EGREP_CPP(FOUNDIT,
558 [
559 #include <glob.h>
560 int main(void){glob_t g; g.gl_matchc = 1;}
561 ],
562 [
563 AC_DEFINE(GLOB_HAS_GL_MATCHC)
564 AC_MSG_RESULT(yes)
565 ],
566 [
567 AC_MSG_RESULT(no)
568 ]
569)
570
Damien Miller18bb4732001-03-28 14:35:30 +1000571AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
572AC_TRY_RUN(
573 [
574#include <sys/types.h>
575#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700576int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000577 ],
578 [AC_MSG_RESULT(yes)],
579 [
580 AC_MSG_RESULT(no)
581 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
582 ]
583)
584
Damien Millerc547bf12001-02-16 10:18:12 +1100585# Check whether user wants S/Key support
586SKEY_MSG="no"
587AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700588 [ --with-skey[[=PATH]] Enable S/Key support
589 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100590 [
591 if test "x$withval" != "xno" ; then
592
593 if test "x$withval" != "xyes" ; then
594 CPPFLAGS="$CPPFLAGS -I${withval}/include"
595 LDFLAGS="$LDFLAGS -L${withval}/lib"
596 fi
597
598 AC_DEFINE(SKEY)
599 LIBS="-lskey $LIBS"
600 SKEY_MSG="yes"
601
Tim Rice4cec93f2002-02-26 08:40:48 -0800602 AC_MSG_CHECKING([for s/key support])
603 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100604 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800605#include <stdio.h>
606#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700607int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800608 ],
609 [AC_MSG_RESULT(yes)],
610 [
611 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100612 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
613 ])
614 fi
615 ]
616)
617
618# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700619TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100620AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700621 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
622 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100623 [
624 if test "x$withval" != "xno" ; then
625 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700626 saved_LDFLAGS="$LDFLAGS"
627 saved_CPPFLAGS="$CPPFLAGS"
628 if test -n "${withval}" -a "${withval}" != "yes"; then
629 if test -d "${withval}/lib"; then
630 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700631 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700632 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700633 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700634 fi
635 else
636 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700637 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700638 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700639 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700640 fi
641 fi
642 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700643 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700644 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700645 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700646 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700647 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800648 LIBWRAP="-lwrap"
649 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100650 AC_MSG_CHECKING(for libwrap)
651 AC_TRY_LINK(
652 [
653#include <tcpd.h>
654 int deny_severity = 0, allow_severity = 0;
655 ],
656 [hosts_access(0);],
657 [
658 AC_MSG_RESULT(yes)
659 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800660 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700661 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100662 ],
663 [
664 AC_MSG_ERROR([*** libwrap missing])
665 ]
666 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800667 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100668 fi
669 ]
670)
671
Damien Millerfe1f1432003-02-24 15:45:42 +1100672dnl Checks for library functions. Please keep in alphabetical order
673AC_CHECK_FUNCS(\
Damien Miller5fe46a42003-06-05 09:53:31 +1000674 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
675 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Damien Millerfe1f1432003-02-24 15:45:42 +1100676 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000677 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100678 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000679 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
680 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
681 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Damien Miller5fe46a42003-06-05 09:53:31 +1000682 setproctitle setregid setresgid setresuid setreuid setrlimit \
683 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
684 strlcat strlcpy strmode strnvis sysconf tcgetpgrp truncate utimes \
685 vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100686)
Tim Rice13aae5e2001-10-21 17:53:58 -0700687
Damien Millercd6853c2003-01-28 11:33:42 +1100688AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
Damien Millereab4bae2003-04-29 23:22:40 +1000689AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
Damien Millercd6853c2003-01-28 11:33:42 +1100690
Darren Tuckerf1159b52003-07-07 19:44:01 +1000691dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000692AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000693AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000694
Tim Rice13aae5e2001-10-21 17:53:58 -0700695dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700696AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700697 AC_CHECK_LIB(gen, dirname,[
698 AC_CACHE_CHECK([for broken dirname],
699 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700700 save_LIBS="$LIBS"
701 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700702 AC_TRY_RUN(
703 [
704#include <libgen.h>
705#include <string.h>
706
707int main(int argc, char **argv) {
708 char *s, buf[32];
709
710 strncpy(buf,"/etc", 32);
711 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700712 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700713 exit(1);
714 } else {
715 exit(0);
716 }
717}
718 ],
719 [ ac_cv_have_broken_dirname="no" ],
720 [ ac_cv_have_broken_dirname="yes" ]
721 )
Tim Rice17b93e52001-10-23 22:36:54 -0700722 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700723 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700724 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700725 LIBS="$LIBS -lgen"
726 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700727 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700728 fi
729 ])
730])
731
Damien Millerad833b32000-08-23 10:46:23 +1000732dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000733AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000734dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000735AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000736AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000737dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000738AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000739AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100740
Damien Miller04f80141999-11-19 15:32:34 +1100741AC_CHECK_FUNC(daemon,
742 [AC_DEFINE(HAVE_DAEMON)],
743 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
744)
745
Damien Miller9fb07e42000-03-05 16:22:59 +1100746AC_CHECK_FUNC(getpagesize,
747 [AC_DEFINE(HAVE_GETPAGESIZE)],
748 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
749)
750
Damien Millercb170cb2000-07-01 16:52:55 +1000751# Check for broken snprintf
752if test "x$ac_cv_func_snprintf" = "xyes" ; then
753 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
754 AC_TRY_RUN(
755 [
756#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700757int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000758 ],
759 [AC_MSG_RESULT(yes)],
760 [
761 AC_MSG_RESULT(no)
762 AC_DEFINE(BROKEN_SNPRINTF)
763 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
764 ]
765 )
766fi
767
Damien Millere8328192003-01-07 15:18:32 +1100768dnl see whether mkstemp() requires XXXXXX
769if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
770AC_MSG_CHECKING([for (overly) strict mkstemp])
771AC_TRY_RUN(
772 [
773#include <stdlib.h>
774main() { char template[]="conftest.mkstemp-test";
775if (mkstemp(template) == -1)
776 exit(1);
777unlink(template); exit(0);
778}
779 ],
780 [
781 AC_MSG_RESULT(no)
782 ],
783 [
784 AC_MSG_RESULT(yes)
785 AC_DEFINE(HAVE_STRICT_MKSTEMP)
786 ],
787 [
788 AC_MSG_RESULT(yes)
789 AC_DEFINE(HAVE_STRICT_MKSTEMP)
790 ]
791)
792fi
793
Damien Miller606f8802000-09-16 15:39:56 +1100794AC_FUNC_GETPGRP
795
Damien Millera64b57a2001-01-17 10:44:13 +1100796# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000797PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100798AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100799 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100800 [
Damien Millera64b57a2001-01-17 10:44:13 +1100801 if test "x$withval" != "xno" ; then
802 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
803 AC_MSG_ERROR([PAM headers not found])
804 fi
805
806 AC_CHECK_LIB(dl, dlopen, , )
807 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
808 AC_CHECK_FUNCS(pam_getenvlist)
809
810 disable_shadow=yes
811 PAM_MSG="yes"
812
813 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800814 if test $ac_cv_lib_dl_dlopen = yes; then
815 LIBPAM="-lpam -ldl"
816 else
817 LIBPAM="-lpam"
818 fi
819 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100820 fi
821 ]
822)
Damien Millera22ba012000-03-02 23:09:20 +1100823
Damien Millera64b57a2001-01-17 10:44:13 +1100824# Check for older PAM
825if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100826 # Check PAM strerror arguments (old PAM)
827 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
828 AC_TRY_COMPILE(
829 [
Damien Miller81171112000-04-23 11:14:01 +1000830#include <stdlib.h>
831#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100832 ],
833 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
834 [AC_MSG_RESULT(no)],
835 [
836 AC_DEFINE(HAVE_OLD_PAM)
837 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000838 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100839 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100840 )
Damien Millera22ba012000-03-02 23:09:20 +1100841fi
842
Damien Millerfc93d4b2002-09-04 23:26:29 +1000843# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
844# because the system crypt() is more featureful.
845if test "x$check_for_libcrypt_before" = "x1"; then
846 AC_CHECK_LIB(crypt, crypt)
847fi
848
Tim Riceaef73712002-05-11 13:17:42 -0700849# Search for OpenSSL
850saved_CPPFLAGS="$CPPFLAGS"
851saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100852AC_ARG_WITH(ssl-dir,
853 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
854 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000855 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700856 if test -d "$withval/lib"; then
857 if test -n "${need_dash_r}"; then
858 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
859 else
860 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
861 fi
862 else
863 if test -n "${need_dash_r}"; then
864 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
865 else
866 LDFLAGS="-L${withval} ${LDFLAGS}"
867 fi
868 fi
869 if test -d "$withval/include"; then
870 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
871 else
872 CPPFLAGS="-I${withval} ${CPPFLAGS}"
873 fi
Damien Millera22ba012000-03-02 23:09:20 +1100874 fi
875 ]
876)
Tim Riceaef73712002-05-11 13:17:42 -0700877LIBS="$LIBS -lcrypto"
878AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000879 [
Tim Riceaef73712002-05-11 13:17:42 -0700880 dnl Check default openssl install dir
881 if test -n "${need_dash_r}"; then
882 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000883 else
Tim Riceaef73712002-05-11 13:17:42 -0700884 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000885 fi
Tim Riceaef73712002-05-11 13:17:42 -0700886 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
887 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
888 [
889 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
890 ]
891 )
892 ]
893)
894
Tim Riced730b782002-08-13 18:52:10 -0700895# Determine OpenSSL header version
896AC_MSG_CHECKING([OpenSSL header version])
897AC_TRY_RUN(
898 [
899#include <stdio.h>
900#include <string.h>
901#include <openssl/opensslv.h>
902#define DATA "conftest.sslincver"
903int main(void) {
904 FILE *fd;
905 int rc;
906
907 fd = fopen(DATA,"w");
908 if(fd == NULL)
909 exit(1);
910
911 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
912 exit(1);
913
914 exit(0);
915}
916 ],
917 [
918 ssl_header_ver=`cat conftest.sslincver`
919 AC_MSG_RESULT($ssl_header_ver)
920 ],
921 [
922 AC_MSG_RESULT(not found)
923 AC_MSG_ERROR(OpenSSL version header not found.)
924 ]
925)
926
927# Determine OpenSSL library version
928AC_MSG_CHECKING([OpenSSL library version])
929AC_TRY_RUN(
930 [
931#include <stdio.h>
932#include <string.h>
933#include <openssl/opensslv.h>
934#include <openssl/crypto.h>
935#define DATA "conftest.ssllibver"
936int main(void) {
937 FILE *fd;
938 int rc;
939
940 fd = fopen(DATA,"w");
941 if(fd == NULL)
942 exit(1);
943
944 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
945 exit(1);
946
947 exit(0);
948}
949 ],
950 [
951 ssl_library_ver=`cat conftest.ssllibver`
952 AC_MSG_RESULT($ssl_library_ver)
953 ],
954 [
955 AC_MSG_RESULT(not found)
956 AC_MSG_ERROR(OpenSSL library not found.)
957 ]
958)
Damien Millera22ba012000-03-02 23:09:20 +1100959
Damien Millerec932372002-01-22 22:16:03 +1100960# Sanity check OpenSSL headers
961AC_MSG_CHECKING([whether OpenSSL's headers match the library])
962AC_TRY_RUN(
963 [
964#include <string.h>
965#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700966int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100967 ],
968 [
969 AC_MSG_RESULT(yes)
970 ],
971 [
972 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +1000973 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
974Check config.log for details.
975Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +1100976 ]
977)
978
Damien Millera64b57a2001-01-17 10:44:13 +1100979# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
980# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +1000981if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100982 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100983fi
984
Damien Miller6c21c512002-01-22 21:57:53 +1100985
986### Configure cryptographic random number support
987
988# Check wheter OpenSSL seeds itself
989AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
990AC_TRY_RUN(
991 [
992#include <string.h>
993#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700994int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +1100995 ],
996 [
997 OPENSSL_SEEDS_ITSELF=yes
998 AC_MSG_RESULT(yes)
999 ],
1000 [
1001 AC_MSG_RESULT(no)
1002 # Default to use of the rand helper if OpenSSL doesn't
1003 # seed itself
1004 USE_RAND_HELPER=yes
1005 ]
1006)
1007
1008
1009# Do we want to force the use of the rand helper?
1010AC_ARG_WITH(rand-helper,
1011 [ --with-rand-helper Use subprocess to gather strong randomness ],
1012 [
1013 if test "x$withval" = "xno" ; then
1014 # Force use of OpenSSL's internal RNG, even if
1015 # the previous test showed it to be unseeded.
1016 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1017 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1018 OPENSSL_SEEDS_ITSELF=yes
1019 USE_RAND_HELPER=""
1020 fi
1021 else
1022 USE_RAND_HELPER=yes
1023 fi
1024 ],
1025)
1026
1027# Which randomness source do we use?
1028if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1029 # OpenSSL only
1030 AC_DEFINE(OPENSSL_PRNG_ONLY)
1031 RAND_MSG="OpenSSL internal ONLY"
1032 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001033elif test ! -z "$USE_RAND_HELPER" ; then
1034 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001035 RAND_MSG="ssh-rand-helper"
1036 INSTALL_SSH_RAND_HELPER="yes"
1037fi
1038AC_SUBST(INSTALL_SSH_RAND_HELPER)
1039
1040### Configuration of ssh-rand-helper
1041
1042# PRNGD TCP socket
1043AC_ARG_WITH(prngd-port,
1044 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1045 [
Damien Millere996d722002-01-23 11:20:59 +11001046 case "$withval" in
1047 no)
1048 withval=""
1049 ;;
1050 [[0-9]]*)
1051 ;;
1052 *)
1053 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1054 ;;
1055 esac
1056 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001057 PRNGD_PORT="$withval"
1058 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1059 fi
1060 ]
1061)
1062
1063# PRNGD Unix domain socket
1064AC_ARG_WITH(prngd-socket,
1065 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1066 [
Damien Millere996d722002-01-23 11:20:59 +11001067 case "$withval" in
1068 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001069 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001070 ;;
1071 no)
1072 withval=""
1073 ;;
1074 /*)
1075 ;;
1076 *)
1077 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1078 ;;
1079 esac
1080
1081 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001082 if test ! -z "$PRNGD_PORT" ; then
1083 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1084 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001085 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001086 AC_MSG_WARN(Entropy socket is not readable)
1087 fi
1088 PRNGD_SOCKET="$withval"
1089 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1090 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001091 ],
1092 [
1093 # Check for existing socket only if we don't have a random device already
1094 if test "$USE_RAND_HELPER" = yes ; then
1095 AC_MSG_CHECKING(for PRNGD/EGD socket)
1096 # Insert other locations here
1097 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1098 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1099 PRNGD_SOCKET="$sock"
1100 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1101 break;
1102 fi
1103 done
1104 if test ! -z "$PRNGD_SOCKET" ; then
1105 AC_MSG_RESULT($PRNGD_SOCKET)
1106 else
1107 AC_MSG_RESULT(not found)
1108 fi
1109 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001110 ]
1111)
1112
1113# Change default command timeout for hashing entropy source
1114entropy_timeout=200
1115AC_ARG_WITH(entropy-timeout,
1116 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1117 [
1118 if test "x$withval" != "xno" ; then
1119 entropy_timeout=$withval
1120 fi
1121 ]
1122)
Damien Miller6c21c512002-01-22 21:57:53 +11001123AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1124
Damien Millerd3f6ad22002-06-25 10:24:47 +10001125SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001126AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001127 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001128 [
1129 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001130 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001131 fi
1132 ]
1133)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001134AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1135AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001136
Tim Rice88f2ab52002-03-17 12:17:34 -08001137# We do this little dance with the search path to insure
1138# that programs that we select for use by installed programs
1139# (which may be run by the super-user) come from trusted
1140# locations before they come from the user's private area.
1141# This should help avoid accidentally configuring some
1142# random version of a program in someone's personal bin.
1143
1144OPATH=$PATH
1145PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001146test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001147test -d /sbin && PATH=$PATH:/sbin
1148test -d /usr/sbin && PATH=$PATH:/usr/sbin
1149PATH=$PATH:/etc:$OPATH
1150
Damien Miller6c21c512002-01-22 21:57:53 +11001151# These programs are used by the command hashing source to gather entropy
1152OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1153OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1154OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1155OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1156OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1157OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1158OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1159OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1160OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1161OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1162OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1163OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1164OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1165OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1166OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1167OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001168# restore PATH
1169PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001170
1171# Where does ssh-rand-helper get its randomness from?
1172INSTALL_SSH_PRNG_CMDS=""
1173if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1174 if test ! -z "$PRNGD_PORT" ; then
1175 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1176 elif test ! -z "$PRNGD_SOCKET" ; then
1177 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1178 else
1179 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1180 RAND_HELPER_CMDHASH=yes
1181 INSTALL_SSH_PRNG_CMDS="yes"
1182 fi
1183fi
1184AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1185
1186
Ben Lindstromb5628642000-10-18 00:02:25 +00001187# Cheap hack to ensure NEWS-OS libraries are arranged right.
1188if test ! -z "$SONY" ; then
1189 LIBS="$LIBS -liberty";
1190fi
1191
Damien Millera22ba012000-03-02 23:09:20 +11001192# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001193AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001194AC_CHECK_SIZEOF(short int, 2)
1195AC_CHECK_SIZEOF(int, 4)
1196AC_CHECK_SIZEOF(long int, 4)
1197AC_CHECK_SIZEOF(long long int, 8)
1198
Damien Millerfa2bb692002-04-23 23:22:25 +10001199# Sanity check long long for some platforms (AIX)
1200if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1201 ac_cv_sizeof_long_long_int=0
1202fi
1203
Damien Millera22ba012000-03-02 23:09:20 +11001204# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001205AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1206 AC_TRY_COMPILE(
1207 [ #include <sys/types.h> ],
1208 [ u_int a; a = 1;],
1209 [ ac_cv_have_u_int="yes" ],
1210 [ ac_cv_have_u_int="no" ]
1211 )
1212])
1213if test "x$ac_cv_have_u_int" = "xyes" ; then
1214 AC_DEFINE(HAVE_U_INT)
1215 have_u_int=1
1216fi
1217
Damien Miller61e50f12000-05-08 20:49:37 +10001218AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1219 AC_TRY_COMPILE(
1220 [ #include <sys/types.h> ],
1221 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1222 [ ac_cv_have_intxx_t="yes" ],
1223 [ ac_cv_have_intxx_t="no" ]
1224 )
1225])
1226if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1227 AC_DEFINE(HAVE_INTXX_T)
1228 have_intxx_t=1
1229fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001230
1231if (test -z "$have_intxx_t" && \
1232 test "x$ac_cv_header_stdint_h" = "xyes")
1233then
1234 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1235 AC_TRY_COMPILE(
1236 [ #include <stdint.h> ],
1237 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1238 [
1239 AC_DEFINE(HAVE_INTXX_T)
1240 AC_MSG_RESULT(yes)
1241 ],
1242 [ AC_MSG_RESULT(no) ]
1243 )
1244fi
1245
Damien Miller578783e2000-09-23 14:12:24 +11001246AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1247 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001248 [
1249#include <sys/types.h>
1250#ifdef HAVE_STDINT_H
1251# include <stdint.h>
1252#endif
1253#include <sys/socket.h>
1254#ifdef HAVE_SYS_BITYPES_H
1255# include <sys/bitypes.h>
1256#endif
1257 ],
Damien Miller578783e2000-09-23 14:12:24 +11001258 [ int64_t a; a = 1;],
1259 [ ac_cv_have_int64_t="yes" ],
1260 [ ac_cv_have_int64_t="no" ]
1261 )
1262])
1263if test "x$ac_cv_have_int64_t" = "xyes" ; then
1264 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001265fi
1266
Damien Miller61e50f12000-05-08 20:49:37 +10001267AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1268 AC_TRY_COMPILE(
1269 [ #include <sys/types.h> ],
1270 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1271 [ ac_cv_have_u_intxx_t="yes" ],
1272 [ ac_cv_have_u_intxx_t="no" ]
1273 )
1274])
1275if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1276 AC_DEFINE(HAVE_U_INTXX_T)
1277 have_u_intxx_t=1
1278fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001279
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001280if test -z "$have_u_intxx_t" ; then
1281 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1282 AC_TRY_COMPILE(
1283 [ #include <sys/socket.h> ],
1284 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1285 [
1286 AC_DEFINE(HAVE_U_INTXX_T)
1287 AC_MSG_RESULT(yes)
1288 ],
1289 [ AC_MSG_RESULT(no) ]
1290 )
1291fi
1292
Damien Miller578783e2000-09-23 14:12:24 +11001293AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1294 AC_TRY_COMPILE(
1295 [ #include <sys/types.h> ],
1296 [ u_int64_t a; a = 1;],
1297 [ ac_cv_have_u_int64_t="yes" ],
1298 [ ac_cv_have_u_int64_t="no" ]
1299 )
1300])
1301if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1302 AC_DEFINE(HAVE_U_INT64_T)
1303 have_u_int64_t=1
1304fi
1305
Tim Rice4cec93f2002-02-26 08:40:48 -08001306if test -z "$have_u_int64_t" ; then
1307 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1308 AC_TRY_COMPILE(
1309 [ #include <sys/bitypes.h> ],
1310 [ u_int64_t a; a = 1],
1311 [
1312 AC_DEFINE(HAVE_U_INT64_T)
1313 AC_MSG_RESULT(yes)
1314 ],
1315 [ AC_MSG_RESULT(no) ]
1316 )
1317fi
1318
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001319if test -z "$have_u_intxx_t" ; then
1320 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1321 AC_TRY_COMPILE(
1322 [
1323#include <sys/types.h>
1324 ],
1325 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1326 [ ac_cv_have_uintxx_t="yes" ],
1327 [ ac_cv_have_uintxx_t="no" ]
1328 )
1329 ])
1330 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1331 AC_DEFINE(HAVE_UINTXX_T)
1332 fi
1333fi
1334
1335if test -z "$have_uintxx_t" ; then
1336 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1337 AC_TRY_COMPILE(
1338 [ #include <stdint.h> ],
1339 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1340 [
1341 AC_DEFINE(HAVE_UINTXX_T)
1342 AC_MSG_RESULT(yes)
1343 ],
1344 [ AC_MSG_RESULT(no) ]
1345 )
1346fi
1347
Damien Milleredb82922000-06-20 13:25:52 +10001348if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1349 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001350then
1351 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1352 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001353 [
1354#include <sys/bitypes.h>
1355 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001356 [
Damien Miller70494d12000-04-03 15:57:06 +10001357 int8_t a; int16_t b; int32_t c;
1358 u_int8_t e; u_int16_t f; u_int32_t g;
1359 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001360 ],
1361 [
1362 AC_DEFINE(HAVE_U_INTXX_T)
1363 AC_DEFINE(HAVE_INTXX_T)
1364 AC_MSG_RESULT(yes)
1365 ],
1366 [AC_MSG_RESULT(no)]
1367 )
1368fi
1369
Damien Miller58be7382001-09-15 21:31:54 +10001370
1371AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1372 AC_TRY_COMPILE(
1373 [
1374#include <sys/types.h>
1375 ],
1376 [ u_char foo; foo = 125; ],
1377 [ ac_cv_have_u_char="yes" ],
1378 [ ac_cv_have_u_char="no" ]
1379 )
1380])
1381if test "x$ac_cv_have_u_char" = "xyes" ; then
1382 AC_DEFINE(HAVE_U_CHAR)
1383fi
1384
Tim Rice13aae5e2001-10-21 17:53:58 -07001385TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001386
Tim Rice200a5c02002-02-26 22:12:34 -08001387AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001388
Damien Miller61e50f12000-05-08 20:49:37 +10001389AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1390 AC_TRY_COMPILE(
1391 [
1392#include <sys/types.h>
1393 ],
1394 [ size_t foo; foo = 1235; ],
1395 [ ac_cv_have_size_t="yes" ],
1396 [ ac_cv_have_size_t="no" ]
1397 )
1398])
1399if test "x$ac_cv_have_size_t" = "xyes" ; then
1400 AC_DEFINE(HAVE_SIZE_T)
1401fi
Damien Miller95058511999-12-29 10:36:45 +11001402
Damien Miller615f9392000-05-17 22:53:33 +10001403AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1404 AC_TRY_COMPILE(
1405 [
1406#include <sys/types.h>
1407 ],
1408 [ ssize_t foo; foo = 1235; ],
1409 [ ac_cv_have_ssize_t="yes" ],
1410 [ ac_cv_have_ssize_t="no" ]
1411 )
1412])
1413if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1414 AC_DEFINE(HAVE_SSIZE_T)
1415fi
1416
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001417AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1418 AC_TRY_COMPILE(
1419 [
1420#include <time.h>
1421 ],
1422 [ clock_t foo; foo = 1235; ],
1423 [ ac_cv_have_clock_t="yes" ],
1424 [ ac_cv_have_clock_t="no" ]
1425 )
1426])
1427if test "x$ac_cv_have_clock_t" = "xyes" ; then
1428 AC_DEFINE(HAVE_CLOCK_T)
1429fi
1430
Damien Millerb54b40e2000-06-23 08:23:34 +10001431AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1432 AC_TRY_COMPILE(
1433 [
1434#include <sys/types.h>
1435#include <sys/socket.h>
1436 ],
1437 [ sa_family_t foo; foo = 1235; ],
1438 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001439 [ AC_TRY_COMPILE(
1440 [
1441#include <sys/types.h>
1442#include <sys/socket.h>
1443#include <netinet/in.h>
1444 ],
1445 [ sa_family_t foo; foo = 1235; ],
1446 [ ac_cv_have_sa_family_t="yes" ],
1447
Damien Millerb54b40e2000-06-23 08:23:34 +10001448 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001449 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001450 )
1451])
1452if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1453 AC_DEFINE(HAVE_SA_FAMILY_T)
1454fi
1455
Damien Miller0f91b4e2000-06-18 15:43:25 +10001456AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1457 AC_TRY_COMPILE(
1458 [
1459#include <sys/types.h>
1460 ],
1461 [ pid_t foo; foo = 1235; ],
1462 [ ac_cv_have_pid_t="yes" ],
1463 [ ac_cv_have_pid_t="no" ]
1464 )
1465])
1466if test "x$ac_cv_have_pid_t" = "xyes" ; then
1467 AC_DEFINE(HAVE_PID_T)
1468fi
1469
1470AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1471 AC_TRY_COMPILE(
1472 [
1473#include <sys/types.h>
1474 ],
1475 [ mode_t foo; foo = 1235; ],
1476 [ ac_cv_have_mode_t="yes" ],
1477 [ ac_cv_have_mode_t="no" ]
1478 )
1479])
1480if test "x$ac_cv_have_mode_t" = "xyes" ; then
1481 AC_DEFINE(HAVE_MODE_T)
1482fi
1483
Damien Miller61e50f12000-05-08 20:49:37 +10001484
1485AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1486 AC_TRY_COMPILE(
1487 [
Damien Miller81171112000-04-23 11:14:01 +10001488#include <sys/types.h>
1489#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001490 ],
1491 [ struct sockaddr_storage s; ],
1492 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1493 [ ac_cv_have_struct_sockaddr_storage="no" ]
1494 )
1495])
1496if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1497 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1498fi
Damien Miller34132e52000-01-14 15:45:46 +11001499
Damien Miller61e50f12000-05-08 20:49:37 +10001500AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1501 AC_TRY_COMPILE(
1502 [
Damien Miller7b22d652000-06-18 14:07:04 +10001503#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001504#include <netinet/in.h>
1505 ],
1506 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1507 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1508 [ ac_cv_have_struct_sockaddr_in6="no" ]
1509 )
1510])
1511if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1512 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1513fi
Damien Miller34132e52000-01-14 15:45:46 +11001514
Damien Miller61e50f12000-05-08 20:49:37 +10001515AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1516 AC_TRY_COMPILE(
1517 [
Damien Miller7b22d652000-06-18 14:07:04 +10001518#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001519#include <netinet/in.h>
1520 ],
1521 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1522 [ ac_cv_have_struct_in6_addr="yes" ],
1523 [ ac_cv_have_struct_in6_addr="no" ]
1524 )
1525])
1526if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1527 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1528fi
Damien Miller34132e52000-01-14 15:45:46 +11001529
Damien Miller61e50f12000-05-08 20:49:37 +10001530AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1531 AC_TRY_COMPILE(
1532 [
Damien Miller81171112000-04-23 11:14:01 +10001533#include <sys/types.h>
1534#include <sys/socket.h>
1535#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001536 ],
1537 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1538 [ ac_cv_have_struct_addrinfo="yes" ],
1539 [ ac_cv_have_struct_addrinfo="no" ]
1540 )
1541])
1542if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1543 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1544fi
1545
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001546AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1547 AC_TRY_COMPILE(
1548 [ #include <sys/time.h> ],
1549 [ struct timeval tv; tv.tv_sec = 1;],
1550 [ ac_cv_have_struct_timeval="yes" ],
1551 [ ac_cv_have_struct_timeval="no" ]
1552 )
1553])
1554if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1555 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1556 have_struct_timeval=1
1557fi
1558
Tim Rice4e4dc562003-03-18 10:21:40 -08001559AC_CHECK_TYPES(struct timespec)
1560
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001561# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001562if test "x$ac_cv_have_int64_t" = "xno" -a \
1563 "x$ac_cv_sizeof_long_int" != "x8" -a \
1564 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001565 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1566 echo "an alternative compiler (I.E., GCC) before continuing."
1567 echo ""
1568 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001569else
1570dnl test snprintf (broken on SCO w/gcc)
1571 AC_TRY_RUN(
1572 [
1573#include <stdio.h>
1574#include <string.h>
1575#ifdef HAVE_SNPRINTF
1576main()
1577{
1578 char buf[50];
1579 char expected_out[50];
1580 int mazsize = 50 ;
1581#if (SIZEOF_LONG_INT == 8)
1582 long int num = 0x7fffffffffffffff;
1583#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001584 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001585#endif
1586 strcpy(expected_out, "9223372036854775807");
1587 snprintf(buf, mazsize, "%lld", num);
1588 if(strcmp(buf, expected_out) != 0)
1589 exit(1);
1590 exit(0);
1591}
1592#else
1593main() { exit(0); }
1594#endif
1595 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1596 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001597fi
1598
Damien Miller78315eb2000-09-29 23:01:36 +11001599dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001600OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1601OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1602OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1603OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1604OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001605OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001606OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1607OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001608OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001609OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1610OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1611OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1612OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001613OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1614OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1615OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1616OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001617
1618AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001619
Damien Miller61e50f12000-05-08 20:49:37 +10001620AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1621 ac_cv_have_ss_family_in_struct_ss, [
1622 AC_TRY_COMPILE(
1623 [
Damien Miller81171112000-04-23 11:14:01 +10001624#include <sys/types.h>
1625#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001626 ],
1627 [ struct sockaddr_storage s; s.ss_family = 1; ],
1628 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1629 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1630 )
1631])
1632if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1633 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1634fi
1635
Damien Miller61e50f12000-05-08 20:49:37 +10001636AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1637 ac_cv_have___ss_family_in_struct_ss, [
1638 AC_TRY_COMPILE(
1639 [
Damien Miller81171112000-04-23 11:14:01 +10001640#include <sys/types.h>
1641#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001642 ],
1643 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1644 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1645 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1646 )
1647])
1648if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1649 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1650fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001651
Damien Millerad833b32000-08-23 10:46:23 +10001652AC_CACHE_CHECK([for pw_class field in struct passwd],
1653 ac_cv_have_pw_class_in_struct_passwd, [
1654 AC_TRY_COMPILE(
1655 [
Damien Millerad833b32000-08-23 10:46:23 +10001656#include <pwd.h>
1657 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001658 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001659 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1660 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1661 )
1662])
1663if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1664 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1665fi
1666
Kevin Steves82456952001-06-22 21:14:18 +00001667AC_CACHE_CHECK([for pw_expire field in struct passwd],
1668 ac_cv_have_pw_expire_in_struct_passwd, [
1669 AC_TRY_COMPILE(
1670 [
1671#include <pwd.h>
1672 ],
1673 [ struct passwd p; p.pw_expire = 0; ],
1674 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1675 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1676 )
1677])
1678if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1679 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1680fi
1681
1682AC_CACHE_CHECK([for pw_change field in struct passwd],
1683 ac_cv_have_pw_change_in_struct_passwd, [
1684 AC_TRY_COMPILE(
1685 [
1686#include <pwd.h>
1687 ],
1688 [ struct passwd p; p.pw_change = 0; ],
1689 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1690 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1691 )
1692])
1693if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1694 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1695fi
Damien Miller61e50f12000-05-08 20:49:37 +10001696
Tim Rice28bbb0c2002-05-27 17:37:32 -07001697dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001698AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1699 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001700 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001701 [
Tim Riceae49fe62002-04-12 10:26:21 -07001702#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001703#include <sys/socket.h>
1704#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001705int main() {
1706#ifdef msg_accrights
1707exit(1);
1708#endif
1709struct msghdr m;
1710m.msg_accrights = 0;
1711exit(0);
1712}
Kevin Steves939c9db2002-03-22 17:23:25 +00001713 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001714 [ ac_cv_have_accrights_in_msghdr="yes" ],
1715 [ ac_cv_have_accrights_in_msghdr="no" ]
1716 )
1717])
1718if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1719 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1720fi
1721
Kevin Stevesa44e0352002-04-07 16:18:03 +00001722AC_CACHE_CHECK([for msg_control field in struct msghdr],
1723 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001724 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001725 [
Tim Riceae49fe62002-04-12 10:26:21 -07001726#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001727#include <sys/socket.h>
1728#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001729int main() {
1730#ifdef msg_control
1731exit(1);
1732#endif
1733struct msghdr m;
1734m.msg_control = 0;
1735exit(0);
1736}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001737 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001738 [ ac_cv_have_control_in_msghdr="yes" ],
1739 [ ac_cv_have_control_in_msghdr="no" ]
1740 )
1741])
1742if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1743 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1744fi
1745
Damien Miller61e50f12000-05-08 20:49:37 +10001746AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1747 AC_TRY_LINK([],
1748 [ extern char *__progname; printf("%s", __progname); ],
1749 [ ac_cv_libc_defines___progname="yes" ],
1750 [ ac_cv_libc_defines___progname="no" ]
1751 )
1752])
1753if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1754 AC_DEFINE(HAVE___PROGNAME)
1755fi
1756
Kevin Steves4846f4a2002-03-22 18:19:53 +00001757AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1758 AC_TRY_LINK([
1759#include <stdio.h>
1760],
1761 [ printf("%s", __FUNCTION__); ],
1762 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1763 [ ac_cv_cc_implements___FUNCTION__="no" ]
1764 )
1765])
1766if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1767 AC_DEFINE(HAVE___FUNCTION__)
1768fi
1769
1770AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1771 AC_TRY_LINK([
1772#include <stdio.h>
1773],
1774 [ printf("%s", __func__); ],
1775 [ ac_cv_cc_implements___func__="yes" ],
1776 [ ac_cv_cc_implements___func__="no" ]
1777 )
1778])
1779if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1780 AC_DEFINE(HAVE___func__)
1781fi
1782
Damien Miller4f8e6692001-07-14 13:22:53 +10001783AC_CACHE_CHECK([whether getopt has optreset support],
1784 ac_cv_have_getopt_optreset, [
1785 AC_TRY_LINK(
1786 [
1787#include <getopt.h>
1788 ],
1789 [ extern int optreset; optreset = 0; ],
1790 [ ac_cv_have_getopt_optreset="yes" ],
1791 [ ac_cv_have_getopt_optreset="no" ]
1792 )
1793])
1794if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1795 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1796fi
Damien Millera22ba012000-03-02 23:09:20 +11001797
Damien Millerecbb26d2000-07-15 14:59:14 +10001798AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1799 AC_TRY_LINK([],
1800 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1801 [ ac_cv_libc_defines_sys_errlist="yes" ],
1802 [ ac_cv_libc_defines_sys_errlist="no" ]
1803 )
1804])
1805if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1806 AC_DEFINE(HAVE_SYS_ERRLIST)
1807fi
1808
1809
Damien Miller11fa2cc2000-08-16 10:35:58 +10001810AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1811 AC_TRY_LINK([],
1812 [ extern int sys_nerr; printf("%i", sys_nerr);],
1813 [ ac_cv_libc_defines_sys_nerr="yes" ],
1814 [ ac_cv_libc_defines_sys_nerr="no" ]
1815 )
1816])
1817if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1818 AC_DEFINE(HAVE_SYS_NERR)
1819fi
1820
Damien Miller85de5802001-09-18 14:01:11 +10001821SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001822# Check whether user wants sectok support
1823AC_ARG_WITH(sectok,
1824 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001825 [
1826 if test "x$withval" != "xno" ; then
1827 if test "x$withval" != "xyes" ; then
1828 CPPFLAGS="$CPPFLAGS -I${withval}"
1829 LDFLAGS="$LDFLAGS -L${withval}"
1830 if test ! -z "$need_dash_r" ; then
1831 LDFLAGS="$LDFLAGS -R${withval}"
1832 fi
1833 if test ! -z "$blibpath" ; then
1834 blibpath="$blibpath:${withval}"
1835 fi
1836 fi
1837 AC_CHECK_HEADERS(sectok.h)
1838 if test "$ac_cv_header_sectok_h" != yes; then
1839 AC_MSG_ERROR(Can't find sectok.h)
1840 fi
1841 AC_CHECK_LIB(sectok, sectok_open)
1842 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1843 AC_MSG_ERROR(Can't find libsectok)
1844 fi
1845 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001846 AC_DEFINE(USE_SECTOK)
1847 SCARD_MSG="yes, using sectok"
1848 fi
1849 ]
1850)
1851
1852# Check whether user wants OpenSC support
1853AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001854 AC_HELP_STRING([--with-opensc=PFX],
1855 [Enable smartcard support using OpenSC]),
1856 opensc_config_prefix="$withval", opensc_config_prefix="")
1857if test x$opensc_config_prefix != x ; then
1858 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1859 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1860 if test "$OPENSC_CONFIG" != "no"; then
1861 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1862 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1863 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1864 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1865 AC_DEFINE(SMARTCARD)
1866 AC_DEFINE(USE_OPENSC)
1867 SCARD_MSG="yes, using OpenSC"
1868 fi
1869fi
Damien Miller85de5802001-09-18 14:01:11 +10001870
Damien Miller7abe09b2003-05-15 10:53:49 +10001871# Check whether user wants DNS support
1872DNS_MSG="no"
1873AC_ARG_WITH(dns,
1874 [ --with-dns Support for fetching keys from DNS (experimental)],
1875 [
1876 if test "x$withval" != "xno" ; then
Damien Millerd9ec3702003-05-15 12:27:08 +10001877 DNS_MSG="yes"
1878 AC_DEFINE(DNS)
1879 AC_SEARCH_LIBS(getrrsetbyname, resolv,
Damien Miller200d0a72003-06-30 19:21:36 +10001880 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1881 [
1882 # Needed by our getrrsetbyname()
1883 AC_SEARCH_LIBS(res_query, resolv)
1884 AC_SEARCH_LIBS(dn_expand, resolv)
1885 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10001886 fi
1887 ]
1888)
1889
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001890# Check whether user wants Kerberos 5 support
1891KRB5_MSG="no"
1892AC_ARG_WITH(kerberos5,
1893 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1894 [
1895 if test "x$withval" != "xno" ; then
1896 if test "x$withval" = "xyes" ; then
1897 KRB5ROOT="/usr/local"
1898 else
1899 KRB5ROOT=${withval}
1900 fi
1901 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1902 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1903 AC_DEFINE(KRB5)
1904 KRB5_MSG="yes"
1905 AC_MSG_CHECKING(whether we are using Heimdal)
1906 AC_TRY_COMPILE([ #include <krb5.h> ],
1907 [ char *tmp = heimdal_version; ],
1908 [ AC_MSG_RESULT(yes)
1909 AC_DEFINE(HEIMDAL)
1910 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1911 ],
1912 [ AC_MSG_RESULT(no)
1913 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1914 ]
1915 )
1916 if test ! -z "$need_dash_r" ; then
1917 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1918 fi
1919 if test ! -z "$blibpath" ; then
1920 blibpath="$blibpath:${KRB5ROOT}/lib"
1921 fi
Damien Miller200d0a72003-06-30 19:21:36 +10001922 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001923
1924 KRB5=yes
1925 fi
1926 ]
1927)
1928# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001929KRB4_MSG="no"
1930AC_ARG_WITH(kerberos4,
1931 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1932 [
1933 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001934 if test "x$withval" != "xyes" ; then
1935 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1936 LDFLAGS="$LDFLAGS -L${withval}/lib"
1937 if test ! -z "$need_dash_r" ; then
1938 LDFLAGS="$LDFLAGS -R${withval}/lib"
1939 fi
1940 if test ! -z "$blibpath" ; then
1941 blibpath="$blibpath:${withval}/lib"
1942 fi
1943 else
1944 if test -d /usr/include/kerberosIV ; then
1945 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1946 fi
1947 fi
1948
1949 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001950 if test "$ac_cv_header_krb_h" != yes; then
1951 AC_MSG_WARN([Cannot find krb.h, build may fail])
1952 fi
Damien Miller98344742001-03-28 14:37:06 +10001953 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001954 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001955 AC_CHECK_LIB(krb4, main)
1956 if test "$ac_cv_lib_krb4_main" != yes; then
1957 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1958 else
1959 KLIBS="-lkrb4"
1960 fi
1961 else
1962 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001963 fi
Damien Miller98344742001-03-28 14:37:06 +10001964 AC_CHECK_LIB(des, des_cbc_encrypt)
1965 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1966 AC_CHECK_LIB(des425, des_cbc_encrypt)
1967 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1968 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1969 else
1970 KLIBS="-ldes425"
1971 fi
1972 else
1973 KLIBS="-ldes"
1974 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001975 AC_CHECK_LIB(resolv, dn_expand, , )
1976 KRB4=yes
1977 KRB4_MSG="yes"
1978 AC_DEFINE(KRB4)
1979 fi
1980 ]
1981)
1982
1983# Check whether user wants AFS support
1984AFS_MSG="no"
1985AC_ARG_WITH(afs,
1986 [ --with-afs=PATH Enable AFS support],
1987 [
1988 if test "x$withval" != "xno" ; then
1989
1990 if test "x$withval" != "xyes" ; then
1991 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1992 LDFLAGS="$LDFLAGS -L${withval}/lib"
1993 fi
1994
1995 if test -z "$KRB4" ; then
1996 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1997 fi
1998
1999 LIBS="-lkafs $LIBS"
2000 if test ! -z "$AFS_LIBS" ; then
2001 LIBS="$LIBS $AFS_LIBS"
2002 fi
2003 AC_DEFINE(AFS)
2004 AFS_MSG="yes"
2005 fi
2006 ]
2007)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002008LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002009
Damien Millera22ba012000-03-02 23:09:20 +11002010# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002011
Damien Millerf58c6722002-05-13 13:15:42 +10002012PRIVSEP_PATH=/var/empty
2013AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002014 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002015 [
2016 if test "x$withval" != "$no" ; then
2017 PRIVSEP_PATH=$withval
2018 fi
2019 ]
2020)
2021AC_SUBST(PRIVSEP_PATH)
2022
Damien Millera22ba012000-03-02 23:09:20 +11002023AC_ARG_WITH(xauth,
2024 [ --with-xauth=PATH Specify path to xauth program ],
2025 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002026 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002027 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002028 fi
2029 ],
2030 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002031 TestPath="$PATH"
2032 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2033 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2034 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2035 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2036 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002037 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002038 xauth_path="/usr/openwin/bin/xauth"
2039 fi
2040 ]
2041)
2042
Damien Miller7d901272003-01-13 16:55:22 +11002043STRIP_OPT=-s
2044AC_ARG_ENABLE(strip,
2045 [ --disable-strip Disable calling strip(1) on install],
2046 [
2047 if test "x$enableval" = "xno" ; then
2048 STRIP_OPT=
2049 fi
2050 ]
2051)
2052AC_SUBST(STRIP_OPT)
2053
Damien Millera19cf472000-11-29 13:28:50 +11002054if test -z "$xauth_path" ; then
2055 XAUTH_PATH="undefined"
2056 AC_SUBST(XAUTH_PATH)
2057else
Damien Millera22ba012000-03-02 23:09:20 +11002058 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002059 XAUTH_PATH=$xauth_path
2060 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002061fi
Damien Millera22ba012000-03-02 23:09:20 +11002062
2063# Check for mail directory (last resort if we cannot get it from headers)
2064if test ! -z "$MAIL" ; then
2065 maildir=`dirname $MAIL`
2066 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2067fi
2068
Damien Millera22ba012000-03-02 23:09:20 +11002069if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002070 if test "x$disable_ptmx_check" != "xyes" ; then
2071 AC_CHECK_FILE("/dev/ptmx",
2072 [
2073 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2074 have_dev_ptmx=1
2075 ]
2076 )
2077 fi
Damien Millera22ba012000-03-02 23:09:20 +11002078fi
Damien Miller204ad072000-03-02 23:56:12 +11002079AC_CHECK_FILE("/dev/ptc",
2080 [
2081 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2082 have_dev_ptc=1
2083 ]
2084)
2085
Damien Millera22ba012000-03-02 23:09:20 +11002086# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002087AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002088 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002089 [
Damien Miller897741e2001-04-16 10:41:46 +10002090 case "$withval" in
2091 man|cat|doc)
2092 MANTYPE=$withval
2093 ;;
2094 *)
2095 AC_MSG_ERROR(invalid man type: $withval)
2096 ;;
2097 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002098 ]
2099)
Ben Lindstrombc709922001-04-18 18:04:21 +00002100if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002101 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2102 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002103 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2104 MANTYPE=doc
2105 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2106 MANTYPE=man
2107 else
2108 MANTYPE=cat
2109 fi
2110fi
Damien Miller670a4b82000-01-22 13:53:11 +11002111AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002112if test "$MANTYPE" = "doc"; then
2113 mansubdir=man;
2114else
2115 mansubdir=$MANTYPE;
2116fi
2117AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002118
Damien Millera22ba012000-03-02 23:09:20 +11002119# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002120MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002121AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002122 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002123 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002124 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002125 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002126 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002127 fi
2128 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002129)
2130
Damien Millera22ba012000-03-02 23:09:20 +11002131# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002132AC_ARG_WITH(shadow,
2133 [ --without-shadow Disable shadow password support],
2134 [
2135 if test "x$withval" = "xno" ; then
2136 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002137 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002138 fi
2139 ]
2140)
2141
Damien Miller1f335fb2000-06-26 11:31:33 +10002142if test -z "$disable_shadow" ; then
2143 AC_MSG_CHECKING([if the systems has expire shadow information])
2144 AC_TRY_COMPILE(
2145 [
2146#include <sys/types.h>
2147#include <shadow.h>
2148 struct spwd sp;
2149 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2150 [ sp_expire_available=yes ], []
2151 )
2152
2153 if test "x$sp_expire_available" = "xyes" ; then
2154 AC_MSG_RESULT(yes)
2155 AC_DEFINE(HAS_SHADOW_EXPIRE)
2156 else
2157 AC_MSG_RESULT(no)
2158 fi
2159fi
2160
Damien Millera22ba012000-03-02 23:09:20 +11002161# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002162if test ! -z "$IPADDR_IN_DISPLAY" ; then
2163 DISPLAY_HACK_MSG="yes"
2164 AC_DEFINE(IPADDR_IN_DISPLAY)
2165else
2166 DISPLAY_HACK_MSG="no"
2167 AC_ARG_WITH(ipaddr-display,
2168 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2169 [
2170 if test "x$withval" != "xno" ; then
2171 AC_DEFINE(IPADDR_IN_DISPLAY)
2172 DISPLAY_HACK_MSG="yes"
2173 fi
2174 ]
2175 )
2176fi
Damien Miller76112de1999-12-21 11:18:08 +11002177
Tim Rice43a1c132002-04-17 21:19:14 -07002178dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2179if test $ac_cv_func_login_getcapbool = "yes" -a \
2180 $ac_cv_header_login_cap_h = "yes" ; then
2181 USES_LOGIN_CONF=yes
2182fi
Damien Millera22ba012000-03-02 23:09:20 +11002183# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002184SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002185AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002186 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002187 [
Tim Rice43a1c132002-04-17 21:19:14 -07002188 if test "$USES_LOGIN_CONF" = "yes" ; then
2189 AC_MSG_WARN([
2190--with-default-path=PATH has no effect on this system.
2191Edit /etc/login.conf instead.])
2192 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002193 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002194 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002195 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002196 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002197 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2198 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2199 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002200 AC_TRY_RUN(
2201 [
2202/* find out what STDPATH is */
2203#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002204#ifdef HAVE_PATHS_H
2205# include <paths.h>
2206#endif
2207#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002208# ifdef _PATH_USERPATH /* Irix */
2209# define _PATH_STDPATH _PATH_USERPATH
2210# else
2211# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2212# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002213#endif
2214#include <sys/types.h>
2215#include <sys/stat.h>
2216#include <fcntl.h>
2217#define DATA "conftest.stdpath"
2218
2219main()
2220{
2221 FILE *fd;
2222 int rc;
2223
2224 fd = fopen(DATA,"w");
2225 if(fd == NULL)
2226 exit(1);
2227
2228 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2229 exit(1);
2230
2231 exit(0);
2232}
2233 ], [ user_path=`cat conftest.stdpath` ],
2234 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2235 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2236 )
2237# make sure $bindir is in USER_PATH so scp will work
2238 t_bindir=`eval echo ${bindir}`
2239 case $t_bindir in
2240 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2241 esac
2242 case $t_bindir in
2243 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2244 esac
2245 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2246 if test $? -ne 0 ; then
2247 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2248 if test $? -ne 0 ; then
2249 user_path=$user_path:$t_bindir
2250 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2251 fi
2252 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002253 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002254)
Tim Rice43a1c132002-04-17 21:19:14 -07002255if test "$USES_LOGIN_CONF" != "yes" ; then
2256 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2257 AC_SUBST(user_path)
2258fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002259
Damien Millera18bbd32002-05-13 10:48:57 +10002260# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002261AC_ARG_WITH(superuser-path,
2262 [ --with-superuser-path= Specify different path for super-user],
2263 [
2264 if test "x$withval" != "xno" ; then
2265 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2266 superuser_path=$withval
2267 fi
2268 ]
2269)
2270
2271
Damien Miller61e50f12000-05-08 20:49:37 +10002272AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002273IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002274AC_ARG_WITH(4in6,
2275 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2276 [
2277 if test "x$withval" != "xno" ; then
2278 AC_MSG_RESULT(yes)
2279 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002280 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002281 else
2282 AC_MSG_RESULT(no)
2283 fi
2284 ],[
2285 if test "x$inet6_default_4in6" = "xyes"; then
2286 AC_MSG_RESULT([yes (default)])
2287 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002288 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002289 else
2290 AC_MSG_RESULT([no (default)])
2291 fi
2292 ]
2293)
2294
Damien Miller60396b02001-02-18 17:01:00 +11002295# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002296BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002297AC_ARG_WITH(bsd-auth,
2298 [ --with-bsd-auth Enable BSD auth support],
2299 [
2300 if test "x$withval" != "xno" ; then
2301 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002302 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002303 fi
2304 ]
2305)
2306
Damien Millera22ba012000-03-02 23:09:20 +11002307# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002308piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002309# make sure the directory exists
2310if test ! -d $piddir ; then
2311 piddir=`eval echo ${sysconfdir}`
2312 case $piddir in
2313 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2314 esac
2315fi
2316
Tim Rice88f2ab52002-03-17 12:17:34 -08002317AC_ARG_WITH(pid-dir,
2318 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2319 [
2320 if test "x$withval" != "xno" ; then
2321 piddir=$withval
2322 if test ! -d $piddir ; then
2323 AC_MSG_WARN([** no $piddir directory on this system **])
2324 fi
2325 fi
2326 ]
2327)
2328
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002329AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002330AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002331
andre2ff7b5d2000-06-03 14:57:40 +00002332dnl allow user to disable some login recording features
2333AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002334 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002335 [
2336 if test "x$enableval" = "xno" ; then
2337 AC_DEFINE(DISABLE_LASTLOG)
2338 fi
2339 ]
andre2ff7b5d2000-06-03 14:57:40 +00002340)
2341AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002342 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002343 [
2344 if test "x$enableval" = "xno" ; then
2345 AC_DEFINE(DISABLE_UTMP)
2346 fi
2347 ]
andre2ff7b5d2000-06-03 14:57:40 +00002348)
2349AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002350 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002351 [
2352 if test "x$enableval" = "xno" ; then
2353 AC_DEFINE(DISABLE_UTMPX)
2354 fi
2355 ]
andre2ff7b5d2000-06-03 14:57:40 +00002356)
2357AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002358 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002359 [
2360 if test "x$enableval" = "xno" ; then
2361 AC_DEFINE(DISABLE_WTMP)
2362 fi
2363 ]
andre2ff7b5d2000-06-03 14:57:40 +00002364)
2365AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002366 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002367 [
2368 if test "x$enableval" = "xno" ; then
2369 AC_DEFINE(DISABLE_WTMPX)
2370 fi
2371 ]
andre2ff7b5d2000-06-03 14:57:40 +00002372)
2373AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002374 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002375 [
2376 if test "x$enableval" = "xno" ; then
2377 AC_DEFINE(DISABLE_LOGIN)
2378 fi
2379 ]
andre2ff7b5d2000-06-03 14:57:40 +00002380)
2381AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002382 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002383 [
2384 if test "x$enableval" = "xno" ; then
2385 AC_DEFINE(DISABLE_PUTUTLINE)
2386 fi
2387 ]
andre2ff7b5d2000-06-03 14:57:40 +00002388)
2389AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002390 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002391 [
2392 if test "x$enableval" = "xno" ; then
2393 AC_DEFINE(DISABLE_PUTUTXLINE)
2394 fi
2395 ]
andre2ff7b5d2000-06-03 14:57:40 +00002396)
2397AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002398 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002399 [
2400 if test "x$withval" = "xno" ; then
2401 AC_DEFINE(DISABLE_LASTLOG)
2402 else
2403 conf_lastlog_location=$withval
2404 fi
2405 ]
2406)
andre2ff7b5d2000-06-03 14:57:40 +00002407
2408dnl lastlog, [uw]tmpx? detection
2409dnl NOTE: set the paths in the platform section to avoid the
2410dnl need for command-line parameters
2411dnl lastlog and [uw]tmp are subject to a file search if all else fails
2412
2413dnl lastlog detection
2414dnl NOTE: the code itself will detect if lastlog is a directory
2415AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2416AC_TRY_COMPILE([
2417#include <sys/types.h>
2418#include <utmp.h>
2419#ifdef HAVE_LASTLOG_H
2420# include <lastlog.h>
2421#endif
Damien Miller2994e082000-06-04 15:51:47 +10002422#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002423# include <paths.h>
2424#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002425#ifdef HAVE_LOGIN_H
2426# include <login.h>
2427#endif
andre2ff7b5d2000-06-03 14:57:40 +00002428 ],
2429 [ char *lastlog = LASTLOG_FILE; ],
2430 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002431 [
2432 AC_MSG_RESULT(no)
2433 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2434 AC_TRY_COMPILE([
2435#include <sys/types.h>
2436#include <utmp.h>
2437#ifdef HAVE_LASTLOG_H
2438# include <lastlog.h>
2439#endif
2440#ifdef HAVE_PATHS_H
2441# include <paths.h>
2442#endif
2443 ],
2444 [ char *lastlog = _PATH_LASTLOG; ],
2445 [ AC_MSG_RESULT(yes) ],
2446 [
andree441aa32000-06-12 22:34:38 +00002447 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002448 system_lastlog_path=no
2449 ])
2450 ]
andre2ff7b5d2000-06-03 14:57:40 +00002451)
Damien Miller2994e082000-06-04 15:51:47 +10002452
andre2ff7b5d2000-06-03 14:57:40 +00002453if test -z "$conf_lastlog_location"; then
2454 if test x"$system_lastlog_path" = x"no" ; then
2455 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002456 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002457 conf_lastlog_location=$f
2458 fi
2459 done
2460 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002461 AC_MSG_WARN([** Cannot find lastlog **])
2462 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002463 fi
2464 fi
2465fi
2466
2467if test -n "$conf_lastlog_location"; then
2468 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2469fi
2470
2471dnl utmp detection
2472AC_MSG_CHECKING([if your system defines UTMP_FILE])
2473AC_TRY_COMPILE([
2474#include <sys/types.h>
2475#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002476#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002477# include <paths.h>
2478#endif
2479 ],
2480 [ char *utmp = UTMP_FILE; ],
2481 [ AC_MSG_RESULT(yes) ],
2482 [ AC_MSG_RESULT(no)
2483 system_utmp_path=no ]
2484)
2485if test -z "$conf_utmp_location"; then
2486 if test x"$system_utmp_path" = x"no" ; then
2487 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2488 if test -f $f ; then
2489 conf_utmp_location=$f
2490 fi
2491 done
2492 if test -z "$conf_utmp_location"; then
2493 AC_DEFINE(DISABLE_UTMP)
2494 fi
2495 fi
2496fi
2497if test -n "$conf_utmp_location"; then
2498 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2499fi
2500
2501dnl wtmp detection
2502AC_MSG_CHECKING([if your system defines WTMP_FILE])
2503AC_TRY_COMPILE([
2504#include <sys/types.h>
2505#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002506#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002507# include <paths.h>
2508#endif
2509 ],
2510 [ char *wtmp = WTMP_FILE; ],
2511 [ AC_MSG_RESULT(yes) ],
2512 [ AC_MSG_RESULT(no)
2513 system_wtmp_path=no ]
2514)
2515if test -z "$conf_wtmp_location"; then
2516 if test x"$system_wtmp_path" = x"no" ; then
2517 for f in /usr/adm/wtmp /var/log/wtmp; do
2518 if test -f $f ; then
2519 conf_wtmp_location=$f
2520 fi
2521 done
2522 if test -z "$conf_wtmp_location"; then
2523 AC_DEFINE(DISABLE_WTMP)
2524 fi
2525 fi
2526fi
2527if test -n "$conf_wtmp_location"; then
2528 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2529fi
2530
2531
2532dnl utmpx detection - I don't know any system so perverse as to require
2533dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2534dnl there, though.
2535AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2536AC_TRY_COMPILE([
2537#include <sys/types.h>
2538#include <utmp.h>
2539#ifdef HAVE_UTMPX_H
2540#include <utmpx.h>
2541#endif
Damien Miller2994e082000-06-04 15:51:47 +10002542#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002543# include <paths.h>
2544#endif
2545 ],
2546 [ char *utmpx = UTMPX_FILE; ],
2547 [ AC_MSG_RESULT(yes) ],
2548 [ AC_MSG_RESULT(no)
2549 system_utmpx_path=no ]
2550)
2551if test -z "$conf_utmpx_location"; then
2552 if test x"$system_utmpx_path" = x"no" ; then
2553 AC_DEFINE(DISABLE_UTMPX)
2554 fi
2555else
2556 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2557fi
2558
2559dnl wtmpx detection
2560AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2561AC_TRY_COMPILE([
2562#include <sys/types.h>
2563#include <utmp.h>
2564#ifdef HAVE_UTMPX_H
2565#include <utmpx.h>
2566#endif
Damien Miller2994e082000-06-04 15:51:47 +10002567#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002568# include <paths.h>
2569#endif
2570 ],
2571 [ char *wtmpx = WTMPX_FILE; ],
2572 [ AC_MSG_RESULT(yes) ],
2573 [ AC_MSG_RESULT(no)
2574 system_wtmpx_path=no ]
2575)
2576if test -z "$conf_wtmpx_location"; then
2577 if test x"$system_wtmpx_path" = x"no" ; then
2578 AC_DEFINE(DISABLE_WTMPX)
2579 fi
2580else
2581 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2582fi
2583
Damien Miller4018c192000-04-30 09:30:44 +10002584
Damien Miller29ea30d2000-03-17 10:54:15 +11002585if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002586 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2587 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002588fi
2589
Tim Rice4cec93f2002-02-26 08:40:48 -08002590dnl remove pam and dl because they are in $LIBPAM
2591if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002592 LIBS=`echo $LIBS | sed 's/-lpam //'`
2593fi
2594if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2595 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002596fi
2597
Damien Millerbac2d8a2000-09-05 16:13:06 +11002598AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002599AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2600AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002601
Damien Miller7b22d652000-06-18 14:07:04 +10002602# Print summary of options
2603
Damien Miller7b22d652000-06-18 14:07:04 +10002604# Someone please show me a better way :)
2605A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2606B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2607C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2608D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002609E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002610F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002611G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002612H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2613I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2614J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002615
2616echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002617echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002618echo " User binaries: $B"
2619echo " System binaries: $C"
2620echo " Configuration files: $D"
2621echo " Askpass program: $E"
2622echo " Manual pages: $F"
2623echo " PID file: $G"
2624echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002625if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002626echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002627else
Damien Millerf58c6722002-05-13 13:15:42 +10002628echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002629fi
Damien Millera18bbd32002-05-13 10:48:57 +10002630if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002631echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002632fi
Damien Millerf58c6722002-05-13 13:15:42 +10002633echo " Manpage format: $MANTYPE"
Damien Miller9d2be482003-05-15 11:12:19 +10002634echo " DNS support: $DNS_MSG"
Damien Miller7abe09b2003-05-15 10:53:49 +10002635echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002636echo " KerberosIV support: $KRB4_MSG"
2637echo " KerberosV support: $KRB5_MSG"
2638echo " Smartcard support: $SCARD_MSG"
2639echo " AFS support: $AFS_MSG"
2640echo " S/KEY support: $SKEY_MSG"
2641echo " TCP Wrappers support: $TCPW_MSG"
2642echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002643echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002644echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2645echo " BSD Auth support: $BSD_AUTH_MSG"
2646echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002647if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002648echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002649fi
2650
Damien Miller7b22d652000-06-18 14:07:04 +10002651echo ""
2652
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002653echo " Host: ${host}"
2654echo " Compiler: ${CC}"
2655echo " Compiler flags: ${CFLAGS}"
2656echo "Preprocessor flags: ${CPPFLAGS}"
2657echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002658echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002659
2660echo ""
2661
Damien Miller82cf0ce2000-12-20 13:34:48 +11002662if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002663 echo "PAM is enabled. You may need to install a PAM control file "
2664 echo "for sshd, otherwise password authentication may fail. "
2665 echo "Example PAM control files can be found in the contrib/ "
2666 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002667 echo ""
2668fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002669
Damien Miller6c21c512002-01-22 21:57:53 +11002670if test ! -z "$RAND_HELPER_CMDHASH" ; then
2671 echo "WARNING: you are using the builtin random number collection "
2672 echo "service. Please read WARNING.RNG and request that your OS "
2673 echo "vendor includes kernel-based random number collection in "
2674 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002675 echo ""
2676fi
Damien Miller60396b02001-02-18 17:01:00 +11002677