blob: 83b40188d3d239292a5573ed8b4d9e871f8effee [file] [log] [blame]
Darren Tucker2972d6c2003-05-30 17:43:42 +10001# $Id: configure.ac,v 1.124 2003/05/30 07:43:42 dtucker Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110012AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100013AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110014AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000015AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070016AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080017AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110018AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100019AC_PATH_PROG(ENT, ent)
20AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110021AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070024AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110025
Damien Millere8bb4502001-09-25 16:39:35 +100026# System features
27AC_SYS_LARGEFILE
28
Damien Miller3f62aba2000-11-29 11:56:35 +110029if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
31fi
32
Damien Millerad833b32000-08-23 10:46:23 +100033# Use LOGIN_PROGRAM from environment if possible
34if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
36else
37 # Search for login
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
41 fi
42fi
43
Damien Miller166bd442000-03-16 10:48:25 +110044if test -z "$LD" ; then
45 LD=$CC
46fi
47AC_SUBST(LD)
48
Damien Miller166bd442000-03-16 10:48:25 +110049AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100050if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110052fi
53
Damien Millera22ba012000-03-02 23:09:20 +110054# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110055case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110056*-*-aix*)
57 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000058 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110059 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millereab4bae2003-04-29 23:22:40 +100060 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
61 if (test -z "$blibpath"); then
62 blibpath="/usr/lib:/lib:/usr/local/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110063 fi
Damien Millereab4bae2003-04-29 23:22:40 +100064 saved_LDFLAGS="$LDFLAGS"
65 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
66 if (test -z "$blibflags"); then
67 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
68 AC_TRY_LINK([], [], [blibflags=$tryflags])
69 fi
70 done
71 if (test -z "$blibflags"); then
72 AC_MSG_RESULT(not found)
73 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
74 else
75 AC_MSG_RESULT($blibflags)
76 fi
77 LDFLAGS="$saved_LDFLAGS"
Tim Ricee958ed32002-07-05 07:12:33 -070078 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
79 [AC_CHECK_LIB(s,authenticate,
80 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
81 LIBS="$LIBS -ls"
82 ])
83 ])
Damien Millereca71f82000-01-20 22:38:27 +110084 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +100085 AC_DEFINE(BROKEN_REALPATH)
andre60f3c982000-06-03 16:18:19 +000086 dnl AIX handles lastlog as part of its login message
87 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +000088 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien 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)
Damien Millerbac2d8a2000-09-05 16:13:06 +110098 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +000099 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000100 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700101 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000102 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100103 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000104*-*-dgux*)
105 AC_DEFINE(IP_TOS_IS_BROKEN)
106 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000107*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000108 AC_MSG_CHECKING(if we have working getaddrinfo)
109 AC_TRY_RUN([#include <mach-o/dyld.h>
110main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
111 exit(0);
112 else
113 exit(1);
114}], [AC_MSG_RESULT(working)],
115 [AC_MSG_RESULT(buggy)
116 AC_DEFINE(BROKEN_GETADDRINFO)],
117 [AC_MSG_RESULT(assume it is working)])
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000118 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000119*-*-hpux10.26)
120 if test -z "$GCC"; then
121 CFLAGS="$CFLAGS -Ae"
122 fi
123 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
124 IPADDR_IN_DISPLAY=yes
125 AC_DEFINE(HAVE_SECUREWARE)
126 AC_DEFINE(USE_PIPES)
127 AC_DEFINE(LOGIN_NO_ENDOPT)
128 AC_DEFINE(LOGIN_NEEDS_UTMPX)
129 AC_DEFINE(DISABLE_SHADOW)
130 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100131 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700132 LIBS="$LIBS -lsec -lsecpw"
133 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000134 disable_ptmx_check=yes
135 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100136*-*-hpux10*)
137 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000138 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100139 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000140 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100141 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000142 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000143 AC_DEFINE(LOGIN_NO_ENDOPT)
144 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100145 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100146 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100147 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700148 LIBS="$LIBS -lsec"
149 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100150 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000151*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000152 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100153 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100154 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100155 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000156 AC_DEFINE(LOGIN_NO_ENDOPT)
157 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100158 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100159 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100160 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700161 LIBS="$LIBS -lsec"
162 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000163 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100164*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000165 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000166 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100167 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000168 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000169 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller1808f382000-01-06 12:03:12 +1100170 ;;
171*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000172 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000173 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100174 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000175 AC_DEFINE(WITH_IRIX_ARRAY)
176 AC_DEFINE(WITH_IRIX_PROJECT)
177 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000178 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000179 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000180 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100181 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100182*-*-linux*)
183 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100184 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100185 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000186 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Millerec201962003-01-13 10:04:58 +1100187 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
188 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
Damien Miller7bcb0892000-03-11 20:45:40 +1100189 inet6_default_4in6=yes
Darren Tuckerc437cda2003-05-10 17:05:46 +1000190 # openpty can be in libutil, needed for controlling tty test
191 AC_SEARCH_LIBS(openpty, util)
192 # make sure that openpty does not reacquire controlling terminal
193 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
194 AC_TRY_RUN(
195 [
196#include <stdio.h>
197#include <sys/fcntl.h>
198#include <sys/types.h>
199#include <sys/wait.h>
200
201int
202main()
203{
204 pid_t pid;
205 int fd, ptyfd, ttyfd, status;
206
207 pid = fork();
208 if (pid < 0) { /* failed */
209 exit(1);
210 } else if (pid > 0) { /* parent */
211 waitpid(pid, &status, 0);
212 if (WIFEXITED(status))
213 exit(WEXITSTATUS(status));
214 else
215 exit(2);
216 } else { /* child */
217 close(0); close(1); close(2);
218 setsid();
219 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
220 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
221 if (fd >= 0)
222 exit(3); /* Acquired ctty: broken */
223 else
224 exit(0); /* Did not acquire ctty: OK */
225 }
226}
227 ],
228 [
229 AC_MSG_RESULT(yes)
230 ],
231 [
232 AC_MSG_RESULT(no)
233 AC_DEFINE(SSHD_ACQUIRES_CTTY)
234 ]
235 )
Darren Tucker3c016542003-05-02 20:48:21 +1000236 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000237 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000238 AC_DEFINE(BROKEN_CMSG_TYPE)
239 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000240 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100241 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000242mips-sony-bsd|mips-sony-newsos4)
243 AC_DEFINE(HAVE_NEWS4)
244 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000245 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100246*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000247 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100248 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100249 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100250*-*-freebsd*)
251 check_for_libcrypt_later=1
252 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000253*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000254 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100255 conf_utmp_location=/etc/utmp
256 conf_wtmp_location=/usr/adm/wtmp
257 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000258 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000259 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000260 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100261 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000262 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000263 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000264 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100265*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000266 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000267 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100268 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100269 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000270 AC_DEFINE(LOGIN_NEEDS_UTMPX)
271 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000272 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckerc437cda2003-05-10 17:05:46 +1000273 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
274 AC_DEFINE(SSHD_ACQUIRES_CTTY)
andre2ff7b5d2000-06-03 14:57:40 +0000275 # hardwire lastlog location (can't detect it on some versions)
276 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000277 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
278 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
279 if test "$sol2ver" -ge 8; then
280 AC_MSG_RESULT(yes)
281 AC_DEFINE(DISABLE_UTMP)
282 AC_DEFINE(DISABLE_WTMP)
283 else
284 AC_MSG_RESULT(no)
285 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100286 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000287*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000288 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000289 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100290 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000291 conf_utmp_location=/etc/utmp
292 conf_wtmp_location=/var/adm/wtmp
293 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000294 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000295 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000296*-ncr-sysv*)
297 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
298 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700299 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000300 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000301 AC_DEFINE(SSHD_ACQUIRES_CTTY)
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)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000310 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700311 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
312 # Attention: always take care to bind libsocket and libnsl before libc,
313 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000314 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100315*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000316 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100317 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100318 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100319 ;;
320*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000321 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100322 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100323 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100324 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100325*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000326 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100327 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100328 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100329*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000330 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100331 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700332 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100333 RANLIB=true
334 no_dev_ptmx=1
335 AC_DEFINE(BROKEN_SYS_TERMIO_H)
336 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000337 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000338 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100339 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100340 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700341 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700342 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100343 ;;
344*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800345 if test -z "$GCC"; then
346 CFLAGS="$CFLAGS -belf"
347 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000348 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000349 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100350 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000351 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100352 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000353 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000354 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700355 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100356 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700357 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000358 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000359*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000360 AC_DEFINE(USE_PIPES)
361 AC_DEFINE(DISABLE_FD_PASSING)
362 LDFLAGS="$LDFLAGS"
363 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
364 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000365 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000366*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000367 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700368 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700369 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000370 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
371 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
372 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700373 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000374*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000375 AC_MSG_CHECKING(for Digital Unix SIA)
376 no_osfsia=""
377 AC_ARG_WITH(osfsia,
378 [ --with-osfsia Enable Digital Unix SIA],
379 [
380 if test "x$withval" = "xno" ; then
381 AC_MSG_RESULT(disabled)
382 no_osfsia=1
383 fi
384 ],
385 )
386 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000387 if test -f /etc/sia/matrix.conf; then
388 AC_MSG_RESULT(yes)
389 AC_DEFINE(HAVE_OSF_SIA)
390 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000391 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000392 LIBS="$LIBS -lsecurity -ldb -lm -laud"
393 else
394 AC_MSG_RESULT(no)
395 fi
396 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000397 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000398 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000399
400*-*-nto-qnx)
401 AC_DEFINE(USE_PIPES)
402 AC_DEFINE(NO_X11_UNIX_SOCKETS)
403 AC_DEFINE(MISSING_NFDBITS)
404 AC_DEFINE(MISSING_HOWMANY)
405 AC_DEFINE(MISSING_FD_MASK)
406 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100407esac
408
Damien Millere37bfc12000-06-05 09:37:43 +1000409# Allow user to specify flags
410AC_ARG_WITH(cflags,
411 [ --with-cflags Specify additional flags to pass to compiler],
412 [
413 if test "x$withval" != "xno" ; then
414 CFLAGS="$CFLAGS $withval"
415 fi
416 ]
417)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000418AC_ARG_WITH(cppflags,
419 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
420 [
421 if test "x$withval" != "xno"; then
422 CPPFLAGS="$CPPFLAGS $withval"
423 fi
424 ]
425)
Damien Millere37bfc12000-06-05 09:37:43 +1000426AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000427 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000428 [
429 if test "x$withval" != "xno" ; then
430 LDFLAGS="$LDFLAGS $withval"
431 fi
432 ]
433)
434AC_ARG_WITH(libs,
435 [ --with-libs Specify additional libraries to link with],
436 [
437 if test "x$withval" != "xno" ; then
438 LIBS="$LIBS $withval"
439 fi
440 ]
441)
442
Tim Rice4cec93f2002-02-26 08:40:48 -0800443# Checks for header files.
444AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Damien Millerb16f8742003-02-24 12:47:15 +1100445 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800446 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000447 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000448 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tucker5d0ccf32003-05-15 21:42:59 +1000449 strings.h sys/strtio.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
Damien Millera8ed44b2003-01-10 09:53:12 +1100450 sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000451 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700452 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800453 util.h utime.h utmp.h utmpx.h)
454
Damien Millera22ba012000-03-02 23:09:20 +1100455# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700456AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
457AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000458
Damien Millerdf288022001-02-18 13:07:07 +1100459dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700460if test "x$with_tcp_wrappers" != "xno" ; then
461 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
462 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
463 fi
464fi
Damien Millerdf288022001-02-18 13:07:07 +1100465
Tim Rice13aae5e2001-10-21 17:53:58 -0700466AC_CHECK_FUNC(getspnam, ,
467 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700468
Damien Miller150c8b52002-02-13 23:06:56 +1100469AC_ARG_WITH(rpath,
470 [ --without-rpath Disable auto-added -R linker paths],
471 [
472 if test "x$withval" = "xno" ; then
473 need_dash_r=""
474 fi
475 if test "x$withval" = "xyes" ; then
476 need_dash_r=1
477 fi
478 ]
479)
480
Tim Rice13aae5e2001-10-21 17:53:58 -0700481dnl zlib is required
482AC_ARG_WITH(zlib,
483 [ --with-zlib=PATH Use zlib in PATH],
484 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000485 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100486 AC_MSG_ERROR([*** zlib is required ***])
487 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700488 if test -d "$withval/lib"; then
489 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700490 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700491 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700492 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700493 fi
494 else
495 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700496 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700497 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700498 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700499 fi
500 fi
501 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700502 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700503 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700504 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700505 fi
506 ]
507)
508
Tim Rice17b93e52001-10-23 22:36:54 -0700509AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100510
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000511dnl UnixWare 2.x
512AC_CHECK_FUNC(strcasecmp,
513 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
514)
515AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700516 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
517 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000518)
Damien Millerab18c411999-11-11 10:40:23 +1100519
Tim Ricee589a292001-11-03 11:09:32 -0800520dnl Checks for libutil functions
521AC_CHECK_HEADERS(libutil.h)
522AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
523AC_CHECK_FUNCS(logout updwtmp logwtmp)
524
Ben Lindstrom8697e082001-02-24 21:41:10 +0000525AC_FUNC_STRFTIME
526
Damien Miller3c027682001-03-14 11:39:45 +1100527# Check for ALTDIRFUNC glob() extension
528AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
529AC_EGREP_CPP(FOUNDIT,
530 [
531 #include <glob.h>
532 #ifdef GLOB_ALTDIRFUNC
533 FOUNDIT
534 #endif
535 ],
536 [
537 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
538 AC_MSG_RESULT(yes)
539 ],
540 [
541 AC_MSG_RESULT(no)
542 ]
543)
Damien Millerab18c411999-11-11 10:40:23 +1100544
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000545# Check for g.gl_matchc glob() extension
546AC_MSG_CHECKING(for gl_matchc field in glob_t)
547AC_EGREP_CPP(FOUNDIT,
548 [
549 #include <glob.h>
550 int main(void){glob_t g; g.gl_matchc = 1;}
551 ],
552 [
553 AC_DEFINE(GLOB_HAS_GL_MATCHC)
554 AC_MSG_RESULT(yes)
555 ],
556 [
557 AC_MSG_RESULT(no)
558 ]
559)
560
Damien Miller18bb4732001-03-28 14:35:30 +1000561AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
562AC_TRY_RUN(
563 [
564#include <sys/types.h>
565#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700566int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000567 ],
568 [AC_MSG_RESULT(yes)],
569 [
570 AC_MSG_RESULT(no)
571 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
572 ]
573)
574
Damien Millerc547bf12001-02-16 10:18:12 +1100575# Check whether user wants S/Key support
576SKEY_MSG="no"
577AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700578 [ --with-skey[[=PATH]] Enable S/Key support
579 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100580 [
581 if test "x$withval" != "xno" ; then
582
583 if test "x$withval" != "xyes" ; then
584 CPPFLAGS="$CPPFLAGS -I${withval}/include"
585 LDFLAGS="$LDFLAGS -L${withval}/lib"
586 fi
587
588 AC_DEFINE(SKEY)
589 LIBS="-lskey $LIBS"
590 SKEY_MSG="yes"
591
Tim Rice4cec93f2002-02-26 08:40:48 -0800592 AC_MSG_CHECKING([for s/key support])
593 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100594 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800595#include <stdio.h>
596#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700597int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800598 ],
599 [AC_MSG_RESULT(yes)],
600 [
601 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100602 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
603 ])
604 fi
605 ]
606)
607
608# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700609TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100610AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700611 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
612 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100613 [
614 if test "x$withval" != "xno" ; then
615 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700616 saved_LDFLAGS="$LDFLAGS"
617 saved_CPPFLAGS="$CPPFLAGS"
618 if test -n "${withval}" -a "${withval}" != "yes"; then
619 if test -d "${withval}/lib"; then
620 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700621 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700622 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700623 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700624 fi
625 else
626 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700627 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700628 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700629 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700630 fi
631 fi
632 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700633 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700634 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700635 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700636 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700637 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800638 LIBWRAP="-lwrap"
639 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100640 AC_MSG_CHECKING(for libwrap)
641 AC_TRY_LINK(
642 [
643#include <tcpd.h>
644 int deny_severity = 0, allow_severity = 0;
645 ],
646 [hosts_access(0);],
647 [
648 AC_MSG_RESULT(yes)
649 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800650 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700651 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100652 ],
653 [
654 AC_MSG_ERROR([*** libwrap missing])
655 ]
656 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800657 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100658 fi
659 ]
660)
661
Damien Millerfe1f1432003-02-24 15:45:42 +1100662dnl Checks for library functions. Please keep in alphabetical order
663AC_CHECK_FUNCS(\
664 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename bcopy \
665 bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
666 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
667 getpeereid _getpty getrlimit getrusage getttyent glob inet_aton \
668 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000669 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
670 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
671 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
672 setproctitle setresgid setreuid setrlimit setsid setvbuf sigaction \
673 sigvec snprintf socketpair strerror strlcat strlcpy strmode strnvis \
Damien Millerfe1f1432003-02-24 15:45:42 +1100674 sysconf tcgetpgrp truncate utimes vhangup vsnprintf waitpid \
675)
Tim Rice13aae5e2001-10-21 17:53:58 -0700676
Damien Millercd6853c2003-01-28 11:33:42 +1100677AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
Damien Millereab4bae2003-04-29 23:22:40 +1000678AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
Damien Millercd6853c2003-01-28 11:33:42 +1100679
Ben Lindstrom3e006472002-10-16 00:24:03 +0000680dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
681AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
682
Tim Rice13aae5e2001-10-21 17:53:58 -0700683dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700684AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700685 AC_CHECK_LIB(gen, dirname,[
686 AC_CACHE_CHECK([for broken dirname],
687 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700688 save_LIBS="$LIBS"
689 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700690 AC_TRY_RUN(
691 [
692#include <libgen.h>
693#include <string.h>
694
695int main(int argc, char **argv) {
696 char *s, buf[32];
697
698 strncpy(buf,"/etc", 32);
699 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700700 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700701 exit(1);
702 } else {
703 exit(0);
704 }
705}
706 ],
707 [ ac_cv_have_broken_dirname="no" ],
708 [ ac_cv_have_broken_dirname="yes" ]
709 )
Tim Rice17b93e52001-10-23 22:36:54 -0700710 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700711 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700712 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700713 LIBS="$LIBS -lgen"
714 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700715 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700716 fi
717 ])
718])
719
Damien Millerad833b32000-08-23 10:46:23 +1000720dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000721AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000722dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000723AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000724AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000725dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000726AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000727AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100728
Damien Miller04f80141999-11-19 15:32:34 +1100729AC_CHECK_FUNC(daemon,
730 [AC_DEFINE(HAVE_DAEMON)],
731 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
732)
733
Damien Miller9fb07e42000-03-05 16:22:59 +1100734AC_CHECK_FUNC(getpagesize,
735 [AC_DEFINE(HAVE_GETPAGESIZE)],
736 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
737)
738
Damien Millercb170cb2000-07-01 16:52:55 +1000739# Check for broken snprintf
740if test "x$ac_cv_func_snprintf" = "xyes" ; then
741 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
742 AC_TRY_RUN(
743 [
744#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700745int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000746 ],
747 [AC_MSG_RESULT(yes)],
748 [
749 AC_MSG_RESULT(no)
750 AC_DEFINE(BROKEN_SNPRINTF)
751 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
752 ]
753 )
754fi
755
Damien Millere8328192003-01-07 15:18:32 +1100756dnl see whether mkstemp() requires XXXXXX
757if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
758AC_MSG_CHECKING([for (overly) strict mkstemp])
759AC_TRY_RUN(
760 [
761#include <stdlib.h>
762main() { char template[]="conftest.mkstemp-test";
763if (mkstemp(template) == -1)
764 exit(1);
765unlink(template); exit(0);
766}
767 ],
768 [
769 AC_MSG_RESULT(no)
770 ],
771 [
772 AC_MSG_RESULT(yes)
773 AC_DEFINE(HAVE_STRICT_MKSTEMP)
774 ],
775 [
776 AC_MSG_RESULT(yes)
777 AC_DEFINE(HAVE_STRICT_MKSTEMP)
778 ]
779)
780fi
781
Damien Miller606f8802000-09-16 15:39:56 +1100782AC_FUNC_GETPGRP
783
Damien Millera64b57a2001-01-17 10:44:13 +1100784# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000785PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100786AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100787 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100788 [
Damien Millera64b57a2001-01-17 10:44:13 +1100789 if test "x$withval" != "xno" ; then
790 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
791 AC_MSG_ERROR([PAM headers not found])
792 fi
793
794 AC_CHECK_LIB(dl, dlopen, , )
795 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
796 AC_CHECK_FUNCS(pam_getenvlist)
797
798 disable_shadow=yes
799 PAM_MSG="yes"
800
801 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800802 if test $ac_cv_lib_dl_dlopen = yes; then
803 LIBPAM="-lpam -ldl"
804 else
805 LIBPAM="-lpam"
806 fi
807 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100808 fi
809 ]
810)
Damien Millera22ba012000-03-02 23:09:20 +1100811
Damien Millera64b57a2001-01-17 10:44:13 +1100812# Check for older PAM
813if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100814 # Check PAM strerror arguments (old PAM)
815 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
816 AC_TRY_COMPILE(
817 [
Damien Miller81171112000-04-23 11:14:01 +1000818#include <stdlib.h>
819#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100820 ],
821 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
822 [AC_MSG_RESULT(no)],
823 [
824 AC_DEFINE(HAVE_OLD_PAM)
825 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000826 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100827 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100828 )
Damien Millera22ba012000-03-02 23:09:20 +1100829fi
830
Damien Millerfc93d4b2002-09-04 23:26:29 +1000831# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
832# because the system crypt() is more featureful.
833if test "x$check_for_libcrypt_before" = "x1"; then
834 AC_CHECK_LIB(crypt, crypt)
835fi
836
Tim Riceaef73712002-05-11 13:17:42 -0700837# Search for OpenSSL
838saved_CPPFLAGS="$CPPFLAGS"
839saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100840AC_ARG_WITH(ssl-dir,
841 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
842 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000843 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700844 if test -d "$withval/lib"; then
845 if test -n "${need_dash_r}"; then
846 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
847 else
848 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
849 fi
850 else
851 if test -n "${need_dash_r}"; then
852 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
853 else
854 LDFLAGS="-L${withval} ${LDFLAGS}"
855 fi
856 fi
857 if test -d "$withval/include"; then
858 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
859 else
860 CPPFLAGS="-I${withval} ${CPPFLAGS}"
861 fi
Damien Millera22ba012000-03-02 23:09:20 +1100862 fi
863 ]
864)
Tim Riceaef73712002-05-11 13:17:42 -0700865LIBS="$LIBS -lcrypto"
866AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000867 [
Tim Riceaef73712002-05-11 13:17:42 -0700868 dnl Check default openssl install dir
869 if test -n "${need_dash_r}"; then
870 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000871 else
Tim Riceaef73712002-05-11 13:17:42 -0700872 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000873 fi
Tim Riceaef73712002-05-11 13:17:42 -0700874 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
875 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
876 [
877 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
878 ]
879 )
880 ]
881)
882
Tim Riced730b782002-08-13 18:52:10 -0700883# Determine OpenSSL header version
884AC_MSG_CHECKING([OpenSSL header version])
885AC_TRY_RUN(
886 [
887#include <stdio.h>
888#include <string.h>
889#include <openssl/opensslv.h>
890#define DATA "conftest.sslincver"
891int main(void) {
892 FILE *fd;
893 int rc;
894
895 fd = fopen(DATA,"w");
896 if(fd == NULL)
897 exit(1);
898
899 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
900 exit(1);
901
902 exit(0);
903}
904 ],
905 [
906 ssl_header_ver=`cat conftest.sslincver`
907 AC_MSG_RESULT($ssl_header_ver)
908 ],
909 [
910 AC_MSG_RESULT(not found)
911 AC_MSG_ERROR(OpenSSL version header not found.)
912 ]
913)
914
915# Determine OpenSSL library version
916AC_MSG_CHECKING([OpenSSL library version])
917AC_TRY_RUN(
918 [
919#include <stdio.h>
920#include <string.h>
921#include <openssl/opensslv.h>
922#include <openssl/crypto.h>
923#define DATA "conftest.ssllibver"
924int main(void) {
925 FILE *fd;
926 int rc;
927
928 fd = fopen(DATA,"w");
929 if(fd == NULL)
930 exit(1);
931
932 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
933 exit(1);
934
935 exit(0);
936}
937 ],
938 [
939 ssl_library_ver=`cat conftest.ssllibver`
940 AC_MSG_RESULT($ssl_library_ver)
941 ],
942 [
943 AC_MSG_RESULT(not found)
944 AC_MSG_ERROR(OpenSSL library not found.)
945 ]
946)
Damien Millera22ba012000-03-02 23:09:20 +1100947
Damien Millerec932372002-01-22 22:16:03 +1100948# Sanity check OpenSSL headers
949AC_MSG_CHECKING([whether OpenSSL's headers match the library])
950AC_TRY_RUN(
951 [
952#include <string.h>
953#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700954int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100955 ],
956 [
957 AC_MSG_RESULT(yes)
958 ],
959 [
960 AC_MSG_RESULT(no)
961 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
962 ]
963)
964
Damien Millera64b57a2001-01-17 10:44:13 +1100965# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
966# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +1000967if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100968 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100969fi
970
Damien Miller6c21c512002-01-22 21:57:53 +1100971
972### Configure cryptographic random number support
973
974# Check wheter OpenSSL seeds itself
975AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
976AC_TRY_RUN(
977 [
978#include <string.h>
979#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700980int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +1100981 ],
982 [
983 OPENSSL_SEEDS_ITSELF=yes
984 AC_MSG_RESULT(yes)
985 ],
986 [
987 AC_MSG_RESULT(no)
988 # Default to use of the rand helper if OpenSSL doesn't
989 # seed itself
990 USE_RAND_HELPER=yes
991 ]
992)
993
994
995# Do we want to force the use of the rand helper?
996AC_ARG_WITH(rand-helper,
997 [ --with-rand-helper Use subprocess to gather strong randomness ],
998 [
999 if test "x$withval" = "xno" ; then
1000 # Force use of OpenSSL's internal RNG, even if
1001 # the previous test showed it to be unseeded.
1002 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1003 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1004 OPENSSL_SEEDS_ITSELF=yes
1005 USE_RAND_HELPER=""
1006 fi
1007 else
1008 USE_RAND_HELPER=yes
1009 fi
1010 ],
1011)
1012
1013# Which randomness source do we use?
1014if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1015 # OpenSSL only
1016 AC_DEFINE(OPENSSL_PRNG_ONLY)
1017 RAND_MSG="OpenSSL internal ONLY"
1018 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001019elif test ! -z "$USE_RAND_HELPER" ; then
1020 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001021 RAND_MSG="ssh-rand-helper"
1022 INSTALL_SSH_RAND_HELPER="yes"
1023fi
1024AC_SUBST(INSTALL_SSH_RAND_HELPER)
1025
1026### Configuration of ssh-rand-helper
1027
1028# PRNGD TCP socket
1029AC_ARG_WITH(prngd-port,
1030 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1031 [
Damien Millere996d722002-01-23 11:20:59 +11001032 case "$withval" in
1033 no)
1034 withval=""
1035 ;;
1036 [[0-9]]*)
1037 ;;
1038 *)
1039 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1040 ;;
1041 esac
1042 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001043 PRNGD_PORT="$withval"
1044 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1045 fi
1046 ]
1047)
1048
1049# PRNGD Unix domain socket
1050AC_ARG_WITH(prngd-socket,
1051 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1052 [
Damien Millere996d722002-01-23 11:20:59 +11001053 case "$withval" in
1054 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001055 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001056 ;;
1057 no)
1058 withval=""
1059 ;;
1060 /*)
1061 ;;
1062 *)
1063 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1064 ;;
1065 esac
1066
1067 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001068 if test ! -z "$PRNGD_PORT" ; then
1069 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1070 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001071 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001072 AC_MSG_WARN(Entropy socket is not readable)
1073 fi
1074 PRNGD_SOCKET="$withval"
1075 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1076 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001077 ],
1078 [
1079 # Check for existing socket only if we don't have a random device already
1080 if test "$USE_RAND_HELPER" = yes ; then
1081 AC_MSG_CHECKING(for PRNGD/EGD socket)
1082 # Insert other locations here
1083 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1084 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1085 PRNGD_SOCKET="$sock"
1086 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1087 break;
1088 fi
1089 done
1090 if test ! -z "$PRNGD_SOCKET" ; then
1091 AC_MSG_RESULT($PRNGD_SOCKET)
1092 else
1093 AC_MSG_RESULT(not found)
1094 fi
1095 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001096 ]
1097)
1098
1099# Change default command timeout for hashing entropy source
1100entropy_timeout=200
1101AC_ARG_WITH(entropy-timeout,
1102 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1103 [
1104 if test "x$withval" != "xno" ; then
1105 entropy_timeout=$withval
1106 fi
1107 ]
1108)
Damien Miller6c21c512002-01-22 21:57:53 +11001109AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1110
Damien Millerd3f6ad22002-06-25 10:24:47 +10001111SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001112AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001113 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001114 [
1115 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001116 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001117 fi
1118 ]
1119)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001120AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1121AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001122
Tim Rice88f2ab52002-03-17 12:17:34 -08001123# We do this little dance with the search path to insure
1124# that programs that we select for use by installed programs
1125# (which may be run by the super-user) come from trusted
1126# locations before they come from the user's private area.
1127# This should help avoid accidentally configuring some
1128# random version of a program in someone's personal bin.
1129
1130OPATH=$PATH
1131PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001132test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001133test -d /sbin && PATH=$PATH:/sbin
1134test -d /usr/sbin && PATH=$PATH:/usr/sbin
1135PATH=$PATH:/etc:$OPATH
1136
Damien Miller6c21c512002-01-22 21:57:53 +11001137# These programs are used by the command hashing source to gather entropy
1138OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1139OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1140OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1141OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1142OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1143OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1144OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1145OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1146OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1147OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1148OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1149OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1150OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1151OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1152OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1153OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001154# restore PATH
1155PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001156
1157# Where does ssh-rand-helper get its randomness from?
1158INSTALL_SSH_PRNG_CMDS=""
1159if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1160 if test ! -z "$PRNGD_PORT" ; then
1161 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1162 elif test ! -z "$PRNGD_SOCKET" ; then
1163 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1164 else
1165 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1166 RAND_HELPER_CMDHASH=yes
1167 INSTALL_SSH_PRNG_CMDS="yes"
1168 fi
1169fi
1170AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1171
1172
Ben Lindstromb5628642000-10-18 00:02:25 +00001173# Cheap hack to ensure NEWS-OS libraries are arranged right.
1174if test ! -z "$SONY" ; then
1175 LIBS="$LIBS -liberty";
1176fi
1177
Damien Millera22ba012000-03-02 23:09:20 +11001178# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001179AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001180AC_CHECK_SIZEOF(short int, 2)
1181AC_CHECK_SIZEOF(int, 4)
1182AC_CHECK_SIZEOF(long int, 4)
1183AC_CHECK_SIZEOF(long long int, 8)
1184
Damien Millerfa2bb692002-04-23 23:22:25 +10001185# Sanity check long long for some platforms (AIX)
1186if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1187 ac_cv_sizeof_long_long_int=0
1188fi
1189
Damien Millera22ba012000-03-02 23:09:20 +11001190# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001191AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1192 AC_TRY_COMPILE(
1193 [ #include <sys/types.h> ],
1194 [ u_int a; a = 1;],
1195 [ ac_cv_have_u_int="yes" ],
1196 [ ac_cv_have_u_int="no" ]
1197 )
1198])
1199if test "x$ac_cv_have_u_int" = "xyes" ; then
1200 AC_DEFINE(HAVE_U_INT)
1201 have_u_int=1
1202fi
1203
Damien Miller61e50f12000-05-08 20:49:37 +10001204AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1205 AC_TRY_COMPILE(
1206 [ #include <sys/types.h> ],
1207 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1208 [ ac_cv_have_intxx_t="yes" ],
1209 [ ac_cv_have_intxx_t="no" ]
1210 )
1211])
1212if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1213 AC_DEFINE(HAVE_INTXX_T)
1214 have_intxx_t=1
1215fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001216
1217if (test -z "$have_intxx_t" && \
1218 test "x$ac_cv_header_stdint_h" = "xyes")
1219then
1220 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1221 AC_TRY_COMPILE(
1222 [ #include <stdint.h> ],
1223 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1224 [
1225 AC_DEFINE(HAVE_INTXX_T)
1226 AC_MSG_RESULT(yes)
1227 ],
1228 [ AC_MSG_RESULT(no) ]
1229 )
1230fi
1231
Damien Miller578783e2000-09-23 14:12:24 +11001232AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1233 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001234 [
1235#include <sys/types.h>
1236#ifdef HAVE_STDINT_H
1237# include <stdint.h>
1238#endif
1239#include <sys/socket.h>
1240#ifdef HAVE_SYS_BITYPES_H
1241# include <sys/bitypes.h>
1242#endif
1243 ],
Damien Miller578783e2000-09-23 14:12:24 +11001244 [ int64_t a; a = 1;],
1245 [ ac_cv_have_int64_t="yes" ],
1246 [ ac_cv_have_int64_t="no" ]
1247 )
1248])
1249if test "x$ac_cv_have_int64_t" = "xyes" ; then
1250 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001251fi
1252
Damien Miller61e50f12000-05-08 20:49:37 +10001253AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1254 AC_TRY_COMPILE(
1255 [ #include <sys/types.h> ],
1256 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1257 [ ac_cv_have_u_intxx_t="yes" ],
1258 [ ac_cv_have_u_intxx_t="no" ]
1259 )
1260])
1261if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1262 AC_DEFINE(HAVE_U_INTXX_T)
1263 have_u_intxx_t=1
1264fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001265
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001266if test -z "$have_u_intxx_t" ; then
1267 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1268 AC_TRY_COMPILE(
1269 [ #include <sys/socket.h> ],
1270 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1271 [
1272 AC_DEFINE(HAVE_U_INTXX_T)
1273 AC_MSG_RESULT(yes)
1274 ],
1275 [ AC_MSG_RESULT(no) ]
1276 )
1277fi
1278
Damien Miller578783e2000-09-23 14:12:24 +11001279AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1280 AC_TRY_COMPILE(
1281 [ #include <sys/types.h> ],
1282 [ u_int64_t a; a = 1;],
1283 [ ac_cv_have_u_int64_t="yes" ],
1284 [ ac_cv_have_u_int64_t="no" ]
1285 )
1286])
1287if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1288 AC_DEFINE(HAVE_U_INT64_T)
1289 have_u_int64_t=1
1290fi
1291
Tim Rice4cec93f2002-02-26 08:40:48 -08001292if test -z "$have_u_int64_t" ; then
1293 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1294 AC_TRY_COMPILE(
1295 [ #include <sys/bitypes.h> ],
1296 [ u_int64_t a; a = 1],
1297 [
1298 AC_DEFINE(HAVE_U_INT64_T)
1299 AC_MSG_RESULT(yes)
1300 ],
1301 [ AC_MSG_RESULT(no) ]
1302 )
1303fi
1304
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001305if test -z "$have_u_intxx_t" ; then
1306 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1307 AC_TRY_COMPILE(
1308 [
1309#include <sys/types.h>
1310 ],
1311 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1312 [ ac_cv_have_uintxx_t="yes" ],
1313 [ ac_cv_have_uintxx_t="no" ]
1314 )
1315 ])
1316 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1317 AC_DEFINE(HAVE_UINTXX_T)
1318 fi
1319fi
1320
1321if test -z "$have_uintxx_t" ; then
1322 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1323 AC_TRY_COMPILE(
1324 [ #include <stdint.h> ],
1325 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1326 [
1327 AC_DEFINE(HAVE_UINTXX_T)
1328 AC_MSG_RESULT(yes)
1329 ],
1330 [ AC_MSG_RESULT(no) ]
1331 )
1332fi
1333
Damien Milleredb82922000-06-20 13:25:52 +10001334if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1335 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001336then
1337 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1338 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001339 [
1340#include <sys/bitypes.h>
1341 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001342 [
Damien Miller70494d12000-04-03 15:57:06 +10001343 int8_t a; int16_t b; int32_t c;
1344 u_int8_t e; u_int16_t f; u_int32_t g;
1345 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001346 ],
1347 [
1348 AC_DEFINE(HAVE_U_INTXX_T)
1349 AC_DEFINE(HAVE_INTXX_T)
1350 AC_MSG_RESULT(yes)
1351 ],
1352 [AC_MSG_RESULT(no)]
1353 )
1354fi
1355
Damien Miller58be7382001-09-15 21:31:54 +10001356
1357AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1358 AC_TRY_COMPILE(
1359 [
1360#include <sys/types.h>
1361 ],
1362 [ u_char foo; foo = 125; ],
1363 [ ac_cv_have_u_char="yes" ],
1364 [ ac_cv_have_u_char="no" ]
1365 )
1366])
1367if test "x$ac_cv_have_u_char" = "xyes" ; then
1368 AC_DEFINE(HAVE_U_CHAR)
1369fi
1370
Tim Rice13aae5e2001-10-21 17:53:58 -07001371TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001372
Tim Rice200a5c02002-02-26 22:12:34 -08001373AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001374
Damien Miller61e50f12000-05-08 20:49:37 +10001375AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1376 AC_TRY_COMPILE(
1377 [
1378#include <sys/types.h>
1379 ],
1380 [ size_t foo; foo = 1235; ],
1381 [ ac_cv_have_size_t="yes" ],
1382 [ ac_cv_have_size_t="no" ]
1383 )
1384])
1385if test "x$ac_cv_have_size_t" = "xyes" ; then
1386 AC_DEFINE(HAVE_SIZE_T)
1387fi
Damien Miller95058511999-12-29 10:36:45 +11001388
Damien Miller615f9392000-05-17 22:53:33 +10001389AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1390 AC_TRY_COMPILE(
1391 [
1392#include <sys/types.h>
1393 ],
1394 [ ssize_t foo; foo = 1235; ],
1395 [ ac_cv_have_ssize_t="yes" ],
1396 [ ac_cv_have_ssize_t="no" ]
1397 )
1398])
1399if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1400 AC_DEFINE(HAVE_SSIZE_T)
1401fi
1402
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001403AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1404 AC_TRY_COMPILE(
1405 [
1406#include <time.h>
1407 ],
1408 [ clock_t foo; foo = 1235; ],
1409 [ ac_cv_have_clock_t="yes" ],
1410 [ ac_cv_have_clock_t="no" ]
1411 )
1412])
1413if test "x$ac_cv_have_clock_t" = "xyes" ; then
1414 AC_DEFINE(HAVE_CLOCK_T)
1415fi
1416
Damien Millerb54b40e2000-06-23 08:23:34 +10001417AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1418 AC_TRY_COMPILE(
1419 [
1420#include <sys/types.h>
1421#include <sys/socket.h>
1422 ],
1423 [ sa_family_t foo; foo = 1235; ],
1424 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001425 [ AC_TRY_COMPILE(
1426 [
1427#include <sys/types.h>
1428#include <sys/socket.h>
1429#include <netinet/in.h>
1430 ],
1431 [ sa_family_t foo; foo = 1235; ],
1432 [ ac_cv_have_sa_family_t="yes" ],
1433
Damien Millerb54b40e2000-06-23 08:23:34 +10001434 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001435 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001436 )
1437])
1438if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1439 AC_DEFINE(HAVE_SA_FAMILY_T)
1440fi
1441
Damien Miller0f91b4e2000-06-18 15:43:25 +10001442AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1443 AC_TRY_COMPILE(
1444 [
1445#include <sys/types.h>
1446 ],
1447 [ pid_t foo; foo = 1235; ],
1448 [ ac_cv_have_pid_t="yes" ],
1449 [ ac_cv_have_pid_t="no" ]
1450 )
1451])
1452if test "x$ac_cv_have_pid_t" = "xyes" ; then
1453 AC_DEFINE(HAVE_PID_T)
1454fi
1455
1456AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1457 AC_TRY_COMPILE(
1458 [
1459#include <sys/types.h>
1460 ],
1461 [ mode_t foo; foo = 1235; ],
1462 [ ac_cv_have_mode_t="yes" ],
1463 [ ac_cv_have_mode_t="no" ]
1464 )
1465])
1466if test "x$ac_cv_have_mode_t" = "xyes" ; then
1467 AC_DEFINE(HAVE_MODE_T)
1468fi
1469
Damien Miller61e50f12000-05-08 20:49:37 +10001470
1471AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1472 AC_TRY_COMPILE(
1473 [
Damien Miller81171112000-04-23 11:14:01 +10001474#include <sys/types.h>
1475#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001476 ],
1477 [ struct sockaddr_storage s; ],
1478 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1479 [ ac_cv_have_struct_sockaddr_storage="no" ]
1480 )
1481])
1482if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1483 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1484fi
Damien Miller34132e52000-01-14 15:45:46 +11001485
Damien Miller61e50f12000-05-08 20:49:37 +10001486AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1487 AC_TRY_COMPILE(
1488 [
Damien Miller7b22d652000-06-18 14:07:04 +10001489#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001490#include <netinet/in.h>
1491 ],
1492 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1493 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1494 [ ac_cv_have_struct_sockaddr_in6="no" ]
1495 )
1496])
1497if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1498 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1499fi
Damien Miller34132e52000-01-14 15:45:46 +11001500
Damien Miller61e50f12000-05-08 20:49:37 +10001501AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1502 AC_TRY_COMPILE(
1503 [
Damien Miller7b22d652000-06-18 14:07:04 +10001504#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001505#include <netinet/in.h>
1506 ],
1507 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1508 [ ac_cv_have_struct_in6_addr="yes" ],
1509 [ ac_cv_have_struct_in6_addr="no" ]
1510 )
1511])
1512if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1513 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1514fi
Damien Miller34132e52000-01-14 15:45:46 +11001515
Damien Miller61e50f12000-05-08 20:49:37 +10001516AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1517 AC_TRY_COMPILE(
1518 [
Damien Miller81171112000-04-23 11:14:01 +10001519#include <sys/types.h>
1520#include <sys/socket.h>
1521#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001522 ],
1523 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1524 [ ac_cv_have_struct_addrinfo="yes" ],
1525 [ ac_cv_have_struct_addrinfo="no" ]
1526 )
1527])
1528if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1529 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1530fi
1531
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001532AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1533 AC_TRY_COMPILE(
1534 [ #include <sys/time.h> ],
1535 [ struct timeval tv; tv.tv_sec = 1;],
1536 [ ac_cv_have_struct_timeval="yes" ],
1537 [ ac_cv_have_struct_timeval="no" ]
1538 )
1539])
1540if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1541 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1542 have_struct_timeval=1
1543fi
1544
Tim Rice4e4dc562003-03-18 10:21:40 -08001545AC_CHECK_TYPES(struct timespec)
1546
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001547# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001548if test "x$ac_cv_have_int64_t" = "xno" -a \
1549 "x$ac_cv_sizeof_long_int" != "x8" -a \
1550 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001551 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1552 echo "an alternative compiler (I.E., GCC) before continuing."
1553 echo ""
1554 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001555else
1556dnl test snprintf (broken on SCO w/gcc)
1557 AC_TRY_RUN(
1558 [
1559#include <stdio.h>
1560#include <string.h>
1561#ifdef HAVE_SNPRINTF
1562main()
1563{
1564 char buf[50];
1565 char expected_out[50];
1566 int mazsize = 50 ;
1567#if (SIZEOF_LONG_INT == 8)
1568 long int num = 0x7fffffffffffffff;
1569#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001570 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001571#endif
1572 strcpy(expected_out, "9223372036854775807");
1573 snprintf(buf, mazsize, "%lld", num);
1574 if(strcmp(buf, expected_out) != 0)
1575 exit(1);
1576 exit(0);
1577}
1578#else
1579main() { exit(0); }
1580#endif
1581 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1582 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001583fi
1584
Damien Miller78315eb2000-09-29 23:01:36 +11001585dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001586OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1587OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1588OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1589OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1590OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001591OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001592OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1593OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001594OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001595OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1596OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1597OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1598OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001599OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1600OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1601OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1602OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001603
1604AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001605
Damien Miller61e50f12000-05-08 20:49:37 +10001606AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1607 ac_cv_have_ss_family_in_struct_ss, [
1608 AC_TRY_COMPILE(
1609 [
Damien Miller81171112000-04-23 11:14:01 +10001610#include <sys/types.h>
1611#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001612 ],
1613 [ struct sockaddr_storage s; s.ss_family = 1; ],
1614 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1615 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1616 )
1617])
1618if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1619 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1620fi
1621
Damien Miller61e50f12000-05-08 20:49:37 +10001622AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1623 ac_cv_have___ss_family_in_struct_ss, [
1624 AC_TRY_COMPILE(
1625 [
Damien Miller81171112000-04-23 11:14:01 +10001626#include <sys/types.h>
1627#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001628 ],
1629 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1630 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1631 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1632 )
1633])
1634if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1635 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1636fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001637
Damien Millerad833b32000-08-23 10:46:23 +10001638AC_CACHE_CHECK([for pw_class field in struct passwd],
1639 ac_cv_have_pw_class_in_struct_passwd, [
1640 AC_TRY_COMPILE(
1641 [
Damien Millerad833b32000-08-23 10:46:23 +10001642#include <pwd.h>
1643 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001644 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001645 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1646 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1647 )
1648])
1649if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1650 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1651fi
1652
Kevin Steves82456952001-06-22 21:14:18 +00001653AC_CACHE_CHECK([for pw_expire field in struct passwd],
1654 ac_cv_have_pw_expire_in_struct_passwd, [
1655 AC_TRY_COMPILE(
1656 [
1657#include <pwd.h>
1658 ],
1659 [ struct passwd p; p.pw_expire = 0; ],
1660 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1661 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1662 )
1663])
1664if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1665 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1666fi
1667
1668AC_CACHE_CHECK([for pw_change field in struct passwd],
1669 ac_cv_have_pw_change_in_struct_passwd, [
1670 AC_TRY_COMPILE(
1671 [
1672#include <pwd.h>
1673 ],
1674 [ struct passwd p; p.pw_change = 0; ],
1675 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1676 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1677 )
1678])
1679if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1680 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1681fi
Damien Miller61e50f12000-05-08 20:49:37 +10001682
Tim Rice28bbb0c2002-05-27 17:37:32 -07001683dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001684AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1685 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001686 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001687 [
Tim Riceae49fe62002-04-12 10:26:21 -07001688#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001689#include <sys/socket.h>
1690#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001691int main() {
1692#ifdef msg_accrights
1693exit(1);
1694#endif
1695struct msghdr m;
1696m.msg_accrights = 0;
1697exit(0);
1698}
Kevin Steves939c9db2002-03-22 17:23:25 +00001699 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001700 [ ac_cv_have_accrights_in_msghdr="yes" ],
1701 [ ac_cv_have_accrights_in_msghdr="no" ]
1702 )
1703])
1704if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1705 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1706fi
1707
Kevin Stevesa44e0352002-04-07 16:18:03 +00001708AC_CACHE_CHECK([for msg_control field in struct msghdr],
1709 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001710 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001711 [
Tim Riceae49fe62002-04-12 10:26:21 -07001712#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001713#include <sys/socket.h>
1714#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001715int main() {
1716#ifdef msg_control
1717exit(1);
1718#endif
1719struct msghdr m;
1720m.msg_control = 0;
1721exit(0);
1722}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001723 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001724 [ ac_cv_have_control_in_msghdr="yes" ],
1725 [ ac_cv_have_control_in_msghdr="no" ]
1726 )
1727])
1728if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1729 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1730fi
1731
Damien Miller61e50f12000-05-08 20:49:37 +10001732AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1733 AC_TRY_LINK([],
1734 [ extern char *__progname; printf("%s", __progname); ],
1735 [ ac_cv_libc_defines___progname="yes" ],
1736 [ ac_cv_libc_defines___progname="no" ]
1737 )
1738])
1739if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1740 AC_DEFINE(HAVE___PROGNAME)
1741fi
1742
Kevin Steves4846f4a2002-03-22 18:19:53 +00001743AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1744 AC_TRY_LINK([
1745#include <stdio.h>
1746],
1747 [ printf("%s", __FUNCTION__); ],
1748 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1749 [ ac_cv_cc_implements___FUNCTION__="no" ]
1750 )
1751])
1752if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1753 AC_DEFINE(HAVE___FUNCTION__)
1754fi
1755
1756AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1757 AC_TRY_LINK([
1758#include <stdio.h>
1759],
1760 [ printf("%s", __func__); ],
1761 [ ac_cv_cc_implements___func__="yes" ],
1762 [ ac_cv_cc_implements___func__="no" ]
1763 )
1764])
1765if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1766 AC_DEFINE(HAVE___func__)
1767fi
1768
Damien Miller4f8e6692001-07-14 13:22:53 +10001769AC_CACHE_CHECK([whether getopt has optreset support],
1770 ac_cv_have_getopt_optreset, [
1771 AC_TRY_LINK(
1772 [
1773#include <getopt.h>
1774 ],
1775 [ extern int optreset; optreset = 0; ],
1776 [ ac_cv_have_getopt_optreset="yes" ],
1777 [ ac_cv_have_getopt_optreset="no" ]
1778 )
1779])
1780if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1781 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1782fi
Damien Millera22ba012000-03-02 23:09:20 +11001783
Damien Millerecbb26d2000-07-15 14:59:14 +10001784AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1785 AC_TRY_LINK([],
1786 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1787 [ ac_cv_libc_defines_sys_errlist="yes" ],
1788 [ ac_cv_libc_defines_sys_errlist="no" ]
1789 )
1790])
1791if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1792 AC_DEFINE(HAVE_SYS_ERRLIST)
1793fi
1794
1795
Damien Miller11fa2cc2000-08-16 10:35:58 +10001796AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1797 AC_TRY_LINK([],
1798 [ extern int sys_nerr; printf("%i", sys_nerr);],
1799 [ ac_cv_libc_defines_sys_nerr="yes" ],
1800 [ ac_cv_libc_defines_sys_nerr="no" ]
1801 )
1802])
1803if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1804 AC_DEFINE(HAVE_SYS_NERR)
1805fi
1806
Damien Miller85de5802001-09-18 14:01:11 +10001807SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001808# 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 Miller7abe09b2003-05-15 10:53:49 +10001857# Check whether user wants DNS support
1858DNS_MSG="no"
1859AC_ARG_WITH(dns,
1860 [ --with-dns Support for fetching keys from DNS (experimental)],
1861 [
1862 if test "x$withval" != "xno" ; then
Damien Millerd9ec3702003-05-15 12:27:08 +10001863 DNS_MSG="yes"
1864 AC_DEFINE(DNS)
1865 AC_SEARCH_LIBS(getrrsetbyname, resolv,
1866 [AC_DEFINE(HAVE_GETRRSETBYNAME)])
Damien Miller7abe09b2003-05-15 10:53:49 +10001867 fi
1868 ]
1869)
1870
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001871# Check whether user wants Kerberos 5 support
1872KRB5_MSG="no"
1873AC_ARG_WITH(kerberos5,
1874 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1875 [
1876 if test "x$withval" != "xno" ; then
1877 if test "x$withval" = "xyes" ; then
1878 KRB5ROOT="/usr/local"
1879 else
1880 KRB5ROOT=${withval}
1881 fi
1882 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1883 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1884 AC_DEFINE(KRB5)
1885 KRB5_MSG="yes"
1886 AC_MSG_CHECKING(whether we are using Heimdal)
1887 AC_TRY_COMPILE([ #include <krb5.h> ],
1888 [ char *tmp = heimdal_version; ],
1889 [ AC_MSG_RESULT(yes)
1890 AC_DEFINE(HEIMDAL)
1891 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1892 ],
1893 [ AC_MSG_RESULT(no)
1894 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1895 ]
1896 )
1897 if test ! -z "$need_dash_r" ; then
1898 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1899 fi
1900 if test ! -z "$blibpath" ; then
1901 blibpath="$blibpath:${KRB5ROOT}/lib"
1902 fi
1903 AC_CHECK_LIB(resolv, dn_expand, , )
1904
1905 KRB5=yes
1906 fi
1907 ]
1908)
1909# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001910KRB4_MSG="no"
1911AC_ARG_WITH(kerberos4,
1912 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1913 [
1914 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001915 if test "x$withval" != "xyes" ; then
1916 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1917 LDFLAGS="$LDFLAGS -L${withval}/lib"
1918 if test ! -z "$need_dash_r" ; then
1919 LDFLAGS="$LDFLAGS -R${withval}/lib"
1920 fi
1921 if test ! -z "$blibpath" ; then
1922 blibpath="$blibpath:${withval}/lib"
1923 fi
1924 else
1925 if test -d /usr/include/kerberosIV ; then
1926 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1927 fi
1928 fi
1929
1930 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001931 if test "$ac_cv_header_krb_h" != yes; then
1932 AC_MSG_WARN([Cannot find krb.h, build may fail])
1933 fi
Damien Miller98344742001-03-28 14:37:06 +10001934 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001935 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001936 AC_CHECK_LIB(krb4, main)
1937 if test "$ac_cv_lib_krb4_main" != yes; then
1938 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1939 else
1940 KLIBS="-lkrb4"
1941 fi
1942 else
1943 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001944 fi
Damien Miller98344742001-03-28 14:37:06 +10001945 AC_CHECK_LIB(des, des_cbc_encrypt)
1946 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1947 AC_CHECK_LIB(des425, des_cbc_encrypt)
1948 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1949 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1950 else
1951 KLIBS="-ldes425"
1952 fi
1953 else
1954 KLIBS="-ldes"
1955 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001956 AC_CHECK_LIB(resolv, dn_expand, , )
1957 KRB4=yes
1958 KRB4_MSG="yes"
1959 AC_DEFINE(KRB4)
1960 fi
1961 ]
1962)
1963
1964# Check whether user wants AFS support
1965AFS_MSG="no"
1966AC_ARG_WITH(afs,
1967 [ --with-afs=PATH Enable AFS support],
1968 [
1969 if test "x$withval" != "xno" ; then
1970
1971 if test "x$withval" != "xyes" ; then
1972 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1973 LDFLAGS="$LDFLAGS -L${withval}/lib"
1974 fi
1975
1976 if test -z "$KRB4" ; then
1977 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1978 fi
1979
1980 LIBS="-lkafs $LIBS"
1981 if test ! -z "$AFS_LIBS" ; then
1982 LIBS="$LIBS $AFS_LIBS"
1983 fi
1984 AC_DEFINE(AFS)
1985 AFS_MSG="yes"
1986 fi
1987 ]
1988)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001989LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001990
Damien Millera22ba012000-03-02 23:09:20 +11001991# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001992
Damien Millerf58c6722002-05-13 13:15:42 +10001993PRIVSEP_PATH=/var/empty
1994AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001995 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001996 [
1997 if test "x$withval" != "$no" ; then
1998 PRIVSEP_PATH=$withval
1999 fi
2000 ]
2001)
2002AC_SUBST(PRIVSEP_PATH)
2003
Damien Millera22ba012000-03-02 23:09:20 +11002004AC_ARG_WITH(xauth,
2005 [ --with-xauth=PATH Specify path to xauth program ],
2006 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002007 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002008 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002009 fi
2010 ],
2011 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002012 TestPath="$PATH"
2013 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2014 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2015 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2016 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2017 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002018 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002019 xauth_path="/usr/openwin/bin/xauth"
2020 fi
2021 ]
2022)
2023
Damien Miller7d901272003-01-13 16:55:22 +11002024STRIP_OPT=-s
2025AC_ARG_ENABLE(strip,
2026 [ --disable-strip Disable calling strip(1) on install],
2027 [
2028 if test "x$enableval" = "xno" ; then
2029 STRIP_OPT=
2030 fi
2031 ]
2032)
2033AC_SUBST(STRIP_OPT)
2034
Damien Millera19cf472000-11-29 13:28:50 +11002035if test -z "$xauth_path" ; then
2036 XAUTH_PATH="undefined"
2037 AC_SUBST(XAUTH_PATH)
2038else
Damien Millera22ba012000-03-02 23:09:20 +11002039 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002040 XAUTH_PATH=$xauth_path
2041 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002042fi
Damien Millera22ba012000-03-02 23:09:20 +11002043
2044# Check for mail directory (last resort if we cannot get it from headers)
2045if test ! -z "$MAIL" ; then
2046 maildir=`dirname $MAIL`
2047 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2048fi
2049
Damien Millera22ba012000-03-02 23:09:20 +11002050if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002051 if test "x$disable_ptmx_check" != "xyes" ; then
2052 AC_CHECK_FILE("/dev/ptmx",
2053 [
2054 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2055 have_dev_ptmx=1
2056 ]
2057 )
2058 fi
Damien Millera22ba012000-03-02 23:09:20 +11002059fi
Damien Miller204ad072000-03-02 23:56:12 +11002060AC_CHECK_FILE("/dev/ptc",
2061 [
2062 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2063 have_dev_ptc=1
2064 ]
2065)
2066
Damien Millera22ba012000-03-02 23:09:20 +11002067# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002068AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002069 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002070 [
Damien Miller897741e2001-04-16 10:41:46 +10002071 case "$withval" in
2072 man|cat|doc)
2073 MANTYPE=$withval
2074 ;;
2075 *)
2076 AC_MSG_ERROR(invalid man type: $withval)
2077 ;;
2078 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002079 ]
2080)
Ben Lindstrombc709922001-04-18 18:04:21 +00002081if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002082 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2083 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002084 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2085 MANTYPE=doc
2086 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2087 MANTYPE=man
2088 else
2089 MANTYPE=cat
2090 fi
2091fi
Damien Miller670a4b82000-01-22 13:53:11 +11002092AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002093if test "$MANTYPE" = "doc"; then
2094 mansubdir=man;
2095else
2096 mansubdir=$MANTYPE;
2097fi
2098AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002099
Damien Millera22ba012000-03-02 23:09:20 +11002100# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002101MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002102AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002103 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002104 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002105 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002106 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002107 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002108 fi
2109 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002110)
2111
Damien Millera22ba012000-03-02 23:09:20 +11002112# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002113AC_ARG_WITH(shadow,
2114 [ --without-shadow Disable shadow password support],
2115 [
2116 if test "x$withval" = "xno" ; then
2117 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002118 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002119 fi
2120 ]
2121)
2122
Damien Miller1f335fb2000-06-26 11:31:33 +10002123if test -z "$disable_shadow" ; then
2124 AC_MSG_CHECKING([if the systems has expire shadow information])
2125 AC_TRY_COMPILE(
2126 [
2127#include <sys/types.h>
2128#include <shadow.h>
2129 struct spwd sp;
2130 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2131 [ sp_expire_available=yes ], []
2132 )
2133
2134 if test "x$sp_expire_available" = "xyes" ; then
2135 AC_MSG_RESULT(yes)
2136 AC_DEFINE(HAS_SHADOW_EXPIRE)
2137 else
2138 AC_MSG_RESULT(no)
2139 fi
2140fi
2141
Damien Millera22ba012000-03-02 23:09:20 +11002142# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002143if test ! -z "$IPADDR_IN_DISPLAY" ; then
2144 DISPLAY_HACK_MSG="yes"
2145 AC_DEFINE(IPADDR_IN_DISPLAY)
2146else
2147 DISPLAY_HACK_MSG="no"
2148 AC_ARG_WITH(ipaddr-display,
2149 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2150 [
2151 if test "x$withval" != "xno" ; then
2152 AC_DEFINE(IPADDR_IN_DISPLAY)
2153 DISPLAY_HACK_MSG="yes"
2154 fi
2155 ]
2156 )
2157fi
Damien Miller76112de1999-12-21 11:18:08 +11002158
Tim Rice43a1c132002-04-17 21:19:14 -07002159dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2160if test $ac_cv_func_login_getcapbool = "yes" -a \
2161 $ac_cv_header_login_cap_h = "yes" ; then
2162 USES_LOGIN_CONF=yes
2163fi
Damien Millera22ba012000-03-02 23:09:20 +11002164# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002165SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002166AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002167 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002168 [
Tim Rice43a1c132002-04-17 21:19:14 -07002169 if test "$USES_LOGIN_CONF" = "yes" ; then
2170 AC_MSG_WARN([
2171--with-default-path=PATH has no effect on this system.
2172Edit /etc/login.conf instead.])
2173 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002174 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002175 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002176 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002177 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002178 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2179 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2180 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002181 AC_TRY_RUN(
2182 [
2183/* find out what STDPATH is */
2184#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002185#ifdef HAVE_PATHS_H
2186# include <paths.h>
2187#endif
2188#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002189# ifdef _PATH_USERPATH /* Irix */
2190# define _PATH_STDPATH _PATH_USERPATH
2191# else
2192# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2193# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002194#endif
2195#include <sys/types.h>
2196#include <sys/stat.h>
2197#include <fcntl.h>
2198#define DATA "conftest.stdpath"
2199
2200main()
2201{
2202 FILE *fd;
2203 int rc;
2204
2205 fd = fopen(DATA,"w");
2206 if(fd == NULL)
2207 exit(1);
2208
2209 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2210 exit(1);
2211
2212 exit(0);
2213}
2214 ], [ user_path=`cat conftest.stdpath` ],
2215 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2216 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2217 )
2218# make sure $bindir is in USER_PATH so scp will work
2219 t_bindir=`eval echo ${bindir}`
2220 case $t_bindir in
2221 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2222 esac
2223 case $t_bindir in
2224 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2225 esac
2226 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2227 if test $? -ne 0 ; then
2228 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2229 if test $? -ne 0 ; then
2230 user_path=$user_path:$t_bindir
2231 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2232 fi
2233 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002234 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002235)
Tim Rice43a1c132002-04-17 21:19:14 -07002236if test "$USES_LOGIN_CONF" != "yes" ; then
2237 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2238 AC_SUBST(user_path)
2239fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002240
Damien Millera18bbd32002-05-13 10:48:57 +10002241# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002242AC_ARG_WITH(superuser-path,
2243 [ --with-superuser-path= Specify different path for super-user],
2244 [
2245 if test "x$withval" != "xno" ; then
2246 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2247 superuser_path=$withval
2248 fi
2249 ]
2250)
2251
2252
Damien Miller61e50f12000-05-08 20:49:37 +10002253AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002254IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002255AC_ARG_WITH(4in6,
2256 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2257 [
2258 if test "x$withval" != "xno" ; then
2259 AC_MSG_RESULT(yes)
2260 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002261 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002262 else
2263 AC_MSG_RESULT(no)
2264 fi
2265 ],[
2266 if test "x$inet6_default_4in6" = "xyes"; then
2267 AC_MSG_RESULT([yes (default)])
2268 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002269 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002270 else
2271 AC_MSG_RESULT([no (default)])
2272 fi
2273 ]
2274)
2275
Damien Miller60396b02001-02-18 17:01:00 +11002276# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002277BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002278AC_ARG_WITH(bsd-auth,
2279 [ --with-bsd-auth Enable BSD auth support],
2280 [
2281 if test "x$withval" != "xno" ; then
2282 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002283 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002284 fi
2285 ]
2286)
2287
Damien Millera22ba012000-03-02 23:09:20 +11002288# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002289piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002290# make sure the directory exists
2291if test ! -d $piddir ; then
2292 piddir=`eval echo ${sysconfdir}`
2293 case $piddir in
2294 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2295 esac
2296fi
2297
Tim Rice88f2ab52002-03-17 12:17:34 -08002298AC_ARG_WITH(pid-dir,
2299 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2300 [
2301 if test "x$withval" != "xno" ; then
2302 piddir=$withval
2303 if test ! -d $piddir ; then
2304 AC_MSG_WARN([** no $piddir directory on this system **])
2305 fi
2306 fi
2307 ]
2308)
2309
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002310AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002311AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002312
andre2ff7b5d2000-06-03 14:57:40 +00002313dnl allow user to disable some login recording features
2314AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002315 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002316 [ AC_DEFINE(DISABLE_LASTLOG) ]
2317)
2318AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002319 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002320 [ AC_DEFINE(DISABLE_UTMP) ]
2321)
2322AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002323 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002324 [ AC_DEFINE(DISABLE_UTMPX) ]
2325)
2326AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002327 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002328 [ AC_DEFINE(DISABLE_WTMP) ]
2329)
2330AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002331 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002332 [ AC_DEFINE(DISABLE_WTMPX) ]
2333)
2334AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002335 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002336 [ AC_DEFINE(DISABLE_LOGIN) ]
2337)
2338AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002339 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002340 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2341)
2342AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002343 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002344 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2345)
2346AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002347 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002348 [
2349 if test "x$withval" = "xno" ; then
2350 AC_DEFINE(DISABLE_LASTLOG)
2351 else
2352 conf_lastlog_location=$withval
2353 fi
2354 ]
2355)
andre2ff7b5d2000-06-03 14:57:40 +00002356
2357dnl lastlog, [uw]tmpx? detection
2358dnl NOTE: set the paths in the platform section to avoid the
2359dnl need for command-line parameters
2360dnl lastlog and [uw]tmp are subject to a file search if all else fails
2361
2362dnl lastlog detection
2363dnl NOTE: the code itself will detect if lastlog is a directory
2364AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2365AC_TRY_COMPILE([
2366#include <sys/types.h>
2367#include <utmp.h>
2368#ifdef HAVE_LASTLOG_H
2369# include <lastlog.h>
2370#endif
Damien Miller2994e082000-06-04 15:51:47 +10002371#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002372# include <paths.h>
2373#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002374#ifdef HAVE_LOGIN_H
2375# include <login.h>
2376#endif
andre2ff7b5d2000-06-03 14:57:40 +00002377 ],
2378 [ char *lastlog = LASTLOG_FILE; ],
2379 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002380 [
2381 AC_MSG_RESULT(no)
2382 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2383 AC_TRY_COMPILE([
2384#include <sys/types.h>
2385#include <utmp.h>
2386#ifdef HAVE_LASTLOG_H
2387# include <lastlog.h>
2388#endif
2389#ifdef HAVE_PATHS_H
2390# include <paths.h>
2391#endif
2392 ],
2393 [ char *lastlog = _PATH_LASTLOG; ],
2394 [ AC_MSG_RESULT(yes) ],
2395 [
andree441aa32000-06-12 22:34:38 +00002396 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002397 system_lastlog_path=no
2398 ])
2399 ]
andre2ff7b5d2000-06-03 14:57:40 +00002400)
Damien Miller2994e082000-06-04 15:51:47 +10002401
andre2ff7b5d2000-06-03 14:57:40 +00002402if test -z "$conf_lastlog_location"; then
2403 if test x"$system_lastlog_path" = x"no" ; then
2404 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002405 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002406 conf_lastlog_location=$f
2407 fi
2408 done
2409 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002410 AC_MSG_WARN([** Cannot find lastlog **])
2411 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002412 fi
2413 fi
2414fi
2415
2416if test -n "$conf_lastlog_location"; then
2417 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2418fi
2419
2420dnl utmp detection
2421AC_MSG_CHECKING([if your system defines UTMP_FILE])
2422AC_TRY_COMPILE([
2423#include <sys/types.h>
2424#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002425#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002426# include <paths.h>
2427#endif
2428 ],
2429 [ char *utmp = UTMP_FILE; ],
2430 [ AC_MSG_RESULT(yes) ],
2431 [ AC_MSG_RESULT(no)
2432 system_utmp_path=no ]
2433)
2434if test -z "$conf_utmp_location"; then
2435 if test x"$system_utmp_path" = x"no" ; then
2436 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2437 if test -f $f ; then
2438 conf_utmp_location=$f
2439 fi
2440 done
2441 if test -z "$conf_utmp_location"; then
2442 AC_DEFINE(DISABLE_UTMP)
2443 fi
2444 fi
2445fi
2446if test -n "$conf_utmp_location"; then
2447 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2448fi
2449
2450dnl wtmp detection
2451AC_MSG_CHECKING([if your system defines WTMP_FILE])
2452AC_TRY_COMPILE([
2453#include <sys/types.h>
2454#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002455#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002456# include <paths.h>
2457#endif
2458 ],
2459 [ char *wtmp = WTMP_FILE; ],
2460 [ AC_MSG_RESULT(yes) ],
2461 [ AC_MSG_RESULT(no)
2462 system_wtmp_path=no ]
2463)
2464if test -z "$conf_wtmp_location"; then
2465 if test x"$system_wtmp_path" = x"no" ; then
2466 for f in /usr/adm/wtmp /var/log/wtmp; do
2467 if test -f $f ; then
2468 conf_wtmp_location=$f
2469 fi
2470 done
2471 if test -z "$conf_wtmp_location"; then
2472 AC_DEFINE(DISABLE_WTMP)
2473 fi
2474 fi
2475fi
2476if test -n "$conf_wtmp_location"; then
2477 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2478fi
2479
2480
2481dnl utmpx detection - I don't know any system so perverse as to require
2482dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2483dnl there, though.
2484AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2485AC_TRY_COMPILE([
2486#include <sys/types.h>
2487#include <utmp.h>
2488#ifdef HAVE_UTMPX_H
2489#include <utmpx.h>
2490#endif
Damien Miller2994e082000-06-04 15:51:47 +10002491#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002492# include <paths.h>
2493#endif
2494 ],
2495 [ char *utmpx = UTMPX_FILE; ],
2496 [ AC_MSG_RESULT(yes) ],
2497 [ AC_MSG_RESULT(no)
2498 system_utmpx_path=no ]
2499)
2500if test -z "$conf_utmpx_location"; then
2501 if test x"$system_utmpx_path" = x"no" ; then
2502 AC_DEFINE(DISABLE_UTMPX)
2503 fi
2504else
2505 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2506fi
2507
2508dnl wtmpx detection
2509AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2510AC_TRY_COMPILE([
2511#include <sys/types.h>
2512#include <utmp.h>
2513#ifdef HAVE_UTMPX_H
2514#include <utmpx.h>
2515#endif
Damien Miller2994e082000-06-04 15:51:47 +10002516#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002517# include <paths.h>
2518#endif
2519 ],
2520 [ char *wtmpx = WTMPX_FILE; ],
2521 [ AC_MSG_RESULT(yes) ],
2522 [ AC_MSG_RESULT(no)
2523 system_wtmpx_path=no ]
2524)
2525if test -z "$conf_wtmpx_location"; then
2526 if test x"$system_wtmpx_path" = x"no" ; then
2527 AC_DEFINE(DISABLE_WTMPX)
2528 fi
2529else
2530 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2531fi
2532
Damien Miller4018c192000-04-30 09:30:44 +10002533
Damien Miller29ea30d2000-03-17 10:54:15 +11002534if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002535 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2536 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002537fi
2538
Tim Rice4cec93f2002-02-26 08:40:48 -08002539dnl remove pam and dl because they are in $LIBPAM
2540if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002541 LIBS=`echo $LIBS | sed 's/-lpam //'`
2542fi
2543if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2544 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002545fi
2546
Damien Millerbac2d8a2000-09-05 16:13:06 +11002547AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002548AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2549AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002550
Damien Miller7b22d652000-06-18 14:07:04 +10002551# Print summary of options
2552
Damien Miller7b22d652000-06-18 14:07:04 +10002553# Someone please show me a better way :)
2554A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2555B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2556C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2557D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002558E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002559F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002560G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002561H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2562I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2563J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002564
2565echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002566echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002567echo " User binaries: $B"
2568echo " System binaries: $C"
2569echo " Configuration files: $D"
2570echo " Askpass program: $E"
2571echo " Manual pages: $F"
2572echo " PID file: $G"
2573echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002574if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002575echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002576else
Damien Millerf58c6722002-05-13 13:15:42 +10002577echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002578fi
Damien Millera18bbd32002-05-13 10:48:57 +10002579if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002580echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002581fi
Damien Millerf58c6722002-05-13 13:15:42 +10002582echo " Manpage format: $MANTYPE"
Damien Miller9d2be482003-05-15 11:12:19 +10002583echo " DNS support: $DNS_MSG"
Damien Miller7abe09b2003-05-15 10:53:49 +10002584echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002585echo " KerberosIV support: $KRB4_MSG"
2586echo " KerberosV support: $KRB5_MSG"
2587echo " Smartcard support: $SCARD_MSG"
2588echo " AFS support: $AFS_MSG"
2589echo " S/KEY support: $SKEY_MSG"
2590echo " TCP Wrappers support: $TCPW_MSG"
2591echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002592echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002593echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2594echo " BSD Auth support: $BSD_AUTH_MSG"
2595echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002596if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002597echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002598fi
2599
Damien Miller7b22d652000-06-18 14:07:04 +10002600echo ""
2601
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002602echo " Host: ${host}"
2603echo " Compiler: ${CC}"
2604echo " Compiler flags: ${CFLAGS}"
2605echo "Preprocessor flags: ${CPPFLAGS}"
2606echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002607echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002608
2609echo ""
2610
Damien Miller82cf0ce2000-12-20 13:34:48 +11002611if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002612 echo "PAM is enabled. You may need to install a PAM control file "
2613 echo "for sshd, otherwise password authentication may fail. "
2614 echo "Example PAM control files can be found in the contrib/ "
2615 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002616 echo ""
2617fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002618
Damien Miller6c21c512002-01-22 21:57:53 +11002619if test ! -z "$RAND_HELPER_CMDHASH" ; then
2620 echo "WARNING: you are using the builtin random number collection "
2621 echo "service. Please read WARNING.RNG and request that your OS "
2622 echo "vendor includes kernel-based random number collection in "
2623 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002624 echo ""
2625fi
Damien Miller60396b02001-02-18 17:01:00 +11002626