blob: 7a24838fe2b9a15919f4ea2365b364169cc5e403 [file] [log] [blame]
Damien Miller4f9f42a2003-05-10 19:28:02 +10001# $Id: configure.ac,v 1.117 2003/05/10 09:28:02 djm 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 Millerec201962003-01-13 10:04:58 +110089 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
90 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
Damien Miller75b1d102000-01-07 14:01:41 +110091 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110092*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +110093 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -080094 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110095 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000096 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +110097 AC_DEFINE(DISABLE_SHADOW)
98 AC_DEFINE(IPV4_DEFAULT)
99 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000100 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000101 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700102 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000103 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100104 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000105*-*-dgux*)
106 AC_DEFINE(IP_TOS_IS_BROKEN)
107 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000108*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000109 AC_MSG_CHECKING(if we have working getaddrinfo)
110 AC_TRY_RUN([#include <mach-o/dyld.h>
111main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
112 exit(0);
113 else
114 exit(1);
115}], [AC_MSG_RESULT(working)],
116 [AC_MSG_RESULT(buggy)
117 AC_DEFINE(BROKEN_GETADDRINFO)],
118 [AC_MSG_RESULT(assume it is working)])
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000119 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000120*-*-hpux10.26)
121 if test -z "$GCC"; then
122 CFLAGS="$CFLAGS -Ae"
123 fi
124 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
125 IPADDR_IN_DISPLAY=yes
126 AC_DEFINE(HAVE_SECUREWARE)
127 AC_DEFINE(USE_PIPES)
128 AC_DEFINE(LOGIN_NO_ENDOPT)
129 AC_DEFINE(LOGIN_NEEDS_UTMPX)
130 AC_DEFINE(DISABLE_SHADOW)
131 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100132 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700133 LIBS="$LIBS -lsec -lsecpw"
134 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000135 disable_ptmx_check=yes
136 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100137*-*-hpux10*)
138 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000139 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100140 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000141 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100142 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000143 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000144 AC_DEFINE(LOGIN_NO_ENDOPT)
145 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100146 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100147 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100148 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700149 LIBS="$LIBS -lsec"
150 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100151 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000152*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000153 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100154 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100155 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100156 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000157 AC_DEFINE(LOGIN_NO_ENDOPT)
158 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100159 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100160 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100161 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700162 LIBS="$LIBS -lsec"
163 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000164 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100165*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000166 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000167 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100168 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000169 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000170 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller1808f382000-01-06 12:03:12 +1100171 ;;
172*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000173 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000174 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100175 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000176 AC_DEFINE(WITH_IRIX_ARRAY)
177 AC_DEFINE(WITH_IRIX_PROJECT)
178 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000179 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000180 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000181 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100182 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100183*-*-linux*)
184 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100185 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100186 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000187 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Millerec201962003-01-13 10:04:58 +1100188 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
189 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
Damien Miller7bcb0892000-03-11 20:45:40 +1100190 inet6_default_4in6=yes
Darren Tuckerc437cda2003-05-10 17:05:46 +1000191 # openpty can be in libutil, needed for controlling tty test
192 AC_SEARCH_LIBS(openpty, util)
193 # make sure that openpty does not reacquire controlling terminal
194 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
195 AC_TRY_RUN(
196 [
197#include <stdio.h>
198#include <sys/fcntl.h>
199#include <sys/types.h>
200#include <sys/wait.h>
201
202int
203main()
204{
205 pid_t pid;
206 int fd, ptyfd, ttyfd, status;
207
208 pid = fork();
209 if (pid < 0) { /* failed */
210 exit(1);
211 } else if (pid > 0) { /* parent */
212 waitpid(pid, &status, 0);
213 if (WIFEXITED(status))
214 exit(WEXITSTATUS(status));
215 else
216 exit(2);
217 } else { /* child */
218 close(0); close(1); close(2);
219 setsid();
220 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
221 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
222 if (fd >= 0)
223 exit(3); /* Acquired ctty: broken */
224 else
225 exit(0); /* Did not acquire ctty: OK */
226 }
227}
228 ],
229 [
230 AC_MSG_RESULT(yes)
231 ],
232 [
233 AC_MSG_RESULT(no)
234 AC_DEFINE(SSHD_ACQUIRES_CTTY)
235 ]
236 )
Darren Tucker3c016542003-05-02 20:48:21 +1000237 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000238 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000239 AC_DEFINE(BROKEN_CMSG_TYPE)
240 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000241 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100242 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000243mips-sony-bsd|mips-sony-newsos4)
244 AC_DEFINE(HAVE_NEWS4)
245 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000246 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100247*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000248 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100249 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100250 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100251*-*-freebsd*)
252 check_for_libcrypt_later=1
253 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000254*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000255 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100256 conf_utmp_location=/etc/utmp
257 conf_wtmp_location=/usr/adm/wtmp
258 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000259 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000260 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000261 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100262 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000263 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000264 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000265 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100266*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000267 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000268 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100269 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100270 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000271 AC_DEFINE(LOGIN_NEEDS_UTMPX)
272 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000273 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckerc437cda2003-05-10 17:05:46 +1000274 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
275 AC_DEFINE(SSHD_ACQUIRES_CTTY)
andre2ff7b5d2000-06-03 14:57:40 +0000276 # hardwire lastlog location (can't detect it on some versions)
277 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000278 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
279 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
280 if test "$sol2ver" -ge 8; then
281 AC_MSG_RESULT(yes)
282 AC_DEFINE(DISABLE_UTMP)
283 AC_DEFINE(DISABLE_WTMP)
284 else
285 AC_MSG_RESULT(no)
286 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100287 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000288*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000289 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000290 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100291 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000292 conf_utmp_location=/etc/utmp
293 conf_wtmp_location=/var/adm/wtmp
294 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000295 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000296 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000297*-ncr-sysv*)
298 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
299 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700300 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000301 AC_DEFINE(USE_PIPES)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000302 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000303*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000304 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700305 # /usr/ucblib MUST NOT be searched on ReliantUNIX
306 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100307 IPADDR_IN_DISPLAY=yes
308 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000309 AC_DEFINE(IP_TOS_IS_BROKEN)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700310 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
311 # Attention: always take care to bind libsocket and libnsl before libc,
312 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000313 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100314*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000315 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100316 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100317 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100318 ;;
319*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000320 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100321 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100322 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100323 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100324*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000325 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100326 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100327 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100328*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000329 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100330 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700331 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100332 RANLIB=true
333 no_dev_ptmx=1
334 AC_DEFINE(BROKEN_SYS_TERMIO_H)
335 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000336 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000337 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100338 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100339 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700340 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700341 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100342 ;;
343*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800344 if test -z "$GCC"; then
345 CFLAGS="$CFLAGS -belf"
346 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000347 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000348 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100349 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000350 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100351 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000352 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000353 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700354 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100355 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700356 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000357 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000358*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000359 AC_DEFINE(USE_PIPES)
360 AC_DEFINE(DISABLE_FD_PASSING)
361 LDFLAGS="$LDFLAGS"
362 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
363 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000364 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000365*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000366 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700367 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700368 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000369 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
370 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
371 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700372 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000373*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000374 AC_MSG_CHECKING(for Digital Unix SIA)
375 no_osfsia=""
376 AC_ARG_WITH(osfsia,
377 [ --with-osfsia Enable Digital Unix SIA],
378 [
379 if test "x$withval" = "xno" ; then
380 AC_MSG_RESULT(disabled)
381 no_osfsia=1
382 fi
383 ],
384 )
385 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000386 if test -f /etc/sia/matrix.conf; then
387 AC_MSG_RESULT(yes)
388 AC_DEFINE(HAVE_OSF_SIA)
389 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000390 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000391 LIBS="$LIBS -lsecurity -ldb -lm -laud"
392 else
393 AC_MSG_RESULT(no)
394 fi
395 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000396 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000397 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000398
399*-*-nto-qnx)
400 AC_DEFINE(USE_PIPES)
401 AC_DEFINE(NO_X11_UNIX_SOCKETS)
402 AC_DEFINE(MISSING_NFDBITS)
403 AC_DEFINE(MISSING_HOWMANY)
404 AC_DEFINE(MISSING_FD_MASK)
405 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100406esac
407
Damien Millere37bfc12000-06-05 09:37:43 +1000408# Allow user to specify flags
409AC_ARG_WITH(cflags,
410 [ --with-cflags Specify additional flags to pass to compiler],
411 [
412 if test "x$withval" != "xno" ; then
413 CFLAGS="$CFLAGS $withval"
414 fi
415 ]
416)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000417AC_ARG_WITH(cppflags,
418 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
419 [
420 if test "x$withval" != "xno"; then
421 CPPFLAGS="$CPPFLAGS $withval"
422 fi
423 ]
424)
Damien Millere37bfc12000-06-05 09:37:43 +1000425AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000426 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000427 [
428 if test "x$withval" != "xno" ; then
429 LDFLAGS="$LDFLAGS $withval"
430 fi
431 ]
432)
433AC_ARG_WITH(libs,
434 [ --with-libs Specify additional libraries to link with],
435 [
436 if test "x$withval" != "xno" ; then
437 LIBS="$LIBS $withval"
438 fi
439 ]
440)
441
Tim Rice4cec93f2002-02-26 08:40:48 -0800442# Checks for header files.
443AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Damien Millerb16f8742003-02-24 12:47:15 +1100444 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800445 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000446 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000447 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800448 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
Damien Millera8ed44b2003-01-10 09:53:12 +1100449 sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000450 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700451 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800452 util.h utime.h utmp.h utmpx.h)
453
Damien Millera22ba012000-03-02 23:09:20 +1100454# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700455AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
456AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000457
Damien Millerdf288022001-02-18 13:07:07 +1100458dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700459if test "x$with_tcp_wrappers" != "xno" ; then
460 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
461 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
462 fi
463fi
Damien Millerdf288022001-02-18 13:07:07 +1100464
Tim Rice13aae5e2001-10-21 17:53:58 -0700465AC_CHECK_FUNC(getspnam, ,
466 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700467
Damien Miller150c8b52002-02-13 23:06:56 +1100468AC_ARG_WITH(rpath,
469 [ --without-rpath Disable auto-added -R linker paths],
470 [
471 if test "x$withval" = "xno" ; then
472 need_dash_r=""
473 fi
474 if test "x$withval" = "xyes" ; then
475 need_dash_r=1
476 fi
477 ]
478)
479
Tim Rice13aae5e2001-10-21 17:53:58 -0700480dnl zlib is required
481AC_ARG_WITH(zlib,
482 [ --with-zlib=PATH Use zlib in PATH],
483 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000484 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100485 AC_MSG_ERROR([*** zlib is required ***])
486 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700487 if test -d "$withval/lib"; then
488 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700489 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700490 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700491 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700492 fi
493 else
494 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700495 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700496 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700497 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700498 fi
499 fi
500 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700501 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700502 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700503 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700504 fi
505 ]
506)
507
Tim Rice17b93e52001-10-23 22:36:54 -0700508AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100509
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000510dnl UnixWare 2.x
511AC_CHECK_FUNC(strcasecmp,
512 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
513)
514AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700515 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
516 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000517)
Damien Millerab18c411999-11-11 10:40:23 +1100518
Tim Ricee589a292001-11-03 11:09:32 -0800519dnl Checks for libutil functions
520AC_CHECK_HEADERS(libutil.h)
521AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
522AC_CHECK_FUNCS(logout updwtmp logwtmp)
523
Ben Lindstrom8697e082001-02-24 21:41:10 +0000524AC_FUNC_STRFTIME
525
Damien Miller3c027682001-03-14 11:39:45 +1100526# Check for ALTDIRFUNC glob() extension
527AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
528AC_EGREP_CPP(FOUNDIT,
529 [
530 #include <glob.h>
531 #ifdef GLOB_ALTDIRFUNC
532 FOUNDIT
533 #endif
534 ],
535 [
536 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
537 AC_MSG_RESULT(yes)
538 ],
539 [
540 AC_MSG_RESULT(no)
541 ]
542)
Damien Millerab18c411999-11-11 10:40:23 +1100543
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000544# Check for g.gl_matchc glob() extension
545AC_MSG_CHECKING(for gl_matchc field in glob_t)
546AC_EGREP_CPP(FOUNDIT,
547 [
548 #include <glob.h>
549 int main(void){glob_t g; g.gl_matchc = 1;}
550 ],
551 [
552 AC_DEFINE(GLOB_HAS_GL_MATCHC)
553 AC_MSG_RESULT(yes)
554 ],
555 [
556 AC_MSG_RESULT(no)
557 ]
558)
559
Damien Miller18bb4732001-03-28 14:35:30 +1000560AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
561AC_TRY_RUN(
562 [
563#include <sys/types.h>
564#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700565int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000566 ],
567 [AC_MSG_RESULT(yes)],
568 [
569 AC_MSG_RESULT(no)
570 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
571 ]
572)
573
Damien Millerc547bf12001-02-16 10:18:12 +1100574# Check whether user wants S/Key support
575SKEY_MSG="no"
576AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700577 [ --with-skey[[=PATH]] Enable S/Key support
578 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100579 [
580 if test "x$withval" != "xno" ; then
581
582 if test "x$withval" != "xyes" ; then
583 CPPFLAGS="$CPPFLAGS -I${withval}/include"
584 LDFLAGS="$LDFLAGS -L${withval}/lib"
585 fi
586
587 AC_DEFINE(SKEY)
588 LIBS="-lskey $LIBS"
589 SKEY_MSG="yes"
590
Tim Rice4cec93f2002-02-26 08:40:48 -0800591 AC_MSG_CHECKING([for s/key support])
592 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100593 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800594#include <stdio.h>
595#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700596int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800597 ],
598 [AC_MSG_RESULT(yes)],
599 [
600 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100601 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
602 ])
603 fi
604 ]
605)
606
607# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700608TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100609AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700610 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
611 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100612 [
613 if test "x$withval" != "xno" ; then
614 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700615 saved_LDFLAGS="$LDFLAGS"
616 saved_CPPFLAGS="$CPPFLAGS"
617 if test -n "${withval}" -a "${withval}" != "yes"; then
618 if test -d "${withval}/lib"; then
619 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700620 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700621 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700622 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700623 fi
624 else
625 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700626 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700627 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700628 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700629 fi
630 fi
631 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700632 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700633 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700634 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700635 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700636 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800637 LIBWRAP="-lwrap"
638 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100639 AC_MSG_CHECKING(for libwrap)
640 AC_TRY_LINK(
641 [
642#include <tcpd.h>
643 int deny_severity = 0, allow_severity = 0;
644 ],
645 [hosts_access(0);],
646 [
647 AC_MSG_RESULT(yes)
648 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800649 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700650 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100651 ],
652 [
653 AC_MSG_ERROR([*** libwrap missing])
654 ]
655 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800656 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100657 fi
658 ]
659)
660
Damien Millerfe1f1432003-02-24 15:45:42 +1100661dnl Checks for library functions. Please keep in alphabetical order
662AC_CHECK_FUNCS(\
663 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename bcopy \
664 bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
665 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
666 getpeereid _getpty getrlimit getrusage getttyent glob inet_aton \
667 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
668 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openpty pstat \
669 readpassphrase realpath recvmsg rresvport_af sendmsg setdtablesize \
670 setegid setenv seteuid setgroups setlogin setpcred setproctitle \
671 setresgid setreuid setrlimit setsid setvbuf sigaction sigvec \
672 snprintf socketpair strerror strlcat strlcpy strmode strnvis \
673 sysconf tcgetpgrp truncate utimes vhangup vsnprintf waitpid \
674)
Tim Rice13aae5e2001-10-21 17:53:58 -0700675
Damien Millercd6853c2003-01-28 11:33:42 +1100676AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
Damien Millereab4bae2003-04-29 23:22:40 +1000677AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
Damien Millercd6853c2003-01-28 11:33:42 +1100678
Ben Lindstrom3e006472002-10-16 00:24:03 +0000679dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
680AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
681
Tim Rice13aae5e2001-10-21 17:53:58 -0700682dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700683AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700684 AC_CHECK_LIB(gen, dirname,[
685 AC_CACHE_CHECK([for broken dirname],
686 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700687 save_LIBS="$LIBS"
688 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700689 AC_TRY_RUN(
690 [
691#include <libgen.h>
692#include <string.h>
693
694int main(int argc, char **argv) {
695 char *s, buf[32];
696
697 strncpy(buf,"/etc", 32);
698 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700699 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700700 exit(1);
701 } else {
702 exit(0);
703 }
704}
705 ],
706 [ ac_cv_have_broken_dirname="no" ],
707 [ ac_cv_have_broken_dirname="yes" ]
708 )
Tim Rice17b93e52001-10-23 22:36:54 -0700709 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700710 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700711 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700712 LIBS="$LIBS -lgen"
713 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700714 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700715 fi
716 ])
717])
718
Damien Millerad833b32000-08-23 10:46:23 +1000719dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000720AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000721dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000722AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000723AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000724dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000725AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000726AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100727
Damien Miller04f80141999-11-19 15:32:34 +1100728AC_CHECK_FUNC(daemon,
729 [AC_DEFINE(HAVE_DAEMON)],
730 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
731)
732
Damien Miller9fb07e42000-03-05 16:22:59 +1100733AC_CHECK_FUNC(getpagesize,
734 [AC_DEFINE(HAVE_GETPAGESIZE)],
735 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
736)
737
Damien Millercb170cb2000-07-01 16:52:55 +1000738# Check for broken snprintf
739if test "x$ac_cv_func_snprintf" = "xyes" ; then
740 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
741 AC_TRY_RUN(
742 [
743#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700744int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000745 ],
746 [AC_MSG_RESULT(yes)],
747 [
748 AC_MSG_RESULT(no)
749 AC_DEFINE(BROKEN_SNPRINTF)
750 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
751 ]
752 )
753fi
754
Damien Millere8328192003-01-07 15:18:32 +1100755dnl see whether mkstemp() requires XXXXXX
756if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
757AC_MSG_CHECKING([for (overly) strict mkstemp])
758AC_TRY_RUN(
759 [
760#include <stdlib.h>
761main() { char template[]="conftest.mkstemp-test";
762if (mkstemp(template) == -1)
763 exit(1);
764unlink(template); exit(0);
765}
766 ],
767 [
768 AC_MSG_RESULT(no)
769 ],
770 [
771 AC_MSG_RESULT(yes)
772 AC_DEFINE(HAVE_STRICT_MKSTEMP)
773 ],
774 [
775 AC_MSG_RESULT(yes)
776 AC_DEFINE(HAVE_STRICT_MKSTEMP)
777 ]
778)
779fi
780
Damien Miller606f8802000-09-16 15:39:56 +1100781AC_FUNC_GETPGRP
782
Damien Millera64b57a2001-01-17 10:44:13 +1100783# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000784PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100785AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100786 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100787 [
Damien Millera64b57a2001-01-17 10:44:13 +1100788 if test "x$withval" != "xno" ; then
789 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
790 AC_MSG_ERROR([PAM headers not found])
791 fi
792
793 AC_CHECK_LIB(dl, dlopen, , )
794 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
795 AC_CHECK_FUNCS(pam_getenvlist)
796
797 disable_shadow=yes
798 PAM_MSG="yes"
799
800 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800801 if test $ac_cv_lib_dl_dlopen = yes; then
802 LIBPAM="-lpam -ldl"
803 else
804 LIBPAM="-lpam"
805 fi
806 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100807 fi
808 ]
809)
Damien Millera22ba012000-03-02 23:09:20 +1100810
Damien Millera64b57a2001-01-17 10:44:13 +1100811# Check for older PAM
812if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100813 # Check PAM strerror arguments (old PAM)
814 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
815 AC_TRY_COMPILE(
816 [
Damien Miller81171112000-04-23 11:14:01 +1000817#include <stdlib.h>
818#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100819 ],
820 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
821 [AC_MSG_RESULT(no)],
822 [
823 AC_DEFINE(HAVE_OLD_PAM)
824 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000825 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100826 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100827 )
Damien Millera22ba012000-03-02 23:09:20 +1100828fi
829
Damien Millerfc93d4b2002-09-04 23:26:29 +1000830# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
831# because the system crypt() is more featureful.
832if test "x$check_for_libcrypt_before" = "x1"; then
833 AC_CHECK_LIB(crypt, crypt)
834fi
835
Tim Riceaef73712002-05-11 13:17:42 -0700836# Search for OpenSSL
837saved_CPPFLAGS="$CPPFLAGS"
838saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100839AC_ARG_WITH(ssl-dir,
840 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
841 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000842 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700843 if test -d "$withval/lib"; then
844 if test -n "${need_dash_r}"; then
845 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
846 else
847 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
848 fi
849 else
850 if test -n "${need_dash_r}"; then
851 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
852 else
853 LDFLAGS="-L${withval} ${LDFLAGS}"
854 fi
855 fi
856 if test -d "$withval/include"; then
857 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
858 else
859 CPPFLAGS="-I${withval} ${CPPFLAGS}"
860 fi
Damien Millera22ba012000-03-02 23:09:20 +1100861 fi
862 ]
863)
Tim Riceaef73712002-05-11 13:17:42 -0700864LIBS="$LIBS -lcrypto"
865AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000866 [
Tim Riceaef73712002-05-11 13:17:42 -0700867 dnl Check default openssl install dir
868 if test -n "${need_dash_r}"; then
869 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000870 else
Tim Riceaef73712002-05-11 13:17:42 -0700871 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000872 fi
Tim Riceaef73712002-05-11 13:17:42 -0700873 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
874 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
875 [
876 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
877 ]
878 )
879 ]
880)
881
Tim Riced730b782002-08-13 18:52:10 -0700882# Determine OpenSSL header version
883AC_MSG_CHECKING([OpenSSL header version])
884AC_TRY_RUN(
885 [
886#include <stdio.h>
887#include <string.h>
888#include <openssl/opensslv.h>
889#define DATA "conftest.sslincver"
890int main(void) {
891 FILE *fd;
892 int rc;
893
894 fd = fopen(DATA,"w");
895 if(fd == NULL)
896 exit(1);
897
898 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
899 exit(1);
900
901 exit(0);
902}
903 ],
904 [
905 ssl_header_ver=`cat conftest.sslincver`
906 AC_MSG_RESULT($ssl_header_ver)
907 ],
908 [
909 AC_MSG_RESULT(not found)
910 AC_MSG_ERROR(OpenSSL version header not found.)
911 ]
912)
913
914# Determine OpenSSL library version
915AC_MSG_CHECKING([OpenSSL library version])
916AC_TRY_RUN(
917 [
918#include <stdio.h>
919#include <string.h>
920#include <openssl/opensslv.h>
921#include <openssl/crypto.h>
922#define DATA "conftest.ssllibver"
923int main(void) {
924 FILE *fd;
925 int rc;
926
927 fd = fopen(DATA,"w");
928 if(fd == NULL)
929 exit(1);
930
931 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
932 exit(1);
933
934 exit(0);
935}
936 ],
937 [
938 ssl_library_ver=`cat conftest.ssllibver`
939 AC_MSG_RESULT($ssl_library_ver)
940 ],
941 [
942 AC_MSG_RESULT(not found)
943 AC_MSG_ERROR(OpenSSL library not found.)
944 ]
945)
Damien Millera22ba012000-03-02 23:09:20 +1100946
Damien Millerec932372002-01-22 22:16:03 +1100947# Sanity check OpenSSL headers
948AC_MSG_CHECKING([whether OpenSSL's headers match the library])
949AC_TRY_RUN(
950 [
951#include <string.h>
952#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700953int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100954 ],
955 [
956 AC_MSG_RESULT(yes)
957 ],
958 [
959 AC_MSG_RESULT(no)
960 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
961 ]
962)
963
Damien Millera64b57a2001-01-17 10:44:13 +1100964# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
965# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +1000966if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100967 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100968fi
969
Damien Miller6c21c512002-01-22 21:57:53 +1100970
971### Configure cryptographic random number support
972
973# Check wheter OpenSSL seeds itself
974AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
975AC_TRY_RUN(
976 [
977#include <string.h>
978#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700979int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +1100980 ],
981 [
982 OPENSSL_SEEDS_ITSELF=yes
983 AC_MSG_RESULT(yes)
984 ],
985 [
986 AC_MSG_RESULT(no)
987 # Default to use of the rand helper if OpenSSL doesn't
988 # seed itself
989 USE_RAND_HELPER=yes
990 ]
991)
992
993
994# Do we want to force the use of the rand helper?
995AC_ARG_WITH(rand-helper,
996 [ --with-rand-helper Use subprocess to gather strong randomness ],
997 [
998 if test "x$withval" = "xno" ; then
999 # Force use of OpenSSL's internal RNG, even if
1000 # the previous test showed it to be unseeded.
1001 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1002 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1003 OPENSSL_SEEDS_ITSELF=yes
1004 USE_RAND_HELPER=""
1005 fi
1006 else
1007 USE_RAND_HELPER=yes
1008 fi
1009 ],
1010)
1011
1012# Which randomness source do we use?
1013if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1014 # OpenSSL only
1015 AC_DEFINE(OPENSSL_PRNG_ONLY)
1016 RAND_MSG="OpenSSL internal ONLY"
1017 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001018elif test ! -z "$USE_RAND_HELPER" ; then
1019 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001020 RAND_MSG="ssh-rand-helper"
1021 INSTALL_SSH_RAND_HELPER="yes"
1022fi
1023AC_SUBST(INSTALL_SSH_RAND_HELPER)
1024
1025### Configuration of ssh-rand-helper
1026
1027# PRNGD TCP socket
1028AC_ARG_WITH(prngd-port,
1029 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1030 [
Damien Millere996d722002-01-23 11:20:59 +11001031 case "$withval" in
1032 no)
1033 withval=""
1034 ;;
1035 [[0-9]]*)
1036 ;;
1037 *)
1038 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1039 ;;
1040 esac
1041 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001042 PRNGD_PORT="$withval"
1043 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1044 fi
1045 ]
1046)
1047
1048# PRNGD Unix domain socket
1049AC_ARG_WITH(prngd-socket,
1050 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1051 [
Damien Millere996d722002-01-23 11:20:59 +11001052 case "$withval" in
1053 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001054 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001055 ;;
1056 no)
1057 withval=""
1058 ;;
1059 /*)
1060 ;;
1061 *)
1062 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1063 ;;
1064 esac
1065
1066 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001067 if test ! -z "$PRNGD_PORT" ; then
1068 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1069 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001070 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001071 AC_MSG_WARN(Entropy socket is not readable)
1072 fi
1073 PRNGD_SOCKET="$withval"
1074 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1075 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001076 ],
1077 [
1078 # Check for existing socket only if we don't have a random device already
1079 if test "$USE_RAND_HELPER" = yes ; then
1080 AC_MSG_CHECKING(for PRNGD/EGD socket)
1081 # Insert other locations here
1082 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1083 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1084 PRNGD_SOCKET="$sock"
1085 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1086 break;
1087 fi
1088 done
1089 if test ! -z "$PRNGD_SOCKET" ; then
1090 AC_MSG_RESULT($PRNGD_SOCKET)
1091 else
1092 AC_MSG_RESULT(not found)
1093 fi
1094 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001095 ]
1096)
1097
1098# Change default command timeout for hashing entropy source
1099entropy_timeout=200
1100AC_ARG_WITH(entropy-timeout,
1101 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1102 [
1103 if test "x$withval" != "xno" ; then
1104 entropy_timeout=$withval
1105 fi
1106 ]
1107)
Damien Miller6c21c512002-01-22 21:57:53 +11001108AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1109
Damien Millerd3f6ad22002-06-25 10:24:47 +10001110SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001111AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001112 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001113 [
1114 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001115 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001116 fi
1117 ]
1118)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001119AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1120AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001121
Tim Rice88f2ab52002-03-17 12:17:34 -08001122# We do this little dance with the search path to insure
1123# that programs that we select for use by installed programs
1124# (which may be run by the super-user) come from trusted
1125# locations before they come from the user's private area.
1126# This should help avoid accidentally configuring some
1127# random version of a program in someone's personal bin.
1128
1129OPATH=$PATH
1130PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001131test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001132test -d /sbin && PATH=$PATH:/sbin
1133test -d /usr/sbin && PATH=$PATH:/usr/sbin
1134PATH=$PATH:/etc:$OPATH
1135
Damien Miller6c21c512002-01-22 21:57:53 +11001136# These programs are used by the command hashing source to gather entropy
1137OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1138OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1139OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1140OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1141OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1142OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1143OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1144OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1145OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1146OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1147OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1148OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1149OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1150OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1151OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1152OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001153# restore PATH
1154PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001155
1156# Where does ssh-rand-helper get its randomness from?
1157INSTALL_SSH_PRNG_CMDS=""
1158if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1159 if test ! -z "$PRNGD_PORT" ; then
1160 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1161 elif test ! -z "$PRNGD_SOCKET" ; then
1162 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1163 else
1164 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1165 RAND_HELPER_CMDHASH=yes
1166 INSTALL_SSH_PRNG_CMDS="yes"
1167 fi
1168fi
1169AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1170
1171
Ben Lindstromb5628642000-10-18 00:02:25 +00001172# Cheap hack to ensure NEWS-OS libraries are arranged right.
1173if test ! -z "$SONY" ; then
1174 LIBS="$LIBS -liberty";
1175fi
1176
Damien Millera22ba012000-03-02 23:09:20 +11001177# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001178AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001179AC_CHECK_SIZEOF(short int, 2)
1180AC_CHECK_SIZEOF(int, 4)
1181AC_CHECK_SIZEOF(long int, 4)
1182AC_CHECK_SIZEOF(long long int, 8)
1183
Damien Millerfa2bb692002-04-23 23:22:25 +10001184# Sanity check long long for some platforms (AIX)
1185if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1186 ac_cv_sizeof_long_long_int=0
1187fi
1188
Damien Millera22ba012000-03-02 23:09:20 +11001189# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001190AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1191 AC_TRY_COMPILE(
1192 [ #include <sys/types.h> ],
1193 [ u_int a; a = 1;],
1194 [ ac_cv_have_u_int="yes" ],
1195 [ ac_cv_have_u_int="no" ]
1196 )
1197])
1198if test "x$ac_cv_have_u_int" = "xyes" ; then
1199 AC_DEFINE(HAVE_U_INT)
1200 have_u_int=1
1201fi
1202
Damien Miller61e50f12000-05-08 20:49:37 +10001203AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1204 AC_TRY_COMPILE(
1205 [ #include <sys/types.h> ],
1206 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1207 [ ac_cv_have_intxx_t="yes" ],
1208 [ ac_cv_have_intxx_t="no" ]
1209 )
1210])
1211if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1212 AC_DEFINE(HAVE_INTXX_T)
1213 have_intxx_t=1
1214fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001215
1216if (test -z "$have_intxx_t" && \
1217 test "x$ac_cv_header_stdint_h" = "xyes")
1218then
1219 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1220 AC_TRY_COMPILE(
1221 [ #include <stdint.h> ],
1222 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1223 [
1224 AC_DEFINE(HAVE_INTXX_T)
1225 AC_MSG_RESULT(yes)
1226 ],
1227 [ AC_MSG_RESULT(no) ]
1228 )
1229fi
1230
Damien Miller578783e2000-09-23 14:12:24 +11001231AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1232 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001233 [
1234#include <sys/types.h>
1235#ifdef HAVE_STDINT_H
1236# include <stdint.h>
1237#endif
1238#include <sys/socket.h>
1239#ifdef HAVE_SYS_BITYPES_H
1240# include <sys/bitypes.h>
1241#endif
1242 ],
Damien Miller578783e2000-09-23 14:12:24 +11001243 [ int64_t a; a = 1;],
1244 [ ac_cv_have_int64_t="yes" ],
1245 [ ac_cv_have_int64_t="no" ]
1246 )
1247])
1248if test "x$ac_cv_have_int64_t" = "xyes" ; then
1249 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001250fi
1251
Damien Miller61e50f12000-05-08 20:49:37 +10001252AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1253 AC_TRY_COMPILE(
1254 [ #include <sys/types.h> ],
1255 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1256 [ ac_cv_have_u_intxx_t="yes" ],
1257 [ ac_cv_have_u_intxx_t="no" ]
1258 )
1259])
1260if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1261 AC_DEFINE(HAVE_U_INTXX_T)
1262 have_u_intxx_t=1
1263fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001264
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001265if test -z "$have_u_intxx_t" ; then
1266 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1267 AC_TRY_COMPILE(
1268 [ #include <sys/socket.h> ],
1269 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1270 [
1271 AC_DEFINE(HAVE_U_INTXX_T)
1272 AC_MSG_RESULT(yes)
1273 ],
1274 [ AC_MSG_RESULT(no) ]
1275 )
1276fi
1277
Damien Miller578783e2000-09-23 14:12:24 +11001278AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1279 AC_TRY_COMPILE(
1280 [ #include <sys/types.h> ],
1281 [ u_int64_t a; a = 1;],
1282 [ ac_cv_have_u_int64_t="yes" ],
1283 [ ac_cv_have_u_int64_t="no" ]
1284 )
1285])
1286if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1287 AC_DEFINE(HAVE_U_INT64_T)
1288 have_u_int64_t=1
1289fi
1290
Tim Rice4cec93f2002-02-26 08:40:48 -08001291if test -z "$have_u_int64_t" ; then
1292 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1293 AC_TRY_COMPILE(
1294 [ #include <sys/bitypes.h> ],
1295 [ u_int64_t a; a = 1],
1296 [
1297 AC_DEFINE(HAVE_U_INT64_T)
1298 AC_MSG_RESULT(yes)
1299 ],
1300 [ AC_MSG_RESULT(no) ]
1301 )
1302fi
1303
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001304if test -z "$have_u_intxx_t" ; then
1305 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1306 AC_TRY_COMPILE(
1307 [
1308#include <sys/types.h>
1309 ],
1310 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1311 [ ac_cv_have_uintxx_t="yes" ],
1312 [ ac_cv_have_uintxx_t="no" ]
1313 )
1314 ])
1315 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1316 AC_DEFINE(HAVE_UINTXX_T)
1317 fi
1318fi
1319
1320if test -z "$have_uintxx_t" ; then
1321 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1322 AC_TRY_COMPILE(
1323 [ #include <stdint.h> ],
1324 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1325 [
1326 AC_DEFINE(HAVE_UINTXX_T)
1327 AC_MSG_RESULT(yes)
1328 ],
1329 [ AC_MSG_RESULT(no) ]
1330 )
1331fi
1332
Damien Milleredb82922000-06-20 13:25:52 +10001333if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1334 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001335then
1336 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1337 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001338 [
1339#include <sys/bitypes.h>
1340 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001341 [
Damien Miller70494d12000-04-03 15:57:06 +10001342 int8_t a; int16_t b; int32_t c;
1343 u_int8_t e; u_int16_t f; u_int32_t g;
1344 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001345 ],
1346 [
1347 AC_DEFINE(HAVE_U_INTXX_T)
1348 AC_DEFINE(HAVE_INTXX_T)
1349 AC_MSG_RESULT(yes)
1350 ],
1351 [AC_MSG_RESULT(no)]
1352 )
1353fi
1354
Damien Miller58be7382001-09-15 21:31:54 +10001355
1356AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1357 AC_TRY_COMPILE(
1358 [
1359#include <sys/types.h>
1360 ],
1361 [ u_char foo; foo = 125; ],
1362 [ ac_cv_have_u_char="yes" ],
1363 [ ac_cv_have_u_char="no" ]
1364 )
1365])
1366if test "x$ac_cv_have_u_char" = "xyes" ; then
1367 AC_DEFINE(HAVE_U_CHAR)
1368fi
1369
Tim Rice13aae5e2001-10-21 17:53:58 -07001370TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001371
Tim Rice200a5c02002-02-26 22:12:34 -08001372AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001373
Damien Miller61e50f12000-05-08 20:49:37 +10001374AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1375 AC_TRY_COMPILE(
1376 [
1377#include <sys/types.h>
1378 ],
1379 [ size_t foo; foo = 1235; ],
1380 [ ac_cv_have_size_t="yes" ],
1381 [ ac_cv_have_size_t="no" ]
1382 )
1383])
1384if test "x$ac_cv_have_size_t" = "xyes" ; then
1385 AC_DEFINE(HAVE_SIZE_T)
1386fi
Damien Miller95058511999-12-29 10:36:45 +11001387
Damien Miller615f9392000-05-17 22:53:33 +10001388AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1389 AC_TRY_COMPILE(
1390 [
1391#include <sys/types.h>
1392 ],
1393 [ ssize_t foo; foo = 1235; ],
1394 [ ac_cv_have_ssize_t="yes" ],
1395 [ ac_cv_have_ssize_t="no" ]
1396 )
1397])
1398if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1399 AC_DEFINE(HAVE_SSIZE_T)
1400fi
1401
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001402AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1403 AC_TRY_COMPILE(
1404 [
1405#include <time.h>
1406 ],
1407 [ clock_t foo; foo = 1235; ],
1408 [ ac_cv_have_clock_t="yes" ],
1409 [ ac_cv_have_clock_t="no" ]
1410 )
1411])
1412if test "x$ac_cv_have_clock_t" = "xyes" ; then
1413 AC_DEFINE(HAVE_CLOCK_T)
1414fi
1415
Damien Millerb54b40e2000-06-23 08:23:34 +10001416AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1417 AC_TRY_COMPILE(
1418 [
1419#include <sys/types.h>
1420#include <sys/socket.h>
1421 ],
1422 [ sa_family_t foo; foo = 1235; ],
1423 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001424 [ AC_TRY_COMPILE(
1425 [
1426#include <sys/types.h>
1427#include <sys/socket.h>
1428#include <netinet/in.h>
1429 ],
1430 [ sa_family_t foo; foo = 1235; ],
1431 [ ac_cv_have_sa_family_t="yes" ],
1432
Damien Millerb54b40e2000-06-23 08:23:34 +10001433 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001434 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001435 )
1436])
1437if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1438 AC_DEFINE(HAVE_SA_FAMILY_T)
1439fi
1440
Damien Miller0f91b4e2000-06-18 15:43:25 +10001441AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1442 AC_TRY_COMPILE(
1443 [
1444#include <sys/types.h>
1445 ],
1446 [ pid_t foo; foo = 1235; ],
1447 [ ac_cv_have_pid_t="yes" ],
1448 [ ac_cv_have_pid_t="no" ]
1449 )
1450])
1451if test "x$ac_cv_have_pid_t" = "xyes" ; then
1452 AC_DEFINE(HAVE_PID_T)
1453fi
1454
1455AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1456 AC_TRY_COMPILE(
1457 [
1458#include <sys/types.h>
1459 ],
1460 [ mode_t foo; foo = 1235; ],
1461 [ ac_cv_have_mode_t="yes" ],
1462 [ ac_cv_have_mode_t="no" ]
1463 )
1464])
1465if test "x$ac_cv_have_mode_t" = "xyes" ; then
1466 AC_DEFINE(HAVE_MODE_T)
1467fi
1468
Damien Miller61e50f12000-05-08 20:49:37 +10001469
1470AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1471 AC_TRY_COMPILE(
1472 [
Damien Miller81171112000-04-23 11:14:01 +10001473#include <sys/types.h>
1474#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001475 ],
1476 [ struct sockaddr_storage s; ],
1477 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1478 [ ac_cv_have_struct_sockaddr_storage="no" ]
1479 )
1480])
1481if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1482 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1483fi
Damien Miller34132e52000-01-14 15:45:46 +11001484
Damien Miller61e50f12000-05-08 20:49:37 +10001485AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1486 AC_TRY_COMPILE(
1487 [
Damien Miller7b22d652000-06-18 14:07:04 +10001488#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001489#include <netinet/in.h>
1490 ],
1491 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1492 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1493 [ ac_cv_have_struct_sockaddr_in6="no" ]
1494 )
1495])
1496if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1497 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1498fi
Damien Miller34132e52000-01-14 15:45:46 +11001499
Damien Miller61e50f12000-05-08 20:49:37 +10001500AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
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 in6_addr s; s.s6_addr[0] = 0; ],
1507 [ ac_cv_have_struct_in6_addr="yes" ],
1508 [ ac_cv_have_struct_in6_addr="no" ]
1509 )
1510])
1511if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1512 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1513fi
Damien Miller34132e52000-01-14 15:45:46 +11001514
Damien Miller61e50f12000-05-08 20:49:37 +10001515AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1516 AC_TRY_COMPILE(
1517 [
Damien Miller81171112000-04-23 11:14:01 +10001518#include <sys/types.h>
1519#include <sys/socket.h>
1520#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001521 ],
1522 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1523 [ ac_cv_have_struct_addrinfo="yes" ],
1524 [ ac_cv_have_struct_addrinfo="no" ]
1525 )
1526])
1527if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1528 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1529fi
1530
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001531AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1532 AC_TRY_COMPILE(
1533 [ #include <sys/time.h> ],
1534 [ struct timeval tv; tv.tv_sec = 1;],
1535 [ ac_cv_have_struct_timeval="yes" ],
1536 [ ac_cv_have_struct_timeval="no" ]
1537 )
1538])
1539if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1540 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1541 have_struct_timeval=1
1542fi
1543
Tim Rice4e4dc562003-03-18 10:21:40 -08001544AC_CHECK_TYPES(struct timespec)
1545
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001546# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001547if test "x$ac_cv_have_int64_t" = "xno" -a \
1548 "x$ac_cv_sizeof_long_int" != "x8" -a \
1549 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001550 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1551 echo "an alternative compiler (I.E., GCC) before continuing."
1552 echo ""
1553 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001554else
1555dnl test snprintf (broken on SCO w/gcc)
1556 AC_TRY_RUN(
1557 [
1558#include <stdio.h>
1559#include <string.h>
1560#ifdef HAVE_SNPRINTF
1561main()
1562{
1563 char buf[50];
1564 char expected_out[50];
1565 int mazsize = 50 ;
1566#if (SIZEOF_LONG_INT == 8)
1567 long int num = 0x7fffffffffffffff;
1568#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001569 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001570#endif
1571 strcpy(expected_out, "9223372036854775807");
1572 snprintf(buf, mazsize, "%lld", num);
1573 if(strcmp(buf, expected_out) != 0)
1574 exit(1);
1575 exit(0);
1576}
1577#else
1578main() { exit(0); }
1579#endif
1580 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1581 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001582fi
1583
Damien Miller78315eb2000-09-29 23:01:36 +11001584dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001585OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1586OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1587OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1588OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1589OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001590OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001591OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1592OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001593OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001594OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1595OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1596OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1597OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001598OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1599OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1600OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1601OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001602
1603AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001604
Damien Miller61e50f12000-05-08 20:49:37 +10001605AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1606 ac_cv_have_ss_family_in_struct_ss, [
1607 AC_TRY_COMPILE(
1608 [
Damien Miller81171112000-04-23 11:14:01 +10001609#include <sys/types.h>
1610#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001611 ],
1612 [ struct sockaddr_storage s; s.ss_family = 1; ],
1613 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1614 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1615 )
1616])
1617if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1618 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1619fi
1620
Damien Miller61e50f12000-05-08 20:49:37 +10001621AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1622 ac_cv_have___ss_family_in_struct_ss, [
1623 AC_TRY_COMPILE(
1624 [
Damien Miller81171112000-04-23 11:14:01 +10001625#include <sys/types.h>
1626#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001627 ],
1628 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1629 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1630 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1631 )
1632])
1633if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1634 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1635fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001636
Damien Millerad833b32000-08-23 10:46:23 +10001637AC_CACHE_CHECK([for pw_class field in struct passwd],
1638 ac_cv_have_pw_class_in_struct_passwd, [
1639 AC_TRY_COMPILE(
1640 [
Damien Millerad833b32000-08-23 10:46:23 +10001641#include <pwd.h>
1642 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001643 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001644 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1645 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1646 )
1647])
1648if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1649 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1650fi
1651
Kevin Steves82456952001-06-22 21:14:18 +00001652AC_CACHE_CHECK([for pw_expire field in struct passwd],
1653 ac_cv_have_pw_expire_in_struct_passwd, [
1654 AC_TRY_COMPILE(
1655 [
1656#include <pwd.h>
1657 ],
1658 [ struct passwd p; p.pw_expire = 0; ],
1659 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1660 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1661 )
1662])
1663if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1664 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1665fi
1666
1667AC_CACHE_CHECK([for pw_change field in struct passwd],
1668 ac_cv_have_pw_change_in_struct_passwd, [
1669 AC_TRY_COMPILE(
1670 [
1671#include <pwd.h>
1672 ],
1673 [ struct passwd p; p.pw_change = 0; ],
1674 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1675 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1676 )
1677])
1678if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1679 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1680fi
Damien Miller61e50f12000-05-08 20:49:37 +10001681
Tim Rice28bbb0c2002-05-27 17:37:32 -07001682dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001683AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1684 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001685 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001686 [
Tim Riceae49fe62002-04-12 10:26:21 -07001687#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001688#include <sys/socket.h>
1689#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001690int main() {
1691#ifdef msg_accrights
1692exit(1);
1693#endif
1694struct msghdr m;
1695m.msg_accrights = 0;
1696exit(0);
1697}
Kevin Steves939c9db2002-03-22 17:23:25 +00001698 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001699 [ ac_cv_have_accrights_in_msghdr="yes" ],
1700 [ ac_cv_have_accrights_in_msghdr="no" ]
1701 )
1702])
1703if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1704 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1705fi
1706
Kevin Stevesa44e0352002-04-07 16:18:03 +00001707AC_CACHE_CHECK([for msg_control field in struct msghdr],
1708 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001709 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001710 [
Tim Riceae49fe62002-04-12 10:26:21 -07001711#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001712#include <sys/socket.h>
1713#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001714int main() {
1715#ifdef msg_control
1716exit(1);
1717#endif
1718struct msghdr m;
1719m.msg_control = 0;
1720exit(0);
1721}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001722 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001723 [ ac_cv_have_control_in_msghdr="yes" ],
1724 [ ac_cv_have_control_in_msghdr="no" ]
1725 )
1726])
1727if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1728 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1729fi
1730
Damien Miller61e50f12000-05-08 20:49:37 +10001731AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1732 AC_TRY_LINK([],
1733 [ extern char *__progname; printf("%s", __progname); ],
1734 [ ac_cv_libc_defines___progname="yes" ],
1735 [ ac_cv_libc_defines___progname="no" ]
1736 )
1737])
1738if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1739 AC_DEFINE(HAVE___PROGNAME)
1740fi
1741
Kevin Steves4846f4a2002-03-22 18:19:53 +00001742AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1743 AC_TRY_LINK([
1744#include <stdio.h>
1745],
1746 [ printf("%s", __FUNCTION__); ],
1747 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1748 [ ac_cv_cc_implements___FUNCTION__="no" ]
1749 )
1750])
1751if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1752 AC_DEFINE(HAVE___FUNCTION__)
1753fi
1754
1755AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1756 AC_TRY_LINK([
1757#include <stdio.h>
1758],
1759 [ printf("%s", __func__); ],
1760 [ ac_cv_cc_implements___func__="yes" ],
1761 [ ac_cv_cc_implements___func__="no" ]
1762 )
1763])
1764if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1765 AC_DEFINE(HAVE___func__)
1766fi
1767
Damien Miller4f8e6692001-07-14 13:22:53 +10001768AC_CACHE_CHECK([whether getopt has optreset support],
1769 ac_cv_have_getopt_optreset, [
1770 AC_TRY_LINK(
1771 [
1772#include <getopt.h>
1773 ],
1774 [ extern int optreset; optreset = 0; ],
1775 [ ac_cv_have_getopt_optreset="yes" ],
1776 [ ac_cv_have_getopt_optreset="no" ]
1777 )
1778])
1779if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1780 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1781fi
Damien Millera22ba012000-03-02 23:09:20 +11001782
Damien Millerecbb26d2000-07-15 14:59:14 +10001783AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1784 AC_TRY_LINK([],
1785 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1786 [ ac_cv_libc_defines_sys_errlist="yes" ],
1787 [ ac_cv_libc_defines_sys_errlist="no" ]
1788 )
1789])
1790if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1791 AC_DEFINE(HAVE_SYS_ERRLIST)
1792fi
1793
1794
Damien Miller11fa2cc2000-08-16 10:35:58 +10001795AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1796 AC_TRY_LINK([],
1797 [ extern int sys_nerr; printf("%i", sys_nerr);],
1798 [ ac_cv_libc_defines_sys_nerr="yes" ],
1799 [ ac_cv_libc_defines_sys_nerr="no" ]
1800 )
1801])
1802if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1803 AC_DEFINE(HAVE_SYS_NERR)
1804fi
1805
Damien Miller85de5802001-09-18 14:01:11 +10001806SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001807
1808# Check whether user wants sectok support
1809AC_ARG_WITH(sectok,
1810 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001811 [
1812 if test "x$withval" != "xno" ; then
1813 if test "x$withval" != "xyes" ; then
1814 CPPFLAGS="$CPPFLAGS -I${withval}"
1815 LDFLAGS="$LDFLAGS -L${withval}"
1816 if test ! -z "$need_dash_r" ; then
1817 LDFLAGS="$LDFLAGS -R${withval}"
1818 fi
1819 if test ! -z "$blibpath" ; then
1820 blibpath="$blibpath:${withval}"
1821 fi
1822 fi
1823 AC_CHECK_HEADERS(sectok.h)
1824 if test "$ac_cv_header_sectok_h" != yes; then
1825 AC_MSG_ERROR(Can't find sectok.h)
1826 fi
1827 AC_CHECK_LIB(sectok, sectok_open)
1828 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1829 AC_MSG_ERROR(Can't find libsectok)
1830 fi
1831 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001832 AC_DEFINE(USE_SECTOK)
1833 SCARD_MSG="yes, using sectok"
1834 fi
1835 ]
1836)
1837
1838# Check whether user wants OpenSC support
1839AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001840 AC_HELP_STRING([--with-opensc=PFX],
1841 [Enable smartcard support using OpenSC]),
1842 opensc_config_prefix="$withval", opensc_config_prefix="")
1843if test x$opensc_config_prefix != x ; then
1844 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1845 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1846 if test "$OPENSC_CONFIG" != "no"; then
1847 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1848 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1849 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1850 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1851 AC_DEFINE(SMARTCARD)
1852 AC_DEFINE(USE_OPENSC)
1853 SCARD_MSG="yes, using OpenSC"
1854 fi
1855fi
Damien Miller85de5802001-09-18 14:01:11 +10001856
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001857# Check whether user wants Kerberos 5 support
1858KRB5_MSG="no"
1859AC_ARG_WITH(kerberos5,
1860 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1861 [
1862 if test "x$withval" != "xno" ; then
1863 if test "x$withval" = "xyes" ; then
1864 KRB5ROOT="/usr/local"
1865 else
1866 KRB5ROOT=${withval}
1867 fi
1868 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1869 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1870 AC_DEFINE(KRB5)
1871 KRB5_MSG="yes"
1872 AC_MSG_CHECKING(whether we are using Heimdal)
1873 AC_TRY_COMPILE([ #include <krb5.h> ],
1874 [ char *tmp = heimdal_version; ],
1875 [ AC_MSG_RESULT(yes)
1876 AC_DEFINE(HEIMDAL)
1877 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1878 ],
1879 [ AC_MSG_RESULT(no)
1880 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1881 ]
1882 )
1883 if test ! -z "$need_dash_r" ; then
1884 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1885 fi
1886 if test ! -z "$blibpath" ; then
1887 blibpath="$blibpath:${KRB5ROOT}/lib"
1888 fi
1889 AC_CHECK_LIB(resolv, dn_expand, , )
1890
1891 KRB5=yes
1892 fi
1893 ]
1894)
1895# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001896KRB4_MSG="no"
1897AC_ARG_WITH(kerberos4,
1898 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1899 [
1900 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001901 if test "x$withval" != "xyes" ; then
1902 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1903 LDFLAGS="$LDFLAGS -L${withval}/lib"
1904 if test ! -z "$need_dash_r" ; then
1905 LDFLAGS="$LDFLAGS -R${withval}/lib"
1906 fi
1907 if test ! -z "$blibpath" ; then
1908 blibpath="$blibpath:${withval}/lib"
1909 fi
1910 else
1911 if test -d /usr/include/kerberosIV ; then
1912 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1913 fi
1914 fi
1915
1916 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001917 if test "$ac_cv_header_krb_h" != yes; then
1918 AC_MSG_WARN([Cannot find krb.h, build may fail])
1919 fi
Damien Miller98344742001-03-28 14:37:06 +10001920 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001921 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001922 AC_CHECK_LIB(krb4, main)
1923 if test "$ac_cv_lib_krb4_main" != yes; then
1924 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1925 else
1926 KLIBS="-lkrb4"
1927 fi
1928 else
1929 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001930 fi
Damien Miller98344742001-03-28 14:37:06 +10001931 AC_CHECK_LIB(des, des_cbc_encrypt)
1932 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1933 AC_CHECK_LIB(des425, des_cbc_encrypt)
1934 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1935 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1936 else
1937 KLIBS="-ldes425"
1938 fi
1939 else
1940 KLIBS="-ldes"
1941 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001942 AC_CHECK_LIB(resolv, dn_expand, , )
1943 KRB4=yes
1944 KRB4_MSG="yes"
1945 AC_DEFINE(KRB4)
1946 fi
1947 ]
1948)
1949
1950# Check whether user wants AFS support
1951AFS_MSG="no"
1952AC_ARG_WITH(afs,
1953 [ --with-afs=PATH Enable AFS support],
1954 [
1955 if test "x$withval" != "xno" ; then
1956
1957 if test "x$withval" != "xyes" ; then
1958 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1959 LDFLAGS="$LDFLAGS -L${withval}/lib"
1960 fi
1961
1962 if test -z "$KRB4" ; then
1963 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1964 fi
1965
1966 LIBS="-lkafs $LIBS"
1967 if test ! -z "$AFS_LIBS" ; then
1968 LIBS="$LIBS $AFS_LIBS"
1969 fi
1970 AC_DEFINE(AFS)
1971 AFS_MSG="yes"
1972 fi
1973 ]
1974)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001975LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001976
Damien Millera22ba012000-03-02 23:09:20 +11001977# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001978
Damien Millerf58c6722002-05-13 13:15:42 +10001979PRIVSEP_PATH=/var/empty
1980AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001981 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001982 [
1983 if test "x$withval" != "$no" ; then
1984 PRIVSEP_PATH=$withval
1985 fi
1986 ]
1987)
1988AC_SUBST(PRIVSEP_PATH)
1989
Damien Millera22ba012000-03-02 23:09:20 +11001990AC_ARG_WITH(xauth,
1991 [ --with-xauth=PATH Specify path to xauth program ],
1992 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001993 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001994 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001995 fi
1996 ],
1997 [
Tim Ricee22be3b2002-07-17 19:20:07 -07001998 TestPath="$PATH"
1999 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2000 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2001 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2002 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2003 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002004 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002005 xauth_path="/usr/openwin/bin/xauth"
2006 fi
2007 ]
2008)
2009
Damien Miller7d901272003-01-13 16:55:22 +11002010STRIP_OPT=-s
2011AC_ARG_ENABLE(strip,
2012 [ --disable-strip Disable calling strip(1) on install],
2013 [
2014 if test "x$enableval" = "xno" ; then
2015 STRIP_OPT=
2016 fi
2017 ]
2018)
2019AC_SUBST(STRIP_OPT)
2020
Damien Millera19cf472000-11-29 13:28:50 +11002021if test -z "$xauth_path" ; then
2022 XAUTH_PATH="undefined"
2023 AC_SUBST(XAUTH_PATH)
2024else
Damien Millera22ba012000-03-02 23:09:20 +11002025 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002026 XAUTH_PATH=$xauth_path
2027 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002028fi
Damien Millera22ba012000-03-02 23:09:20 +11002029
2030# Check for mail directory (last resort if we cannot get it from headers)
2031if test ! -z "$MAIL" ; then
2032 maildir=`dirname $MAIL`
2033 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2034fi
2035
Damien Millera22ba012000-03-02 23:09:20 +11002036if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002037 if test "x$disable_ptmx_check" != "xyes" ; then
2038 AC_CHECK_FILE("/dev/ptmx",
2039 [
2040 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2041 have_dev_ptmx=1
2042 ]
2043 )
2044 fi
Damien Millera22ba012000-03-02 23:09:20 +11002045fi
Damien Miller204ad072000-03-02 23:56:12 +11002046AC_CHECK_FILE("/dev/ptc",
2047 [
2048 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2049 have_dev_ptc=1
2050 ]
2051)
2052
Damien Millera22ba012000-03-02 23:09:20 +11002053# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002054AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002055 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002056 [
Damien Miller897741e2001-04-16 10:41:46 +10002057 case "$withval" in
2058 man|cat|doc)
2059 MANTYPE=$withval
2060 ;;
2061 *)
2062 AC_MSG_ERROR(invalid man type: $withval)
2063 ;;
2064 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002065 ]
2066)
Ben Lindstrombc709922001-04-18 18:04:21 +00002067if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002068 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2069 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002070 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2071 MANTYPE=doc
2072 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2073 MANTYPE=man
2074 else
2075 MANTYPE=cat
2076 fi
2077fi
Damien Miller670a4b82000-01-22 13:53:11 +11002078AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002079if test "$MANTYPE" = "doc"; then
2080 mansubdir=man;
2081else
2082 mansubdir=$MANTYPE;
2083fi
2084AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002085
Damien Millera22ba012000-03-02 23:09:20 +11002086# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002087MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002088AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002089 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002090 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002091 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002092 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002093 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002094 fi
2095 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002096)
2097
Damien Millera22ba012000-03-02 23:09:20 +11002098# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002099AC_ARG_WITH(shadow,
2100 [ --without-shadow Disable shadow password support],
2101 [
2102 if test "x$withval" = "xno" ; then
2103 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002104 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002105 fi
2106 ]
2107)
2108
Damien Miller1f335fb2000-06-26 11:31:33 +10002109if test -z "$disable_shadow" ; then
2110 AC_MSG_CHECKING([if the systems has expire shadow information])
2111 AC_TRY_COMPILE(
2112 [
2113#include <sys/types.h>
2114#include <shadow.h>
2115 struct spwd sp;
2116 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2117 [ sp_expire_available=yes ], []
2118 )
2119
2120 if test "x$sp_expire_available" = "xyes" ; then
2121 AC_MSG_RESULT(yes)
2122 AC_DEFINE(HAS_SHADOW_EXPIRE)
2123 else
2124 AC_MSG_RESULT(no)
2125 fi
2126fi
2127
Damien Millera22ba012000-03-02 23:09:20 +11002128# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002129if test ! -z "$IPADDR_IN_DISPLAY" ; then
2130 DISPLAY_HACK_MSG="yes"
2131 AC_DEFINE(IPADDR_IN_DISPLAY)
2132else
2133 DISPLAY_HACK_MSG="no"
2134 AC_ARG_WITH(ipaddr-display,
2135 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2136 [
2137 if test "x$withval" != "xno" ; then
2138 AC_DEFINE(IPADDR_IN_DISPLAY)
2139 DISPLAY_HACK_MSG="yes"
2140 fi
2141 ]
2142 )
2143fi
Damien Miller76112de1999-12-21 11:18:08 +11002144
Tim Rice43a1c132002-04-17 21:19:14 -07002145dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2146if test $ac_cv_func_login_getcapbool = "yes" -a \
2147 $ac_cv_header_login_cap_h = "yes" ; then
2148 USES_LOGIN_CONF=yes
2149fi
Damien Millera22ba012000-03-02 23:09:20 +11002150# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002151SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002152AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002153 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002154 [
Tim Rice43a1c132002-04-17 21:19:14 -07002155 if test "$USES_LOGIN_CONF" = "yes" ; then
2156 AC_MSG_WARN([
2157--with-default-path=PATH has no effect on this system.
2158Edit /etc/login.conf instead.])
2159 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002160 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002161 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002162 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002163 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002164 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2165 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2166 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002167 AC_TRY_RUN(
2168 [
2169/* find out what STDPATH is */
2170#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002171#ifdef HAVE_PATHS_H
2172# include <paths.h>
2173#endif
2174#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002175# ifdef _PATH_USERPATH /* Irix */
2176# define _PATH_STDPATH _PATH_USERPATH
2177# else
2178# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2179# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002180#endif
2181#include <sys/types.h>
2182#include <sys/stat.h>
2183#include <fcntl.h>
2184#define DATA "conftest.stdpath"
2185
2186main()
2187{
2188 FILE *fd;
2189 int rc;
2190
2191 fd = fopen(DATA,"w");
2192 if(fd == NULL)
2193 exit(1);
2194
2195 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2196 exit(1);
2197
2198 exit(0);
2199}
2200 ], [ user_path=`cat conftest.stdpath` ],
2201 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2202 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2203 )
2204# make sure $bindir is in USER_PATH so scp will work
2205 t_bindir=`eval echo ${bindir}`
2206 case $t_bindir in
2207 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2208 esac
2209 case $t_bindir in
2210 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2211 esac
2212 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2213 if test $? -ne 0 ; then
2214 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2215 if test $? -ne 0 ; then
2216 user_path=$user_path:$t_bindir
2217 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2218 fi
2219 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002220 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002221)
Tim Rice43a1c132002-04-17 21:19:14 -07002222if test "$USES_LOGIN_CONF" != "yes" ; then
2223 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2224 AC_SUBST(user_path)
2225fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002226
Damien Millera18bbd32002-05-13 10:48:57 +10002227# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002228AC_ARG_WITH(superuser-path,
2229 [ --with-superuser-path= Specify different path for super-user],
2230 [
2231 if test "x$withval" != "xno" ; then
2232 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2233 superuser_path=$withval
2234 fi
2235 ]
2236)
2237
2238
Damien Millera22ba012000-03-02 23:09:20 +11002239# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10002240IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11002241AC_ARG_WITH(ipv4-default,
2242 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2243 [
2244 if test "x$withval" != "xno" ; then
2245 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10002246 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11002247 fi
2248 ]
2249)
2250
Damien Miller61e50f12000-05-08 20:49:37 +10002251AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002252IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002253AC_ARG_WITH(4in6,
2254 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2255 [
2256 if test "x$withval" != "xno" ; then
2257 AC_MSG_RESULT(yes)
2258 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002259 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002260 else
2261 AC_MSG_RESULT(no)
2262 fi
2263 ],[
2264 if test "x$inet6_default_4in6" = "xyes"; then
2265 AC_MSG_RESULT([yes (default)])
2266 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002267 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002268 else
2269 AC_MSG_RESULT([no (default)])
2270 fi
2271 ]
2272)
2273
Damien Miller60396b02001-02-18 17:01:00 +11002274# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002275BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002276AC_ARG_WITH(bsd-auth,
2277 [ --with-bsd-auth Enable BSD auth support],
2278 [
2279 if test "x$withval" != "xno" ; then
2280 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002281 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002282 fi
2283 ]
2284)
2285
Damien Millera22ba012000-03-02 23:09:20 +11002286# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002287piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002288# make sure the directory exists
2289if test ! -d $piddir ; then
2290 piddir=`eval echo ${sysconfdir}`
2291 case $piddir in
2292 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2293 esac
2294fi
2295
Tim Rice88f2ab52002-03-17 12:17:34 -08002296AC_ARG_WITH(pid-dir,
2297 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2298 [
2299 if test "x$withval" != "xno" ; then
2300 piddir=$withval
2301 if test ! -d $piddir ; then
2302 AC_MSG_WARN([** no $piddir directory on this system **])
2303 fi
2304 fi
2305 ]
2306)
2307
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002308AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002309AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002310
andre2ff7b5d2000-06-03 14:57:40 +00002311dnl allow user to disable some login recording features
2312AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002313 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002314 [ AC_DEFINE(DISABLE_LASTLOG) ]
2315)
2316AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002317 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002318 [ AC_DEFINE(DISABLE_UTMP) ]
2319)
2320AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002321 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002322 [ AC_DEFINE(DISABLE_UTMPX) ]
2323)
2324AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002325 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002326 [ AC_DEFINE(DISABLE_WTMP) ]
2327)
2328AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002329 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002330 [ AC_DEFINE(DISABLE_WTMPX) ]
2331)
2332AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002333 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002334 [ AC_DEFINE(DISABLE_LOGIN) ]
2335)
2336AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002337 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002338 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2339)
2340AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002341 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002342 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2343)
2344AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002345 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002346 [
2347 if test "x$withval" = "xno" ; then
2348 AC_DEFINE(DISABLE_LASTLOG)
2349 else
2350 conf_lastlog_location=$withval
2351 fi
2352 ]
2353)
andre2ff7b5d2000-06-03 14:57:40 +00002354
2355dnl lastlog, [uw]tmpx? detection
2356dnl NOTE: set the paths in the platform section to avoid the
2357dnl need for command-line parameters
2358dnl lastlog and [uw]tmp are subject to a file search if all else fails
2359
2360dnl lastlog detection
2361dnl NOTE: the code itself will detect if lastlog is a directory
2362AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2363AC_TRY_COMPILE([
2364#include <sys/types.h>
2365#include <utmp.h>
2366#ifdef HAVE_LASTLOG_H
2367# include <lastlog.h>
2368#endif
Damien Miller2994e082000-06-04 15:51:47 +10002369#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002370# include <paths.h>
2371#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002372#ifdef HAVE_LOGIN_H
2373# include <login.h>
2374#endif
andre2ff7b5d2000-06-03 14:57:40 +00002375 ],
2376 [ char *lastlog = LASTLOG_FILE; ],
2377 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002378 [
2379 AC_MSG_RESULT(no)
2380 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2381 AC_TRY_COMPILE([
2382#include <sys/types.h>
2383#include <utmp.h>
2384#ifdef HAVE_LASTLOG_H
2385# include <lastlog.h>
2386#endif
2387#ifdef HAVE_PATHS_H
2388# include <paths.h>
2389#endif
2390 ],
2391 [ char *lastlog = _PATH_LASTLOG; ],
2392 [ AC_MSG_RESULT(yes) ],
2393 [
andree441aa32000-06-12 22:34:38 +00002394 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002395 system_lastlog_path=no
2396 ])
2397 ]
andre2ff7b5d2000-06-03 14:57:40 +00002398)
Damien Miller2994e082000-06-04 15:51:47 +10002399
andre2ff7b5d2000-06-03 14:57:40 +00002400if test -z "$conf_lastlog_location"; then
2401 if test x"$system_lastlog_path" = x"no" ; then
2402 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002403 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002404 conf_lastlog_location=$f
2405 fi
2406 done
2407 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002408 AC_MSG_WARN([** Cannot find lastlog **])
2409 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002410 fi
2411 fi
2412fi
2413
2414if test -n "$conf_lastlog_location"; then
2415 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2416fi
2417
2418dnl utmp detection
2419AC_MSG_CHECKING([if your system defines UTMP_FILE])
2420AC_TRY_COMPILE([
2421#include <sys/types.h>
2422#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002423#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002424# include <paths.h>
2425#endif
2426 ],
2427 [ char *utmp = UTMP_FILE; ],
2428 [ AC_MSG_RESULT(yes) ],
2429 [ AC_MSG_RESULT(no)
2430 system_utmp_path=no ]
2431)
2432if test -z "$conf_utmp_location"; then
2433 if test x"$system_utmp_path" = x"no" ; then
2434 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2435 if test -f $f ; then
2436 conf_utmp_location=$f
2437 fi
2438 done
2439 if test -z "$conf_utmp_location"; then
2440 AC_DEFINE(DISABLE_UTMP)
2441 fi
2442 fi
2443fi
2444if test -n "$conf_utmp_location"; then
2445 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2446fi
2447
2448dnl wtmp detection
2449AC_MSG_CHECKING([if your system defines WTMP_FILE])
2450AC_TRY_COMPILE([
2451#include <sys/types.h>
2452#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002453#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002454# include <paths.h>
2455#endif
2456 ],
2457 [ char *wtmp = WTMP_FILE; ],
2458 [ AC_MSG_RESULT(yes) ],
2459 [ AC_MSG_RESULT(no)
2460 system_wtmp_path=no ]
2461)
2462if test -z "$conf_wtmp_location"; then
2463 if test x"$system_wtmp_path" = x"no" ; then
2464 for f in /usr/adm/wtmp /var/log/wtmp; do
2465 if test -f $f ; then
2466 conf_wtmp_location=$f
2467 fi
2468 done
2469 if test -z "$conf_wtmp_location"; then
2470 AC_DEFINE(DISABLE_WTMP)
2471 fi
2472 fi
2473fi
2474if test -n "$conf_wtmp_location"; then
2475 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2476fi
2477
2478
2479dnl utmpx detection - I don't know any system so perverse as to require
2480dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2481dnl there, though.
2482AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2483AC_TRY_COMPILE([
2484#include <sys/types.h>
2485#include <utmp.h>
2486#ifdef HAVE_UTMPX_H
2487#include <utmpx.h>
2488#endif
Damien Miller2994e082000-06-04 15:51:47 +10002489#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002490# include <paths.h>
2491#endif
2492 ],
2493 [ char *utmpx = UTMPX_FILE; ],
2494 [ AC_MSG_RESULT(yes) ],
2495 [ AC_MSG_RESULT(no)
2496 system_utmpx_path=no ]
2497)
2498if test -z "$conf_utmpx_location"; then
2499 if test x"$system_utmpx_path" = x"no" ; then
2500 AC_DEFINE(DISABLE_UTMPX)
2501 fi
2502else
2503 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2504fi
2505
2506dnl wtmpx detection
2507AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2508AC_TRY_COMPILE([
2509#include <sys/types.h>
2510#include <utmp.h>
2511#ifdef HAVE_UTMPX_H
2512#include <utmpx.h>
2513#endif
Damien Miller2994e082000-06-04 15:51:47 +10002514#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002515# include <paths.h>
2516#endif
2517 ],
2518 [ char *wtmpx = WTMPX_FILE; ],
2519 [ AC_MSG_RESULT(yes) ],
2520 [ AC_MSG_RESULT(no)
2521 system_wtmpx_path=no ]
2522)
2523if test -z "$conf_wtmpx_location"; then
2524 if test x"$system_wtmpx_path" = x"no" ; then
2525 AC_DEFINE(DISABLE_WTMPX)
2526 fi
2527else
2528 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2529fi
2530
Damien Miller4018c192000-04-30 09:30:44 +10002531
Damien Miller29ea30d2000-03-17 10:54:15 +11002532if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002533 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2534 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002535fi
2536
Tim Rice4cec93f2002-02-26 08:40:48 -08002537dnl remove pam and dl because they are in $LIBPAM
2538if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002539 LIBS=`echo $LIBS | sed 's/-lpam //'`
2540fi
2541if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2542 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002543fi
2544
Damien Millerbac2d8a2000-09-05 16:13:06 +11002545AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002546AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2547AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002548
Damien Miller7b22d652000-06-18 14:07:04 +10002549# Print summary of options
2550
Damien Miller7b22d652000-06-18 14:07:04 +10002551# Someone please show me a better way :)
2552A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2553B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2554C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2555D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002556E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002557F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002558G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002559H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2560I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2561J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002562
2563echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002564echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002565echo " User binaries: $B"
2566echo " System binaries: $C"
2567echo " Configuration files: $D"
2568echo " Askpass program: $E"
2569echo " Manual pages: $F"
2570echo " PID file: $G"
2571echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002572if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002573echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002574else
Damien Millerf58c6722002-05-13 13:15:42 +10002575echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002576fi
Damien Millera18bbd32002-05-13 10:48:57 +10002577if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002578echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002579fi
Damien Millerf58c6722002-05-13 13:15:42 +10002580echo " Manpage format: $MANTYPE"
2581echo " PAM support: ${PAM_MSG}"
2582echo " KerberosIV support: $KRB4_MSG"
2583echo " KerberosV support: $KRB5_MSG"
2584echo " Smartcard support: $SCARD_MSG"
2585echo " AFS support: $AFS_MSG"
2586echo " S/KEY support: $SKEY_MSG"
2587echo " TCP Wrappers support: $TCPW_MSG"
2588echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002589echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002590echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2591echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2592echo " BSD Auth support: $BSD_AUTH_MSG"
2593echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002594if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002595echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002596fi
2597
Damien Miller7b22d652000-06-18 14:07:04 +10002598echo ""
2599
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002600echo " Host: ${host}"
2601echo " Compiler: ${CC}"
2602echo " Compiler flags: ${CFLAGS}"
2603echo "Preprocessor flags: ${CPPFLAGS}"
2604echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002605echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002606
2607echo ""
2608
Damien Miller82cf0ce2000-12-20 13:34:48 +11002609if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002610 echo "PAM is enabled. You may need to install a PAM control file "
2611 echo "for sshd, otherwise password authentication may fail. "
2612 echo "Example PAM control files can be found in the contrib/ "
2613 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002614 echo ""
2615fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002616
Damien Miller6c21c512002-01-22 21:57:53 +11002617if test ! -z "$RAND_HELPER_CMDHASH" ; then
2618 echo "WARNING: you are using the builtin random number collection "
2619 echo "service. Please read WARNING.RNG and request that your OS "
2620 echo "vendor includes kernel-based random number collection in "
2621 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002622 echo ""
2623fi
Damien Miller60396b02001-02-18 17:01:00 +11002624