blob: 431c6446b01c2b042e0d5ad1c867ad7a8637d835 [file] [log] [blame]
Darren Tuckera0c0b632003-07-08 20:52:12 +10001# $Id: configure.ac,v 1.132 2003/07/08 10:52:13 dtucker Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110012AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100013AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110014AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000015AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070016AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080017AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110018AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100019AC_PATH_PROG(ENT, ent)
20AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110021AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070024AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110025
Damien Millere8bb4502001-09-25 16:39:35 +100026# System features
27AC_SYS_LARGEFILE
28
Damien Miller3f62aba2000-11-29 11:56:35 +110029if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
31fi
32
Damien Millerad833b32000-08-23 10:46:23 +100033# Use LOGIN_PROGRAM from environment if possible
34if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
36else
37 # Search for login
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
41 fi
42fi
43
Damien Miller166bd442000-03-16 10:48:25 +110044if test -z "$LD" ; then
45 LD=$CC
46fi
47AC_SUBST(LD)
48
Damien Miller166bd442000-03-16 10:48:25 +110049AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100050if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110052fi
53
Damien Millera22ba012000-03-02 23:09:20 +110054# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110055case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110056*-*-aix*)
57 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000058 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110059 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millereab4bae2003-04-29 23:22:40 +100060 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
61 if (test -z "$blibpath"); then
62 blibpath="/usr/lib:/lib:/usr/local/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110063 fi
Damien Millereab4bae2003-04-29 23:22:40 +100064 saved_LDFLAGS="$LDFLAGS"
65 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
66 if (test -z "$blibflags"); then
67 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
68 AC_TRY_LINK([], [], [blibflags=$tryflags])
69 fi
70 done
71 if (test -z "$blibflags"); then
72 AC_MSG_RESULT(not found)
73 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
74 else
75 AC_MSG_RESULT($blibflags)
76 fi
77 LDFLAGS="$saved_LDFLAGS"
Darren Tuckera0c0b632003-07-08 20:52:12 +100078 # Check for authenticate. Might be in libs.a on older AIXes
79 AC_CHECK_FUNC(authenticate, [with_aixauthenticate=1],
Tim Ricee958ed32002-07-05 07:12:33 -070080 [AC_CHECK_LIB(s,authenticate,
Darren Tuckera0c0b632003-07-08 20:52:12 +100081 [ with_aixaixauthenticate=1
Tim Ricee958ed32002-07-05 07:12:33 -070082 LIBS="$LIBS -ls"
83 ])
84 ])
Darren Tuckera0c0b632003-07-08 20:52:12 +100085 # Check if loginfailed takes 3 arguments (AIX <= 5.1)
86 if (test "x$with_aixauthenticate" = "x1" ); then
87 AC_DEFINE(WITH_AIXAUTHENTICATE)
88 AC_MSG_CHECKING(if loginfailed takes 3 arguments)
89 AC_TRY_COMPILE(
90 [#include <usersec.h>],
91 [(void)loginfailed("user","host","tty");],
92 [AC_MSG_RESULT(yes)
93 AC_DEFINE(AIX_LOGINFAILED_3ARG)],
94 [AC_MSG_RESULT(no)]
95 )
96 fi
Damien Millereca71f82000-01-20 22:38:27 +110097 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +100098 AC_DEFINE(BROKEN_REALPATH)
andre60f3c982000-06-03 16:18:19 +000099 dnl AIX handles lastlog as part of its login message
100 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000101 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000102 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100103 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100104*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100105 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800106 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100107 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000108 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100109 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100110 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000111 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000112 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700113 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000114 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100115 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000116*-*-dgux*)
117 AC_DEFINE(IP_TOS_IS_BROKEN)
118 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000119*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000120 AC_MSG_CHECKING(if we have working getaddrinfo)
121 AC_TRY_RUN([#include <mach-o/dyld.h>
122main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
123 exit(0);
124 else
125 exit(1);
126}], [AC_MSG_RESULT(working)],
127 [AC_MSG_RESULT(buggy)
128 AC_DEFINE(BROKEN_GETADDRINFO)],
129 [AC_MSG_RESULT(assume it is working)])
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000130 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000131*-*-hpux10.26)
132 if test -z "$GCC"; then
133 CFLAGS="$CFLAGS -Ae"
134 fi
135 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
136 IPADDR_IN_DISPLAY=yes
137 AC_DEFINE(HAVE_SECUREWARE)
138 AC_DEFINE(USE_PIPES)
139 AC_DEFINE(LOGIN_NO_ENDOPT)
140 AC_DEFINE(LOGIN_NEEDS_UTMPX)
141 AC_DEFINE(DISABLE_SHADOW)
142 AC_DEFINE(DISABLE_UTMP)
Damien Miller35276252003-06-03 10:14:28 +1000143 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700144 LIBS="$LIBS -lsec -lsecpw"
145 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000146 disable_ptmx_check=yes
147 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100148*-*-hpux10*)
149 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000150 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100151 fi
Kevin Steves315f8b72001-06-28 00:24:41 +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 Millerb0785672000-08-23 09:10:39 +1000154 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000155 AC_DEFINE(LOGIN_NO_ENDOPT)
156 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100157 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100158 AC_DEFINE(DISABLE_UTMP)
Damien Miller35276252003-06-03 10:14:28 +1000159 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700160 LIBS="$LIBS -lsec"
161 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100162 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000163*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000164 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100165 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100166 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100167 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000168 AC_DEFINE(LOGIN_NO_ENDOPT)
169 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100170 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100171 AC_DEFINE(DISABLE_UTMP)
Damien Miller35276252003-06-03 10:14:28 +1000172 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700173 LIBS="$LIBS -lsec"
174 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000175 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100176*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000177 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000178 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100179 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000180 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000181 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller1808f382000-01-06 12:03:12 +1100182 ;;
183*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000184 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000185 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100186 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000187 AC_DEFINE(WITH_IRIX_ARRAY)
188 AC_DEFINE(WITH_IRIX_PROJECT)
189 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000190 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000191 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000192 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100193 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100194*-*-linux*)
195 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100196 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100197 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000198 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller35276252003-06-03 10:14:28 +1000199 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100200 inet6_default_4in6=yes
Darren Tuckerc437cda2003-05-10 17:05:46 +1000201 # openpty can be in libutil, needed for controlling tty test
202 AC_SEARCH_LIBS(openpty, util)
203 # make sure that openpty does not reacquire controlling terminal
204 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
205 AC_TRY_RUN(
206 [
207#include <stdio.h>
208#include <sys/fcntl.h>
209#include <sys/types.h>
210#include <sys/wait.h>
211
212int
213main()
214{
215 pid_t pid;
216 int fd, ptyfd, ttyfd, status;
217
218 pid = fork();
219 if (pid < 0) { /* failed */
220 exit(1);
221 } else if (pid > 0) { /* parent */
222 waitpid(pid, &status, 0);
223 if (WIFEXITED(status))
224 exit(WEXITSTATUS(status));
225 else
226 exit(2);
227 } else { /* child */
228 close(0); close(1); close(2);
229 setsid();
230 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
231 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
232 if (fd >= 0)
233 exit(3); /* Acquired ctty: broken */
234 else
235 exit(0); /* Did not acquire ctty: OK */
236 }
237}
238 ],
239 [
240 AC_MSG_RESULT(yes)
241 ],
242 [
243 AC_MSG_RESULT(no)
244 AC_DEFINE(SSHD_ACQUIRES_CTTY)
245 ]
246 )
Darren Tucker3c016542003-05-02 20:48:21 +1000247 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000248 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000249 AC_DEFINE(BROKEN_CMSG_TYPE)
250 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000251 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100252 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000253mips-sony-bsd|mips-sony-newsos4)
254 AC_DEFINE(HAVE_NEWS4)
255 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000256 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100257*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000258 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100259 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100260 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100261*-*-freebsd*)
262 check_for_libcrypt_later=1
263 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000264*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000265 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100266 conf_utmp_location=/etc/utmp
267 conf_wtmp_location=/usr/adm/wtmp
268 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000269 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000270 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000271 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100272 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000273 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000274 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000275 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100276*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000277 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000278 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100279 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100280 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000281 AC_DEFINE(LOGIN_NEEDS_UTMPX)
282 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000283 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckerc437cda2003-05-10 17:05:46 +1000284 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
285 AC_DEFINE(SSHD_ACQUIRES_CTTY)
andre2ff7b5d2000-06-03 14:57:40 +0000286 # hardwire lastlog location (can't detect it on some versions)
287 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000288 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
289 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
290 if test "$sol2ver" -ge 8; then
291 AC_MSG_RESULT(yes)
292 AC_DEFINE(DISABLE_UTMP)
293 AC_DEFINE(DISABLE_WTMP)
294 else
295 AC_MSG_RESULT(no)
296 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100297 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000298*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000299 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000300 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100301 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000302 conf_utmp_location=/etc/utmp
303 conf_wtmp_location=/var/adm/wtmp
304 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000305 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000306 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000307*-ncr-sysv*)
308 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
309 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700310 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000311 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000312 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000313 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000314*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000315 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700316 # /usr/ucblib MUST NOT be searched on ReliantUNIX
317 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100318 IPADDR_IN_DISPLAY=yes
319 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000320 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000321 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700322 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
323 # Attention: always take care to bind libsocket and libnsl before libc,
324 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000325 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100326*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000327 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100328 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100329 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100330 ;;
331*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000332 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100333 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100334 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100335 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100336*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000337 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100338 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100339 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100340*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000341 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100342 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700343 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100344 RANLIB=true
345 no_dev_ptmx=1
346 AC_DEFINE(BROKEN_SYS_TERMIO_H)
347 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000348 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000349 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100350 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100351 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700352 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700353 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100354 ;;
355*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800356 if test -z "$GCC"; then
357 CFLAGS="$CFLAGS -belf"
358 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000359 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000360 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100361 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000362 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100363 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000364 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000365 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700366 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100367 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700368 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000369 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000370*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000371 AC_DEFINE(USE_PIPES)
372 AC_DEFINE(DISABLE_FD_PASSING)
373 LDFLAGS="$LDFLAGS"
374 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
375 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000376 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000377*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000378 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700379 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700380 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000381 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
382 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
383 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700384 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000385*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000386 AC_MSG_CHECKING(for Digital Unix SIA)
387 no_osfsia=""
388 AC_ARG_WITH(osfsia,
389 [ --with-osfsia Enable Digital Unix SIA],
390 [
391 if test "x$withval" = "xno" ; then
392 AC_MSG_RESULT(disabled)
393 no_osfsia=1
394 fi
395 ],
396 )
397 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000398 if test -f /etc/sia/matrix.conf; then
399 AC_MSG_RESULT(yes)
400 AC_DEFINE(HAVE_OSF_SIA)
401 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000402 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000403 LIBS="$LIBS -lsecurity -ldb -lm -laud"
404 else
405 AC_MSG_RESULT(no)
406 fi
407 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000408 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000409 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000410
411*-*-nto-qnx)
412 AC_DEFINE(USE_PIPES)
413 AC_DEFINE(NO_X11_UNIX_SOCKETS)
414 AC_DEFINE(MISSING_NFDBITS)
415 AC_DEFINE(MISSING_HOWMANY)
416 AC_DEFINE(MISSING_FD_MASK)
417 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100418esac
419
Damien Millere37bfc12000-06-05 09:37:43 +1000420# Allow user to specify flags
421AC_ARG_WITH(cflags,
422 [ --with-cflags Specify additional flags to pass to compiler],
423 [
424 if test "x$withval" != "xno" ; then
425 CFLAGS="$CFLAGS $withval"
426 fi
427 ]
428)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000429AC_ARG_WITH(cppflags,
430 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
431 [
432 if test "x$withval" != "xno"; then
433 CPPFLAGS="$CPPFLAGS $withval"
434 fi
435 ]
436)
Damien Millere37bfc12000-06-05 09:37:43 +1000437AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000438 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000439 [
440 if test "x$withval" != "xno" ; then
441 LDFLAGS="$LDFLAGS $withval"
442 fi
443 ]
444)
445AC_ARG_WITH(libs,
446 [ --with-libs Specify additional libraries to link with],
447 [
448 if test "x$withval" != "xno" ; then
449 LIBS="$LIBS $withval"
450 fi
451 ]
452)
453
Darren Tucker6eb93042003-06-29 21:30:41 +1000454AC_MSG_CHECKING(compiler and flags for sanity)
455AC_TRY_RUN([
456#include <stdio.h>
457int main(){exit(0);}
458 ],
459 [ AC_MSG_RESULT(yes) ],
460 [
461 AC_MSG_RESULT(no)
462 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
463 ]
464)
465
Tim Rice4cec93f2002-02-26 08:40:48 -0800466# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000467AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Damien Millerb16f8742003-02-24 12:47:15 +1100468 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800469 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000470 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000471 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000472 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
473 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000474 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700475 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800476 util.h utime.h utmp.h utmpx.h)
477
Damien Millera22ba012000-03-02 23:09:20 +1100478# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700479AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
480AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000481
Damien Millerdf288022001-02-18 13:07:07 +1100482dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700483if test "x$with_tcp_wrappers" != "xno" ; then
484 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
485 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
486 fi
487fi
Damien Millerdf288022001-02-18 13:07:07 +1100488
Tim Rice13aae5e2001-10-21 17:53:58 -0700489AC_CHECK_FUNC(getspnam, ,
490 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700491
Damien Miller150c8b52002-02-13 23:06:56 +1100492AC_ARG_WITH(rpath,
493 [ --without-rpath Disable auto-added -R linker paths],
494 [
495 if test "x$withval" = "xno" ; then
496 need_dash_r=""
497 fi
498 if test "x$withval" = "xyes" ; then
499 need_dash_r=1
500 fi
501 ]
502)
503
Tim Rice13aae5e2001-10-21 17:53:58 -0700504dnl zlib is required
505AC_ARG_WITH(zlib,
506 [ --with-zlib=PATH Use zlib in PATH],
507 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000508 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100509 AC_MSG_ERROR([*** zlib is required ***])
510 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700511 if test -d "$withval/lib"; then
512 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700513 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700514 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700515 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700516 fi
517 else
518 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700519 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700520 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700521 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700522 fi
523 fi
524 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700525 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700526 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700527 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700528 fi
529 ]
530)
531
Tim Rice17b93e52001-10-23 22:36:54 -0700532AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100533
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000534dnl UnixWare 2.x
535AC_CHECK_FUNC(strcasecmp,
536 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
537)
538AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700539 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
540 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000541)
Damien Millerab18c411999-11-11 10:40:23 +1100542
Tim Ricee589a292001-11-03 11:09:32 -0800543dnl Checks for libutil functions
544AC_CHECK_HEADERS(libutil.h)
545AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
546AC_CHECK_FUNCS(logout updwtmp logwtmp)
547
Ben Lindstrom8697e082001-02-24 21:41:10 +0000548AC_FUNC_STRFTIME
549
Damien Miller3c027682001-03-14 11:39:45 +1100550# Check for ALTDIRFUNC glob() extension
551AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
552AC_EGREP_CPP(FOUNDIT,
553 [
554 #include <glob.h>
555 #ifdef GLOB_ALTDIRFUNC
556 FOUNDIT
557 #endif
558 ],
559 [
560 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
561 AC_MSG_RESULT(yes)
562 ],
563 [
564 AC_MSG_RESULT(no)
565 ]
566)
Damien Millerab18c411999-11-11 10:40:23 +1100567
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000568# Check for g.gl_matchc glob() extension
569AC_MSG_CHECKING(for gl_matchc field in glob_t)
570AC_EGREP_CPP(FOUNDIT,
571 [
572 #include <glob.h>
573 int main(void){glob_t g; g.gl_matchc = 1;}
574 ],
575 [
576 AC_DEFINE(GLOB_HAS_GL_MATCHC)
577 AC_MSG_RESULT(yes)
578 ],
579 [
580 AC_MSG_RESULT(no)
581 ]
582)
583
Damien Miller18bb4732001-03-28 14:35:30 +1000584AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
585AC_TRY_RUN(
586 [
587#include <sys/types.h>
588#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700589int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000590 ],
591 [AC_MSG_RESULT(yes)],
592 [
593 AC_MSG_RESULT(no)
594 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
595 ]
596)
597
Damien Millerc547bf12001-02-16 10:18:12 +1100598# Check whether user wants S/Key support
599SKEY_MSG="no"
600AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700601 [ --with-skey[[=PATH]] Enable S/Key support
602 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100603 [
604 if test "x$withval" != "xno" ; then
605
606 if test "x$withval" != "xyes" ; then
607 CPPFLAGS="$CPPFLAGS -I${withval}/include"
608 LDFLAGS="$LDFLAGS -L${withval}/lib"
609 fi
610
611 AC_DEFINE(SKEY)
612 LIBS="-lskey $LIBS"
613 SKEY_MSG="yes"
614
Tim Rice4cec93f2002-02-26 08:40:48 -0800615 AC_MSG_CHECKING([for s/key support])
616 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100617 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800618#include <stdio.h>
619#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700620int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800621 ],
622 [AC_MSG_RESULT(yes)],
623 [
624 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100625 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
626 ])
627 fi
628 ]
629)
630
631# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700632TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100633AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700634 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
635 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100636 [
637 if test "x$withval" != "xno" ; then
638 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700639 saved_LDFLAGS="$LDFLAGS"
640 saved_CPPFLAGS="$CPPFLAGS"
641 if test -n "${withval}" -a "${withval}" != "yes"; then
642 if test -d "${withval}/lib"; then
643 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700644 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700645 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700646 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700647 fi
648 else
649 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700650 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700651 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700652 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700653 fi
654 fi
655 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700656 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700657 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700658 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700659 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700660 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800661 LIBWRAP="-lwrap"
662 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100663 AC_MSG_CHECKING(for libwrap)
664 AC_TRY_LINK(
665 [
666#include <tcpd.h>
667 int deny_severity = 0, allow_severity = 0;
668 ],
669 [hosts_access(0);],
670 [
671 AC_MSG_RESULT(yes)
672 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800673 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700674 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100675 ],
676 [
677 AC_MSG_ERROR([*** libwrap missing])
678 ]
679 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800680 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100681 fi
682 ]
683)
684
Damien Millerfe1f1432003-02-24 15:45:42 +1100685dnl Checks for library functions. Please keep in alphabetical order
686AC_CHECK_FUNCS(\
Damien Miller5fe46a42003-06-05 09:53:31 +1000687 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
688 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Damien Millerfe1f1432003-02-24 15:45:42 +1100689 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000690 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100691 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000692 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
693 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
694 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Damien Miller5fe46a42003-06-05 09:53:31 +1000695 setproctitle setregid setresgid setresuid setreuid setrlimit \
696 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
697 strlcat strlcpy strmode strnvis sysconf tcgetpgrp truncate utimes \
698 vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100699)
Tim Rice13aae5e2001-10-21 17:53:58 -0700700
Damien Millercd6853c2003-01-28 11:33:42 +1100701AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
Damien Millereab4bae2003-04-29 23:22:40 +1000702AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
Damien Millercd6853c2003-01-28 11:33:42 +1100703
Darren Tuckerf1159b52003-07-07 19:44:01 +1000704dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000705AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000706AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000707
Tim Rice13aae5e2001-10-21 17:53:58 -0700708dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700709AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700710 AC_CHECK_LIB(gen, dirname,[
711 AC_CACHE_CHECK([for broken dirname],
712 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700713 save_LIBS="$LIBS"
714 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700715 AC_TRY_RUN(
716 [
717#include <libgen.h>
718#include <string.h>
719
720int main(int argc, char **argv) {
721 char *s, buf[32];
722
723 strncpy(buf,"/etc", 32);
724 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700725 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700726 exit(1);
727 } else {
728 exit(0);
729 }
730}
731 ],
732 [ ac_cv_have_broken_dirname="no" ],
733 [ ac_cv_have_broken_dirname="yes" ]
734 )
Tim Rice17b93e52001-10-23 22:36:54 -0700735 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700736 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700737 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700738 LIBS="$LIBS -lgen"
739 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700740 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700741 fi
742 ])
743])
744
Damien Millerad833b32000-08-23 10:46:23 +1000745dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000746AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000747dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000748AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000749AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000750dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000751AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000752AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100753
Damien Miller04f80141999-11-19 15:32:34 +1100754AC_CHECK_FUNC(daemon,
755 [AC_DEFINE(HAVE_DAEMON)],
756 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
757)
758
Damien Miller9fb07e42000-03-05 16:22:59 +1100759AC_CHECK_FUNC(getpagesize,
760 [AC_DEFINE(HAVE_GETPAGESIZE)],
761 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
762)
763
Damien Millercb170cb2000-07-01 16:52:55 +1000764# Check for broken snprintf
765if test "x$ac_cv_func_snprintf" = "xyes" ; then
766 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
767 AC_TRY_RUN(
768 [
769#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700770int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000771 ],
772 [AC_MSG_RESULT(yes)],
773 [
774 AC_MSG_RESULT(no)
775 AC_DEFINE(BROKEN_SNPRINTF)
776 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
777 ]
778 )
779fi
780
Damien Millere8328192003-01-07 15:18:32 +1100781dnl see whether mkstemp() requires XXXXXX
782if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
783AC_MSG_CHECKING([for (overly) strict mkstemp])
784AC_TRY_RUN(
785 [
786#include <stdlib.h>
787main() { char template[]="conftest.mkstemp-test";
788if (mkstemp(template) == -1)
789 exit(1);
790unlink(template); exit(0);
791}
792 ],
793 [
794 AC_MSG_RESULT(no)
795 ],
796 [
797 AC_MSG_RESULT(yes)
798 AC_DEFINE(HAVE_STRICT_MKSTEMP)
799 ],
800 [
801 AC_MSG_RESULT(yes)
802 AC_DEFINE(HAVE_STRICT_MKSTEMP)
803 ]
804)
805fi
806
Damien Miller606f8802000-09-16 15:39:56 +1100807AC_FUNC_GETPGRP
808
Damien Millera64b57a2001-01-17 10:44:13 +1100809# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000810PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100811AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100812 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100813 [
Damien Millera64b57a2001-01-17 10:44:13 +1100814 if test "x$withval" != "xno" ; then
815 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
816 AC_MSG_ERROR([PAM headers not found])
817 fi
818
819 AC_CHECK_LIB(dl, dlopen, , )
820 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
821 AC_CHECK_FUNCS(pam_getenvlist)
822
823 disable_shadow=yes
824 PAM_MSG="yes"
825
826 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800827 if test $ac_cv_lib_dl_dlopen = yes; then
828 LIBPAM="-lpam -ldl"
829 else
830 LIBPAM="-lpam"
831 fi
832 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100833 fi
834 ]
835)
Damien Millera22ba012000-03-02 23:09:20 +1100836
Damien Millera64b57a2001-01-17 10:44:13 +1100837# Check for older PAM
838if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100839 # Check PAM strerror arguments (old PAM)
840 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
841 AC_TRY_COMPILE(
842 [
Damien Miller81171112000-04-23 11:14:01 +1000843#include <stdlib.h>
844#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100845 ],
846 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
847 [AC_MSG_RESULT(no)],
848 [
849 AC_DEFINE(HAVE_OLD_PAM)
850 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000851 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100852 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100853 )
Damien Millera22ba012000-03-02 23:09:20 +1100854fi
855
Damien Millerfc93d4b2002-09-04 23:26:29 +1000856# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
857# because the system crypt() is more featureful.
858if test "x$check_for_libcrypt_before" = "x1"; then
859 AC_CHECK_LIB(crypt, crypt)
860fi
861
Tim Riceaef73712002-05-11 13:17:42 -0700862# Search for OpenSSL
863saved_CPPFLAGS="$CPPFLAGS"
864saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100865AC_ARG_WITH(ssl-dir,
866 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
867 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000868 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700869 if test -d "$withval/lib"; then
870 if test -n "${need_dash_r}"; then
871 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
872 else
873 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
874 fi
875 else
876 if test -n "${need_dash_r}"; then
877 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
878 else
879 LDFLAGS="-L${withval} ${LDFLAGS}"
880 fi
881 fi
882 if test -d "$withval/include"; then
883 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
884 else
885 CPPFLAGS="-I${withval} ${CPPFLAGS}"
886 fi
Damien Millera22ba012000-03-02 23:09:20 +1100887 fi
888 ]
889)
Tim Riceaef73712002-05-11 13:17:42 -0700890LIBS="$LIBS -lcrypto"
891AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000892 [
Tim Riceaef73712002-05-11 13:17:42 -0700893 dnl Check default openssl install dir
894 if test -n "${need_dash_r}"; then
895 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000896 else
Tim Riceaef73712002-05-11 13:17:42 -0700897 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000898 fi
Tim Riceaef73712002-05-11 13:17:42 -0700899 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
900 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
901 [
902 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
903 ]
904 )
905 ]
906)
907
Tim Riced730b782002-08-13 18:52:10 -0700908# Determine OpenSSL header version
909AC_MSG_CHECKING([OpenSSL header version])
910AC_TRY_RUN(
911 [
912#include <stdio.h>
913#include <string.h>
914#include <openssl/opensslv.h>
915#define DATA "conftest.sslincver"
916int main(void) {
917 FILE *fd;
918 int rc;
919
920 fd = fopen(DATA,"w");
921 if(fd == NULL)
922 exit(1);
923
924 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
925 exit(1);
926
927 exit(0);
928}
929 ],
930 [
931 ssl_header_ver=`cat conftest.sslincver`
932 AC_MSG_RESULT($ssl_header_ver)
933 ],
934 [
935 AC_MSG_RESULT(not found)
936 AC_MSG_ERROR(OpenSSL version header not found.)
937 ]
938)
939
940# Determine OpenSSL library version
941AC_MSG_CHECKING([OpenSSL library version])
942AC_TRY_RUN(
943 [
944#include <stdio.h>
945#include <string.h>
946#include <openssl/opensslv.h>
947#include <openssl/crypto.h>
948#define DATA "conftest.ssllibver"
949int main(void) {
950 FILE *fd;
951 int rc;
952
953 fd = fopen(DATA,"w");
954 if(fd == NULL)
955 exit(1);
956
957 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
958 exit(1);
959
960 exit(0);
961}
962 ],
963 [
964 ssl_library_ver=`cat conftest.ssllibver`
965 AC_MSG_RESULT($ssl_library_ver)
966 ],
967 [
968 AC_MSG_RESULT(not found)
969 AC_MSG_ERROR(OpenSSL library not found.)
970 ]
971)
Damien Millera22ba012000-03-02 23:09:20 +1100972
Damien Millerec932372002-01-22 22:16:03 +1100973# Sanity check OpenSSL headers
974AC_MSG_CHECKING([whether OpenSSL's headers match the library])
975AC_TRY_RUN(
976 [
977#include <string.h>
978#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700979int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100980 ],
981 [
982 AC_MSG_RESULT(yes)
983 ],
984 [
985 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +1000986 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
987Check config.log for details.
988Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +1100989 ]
990)
991
Damien Millera64b57a2001-01-17 10:44:13 +1100992# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
993# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +1000994if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100995 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100996fi
997
Damien Miller6c21c512002-01-22 21:57:53 +1100998
999### Configure cryptographic random number support
1000
1001# Check wheter OpenSSL seeds itself
1002AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1003AC_TRY_RUN(
1004 [
1005#include <string.h>
1006#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001007int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001008 ],
1009 [
1010 OPENSSL_SEEDS_ITSELF=yes
1011 AC_MSG_RESULT(yes)
1012 ],
1013 [
1014 AC_MSG_RESULT(no)
1015 # Default to use of the rand helper if OpenSSL doesn't
1016 # seed itself
1017 USE_RAND_HELPER=yes
1018 ]
1019)
1020
1021
1022# Do we want to force the use of the rand helper?
1023AC_ARG_WITH(rand-helper,
1024 [ --with-rand-helper Use subprocess to gather strong randomness ],
1025 [
1026 if test "x$withval" = "xno" ; then
1027 # Force use of OpenSSL's internal RNG, even if
1028 # the previous test showed it to be unseeded.
1029 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1030 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1031 OPENSSL_SEEDS_ITSELF=yes
1032 USE_RAND_HELPER=""
1033 fi
1034 else
1035 USE_RAND_HELPER=yes
1036 fi
1037 ],
1038)
1039
1040# Which randomness source do we use?
1041if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1042 # OpenSSL only
1043 AC_DEFINE(OPENSSL_PRNG_ONLY)
1044 RAND_MSG="OpenSSL internal ONLY"
1045 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001046elif test ! -z "$USE_RAND_HELPER" ; then
1047 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001048 RAND_MSG="ssh-rand-helper"
1049 INSTALL_SSH_RAND_HELPER="yes"
1050fi
1051AC_SUBST(INSTALL_SSH_RAND_HELPER)
1052
1053### Configuration of ssh-rand-helper
1054
1055# PRNGD TCP socket
1056AC_ARG_WITH(prngd-port,
1057 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1058 [
Damien Millere996d722002-01-23 11:20:59 +11001059 case "$withval" in
1060 no)
1061 withval=""
1062 ;;
1063 [[0-9]]*)
1064 ;;
1065 *)
1066 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1067 ;;
1068 esac
1069 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001070 PRNGD_PORT="$withval"
1071 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1072 fi
1073 ]
1074)
1075
1076# PRNGD Unix domain socket
1077AC_ARG_WITH(prngd-socket,
1078 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1079 [
Damien Millere996d722002-01-23 11:20:59 +11001080 case "$withval" in
1081 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001082 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001083 ;;
1084 no)
1085 withval=""
1086 ;;
1087 /*)
1088 ;;
1089 *)
1090 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1091 ;;
1092 esac
1093
1094 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001095 if test ! -z "$PRNGD_PORT" ; then
1096 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1097 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001098 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001099 AC_MSG_WARN(Entropy socket is not readable)
1100 fi
1101 PRNGD_SOCKET="$withval"
1102 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1103 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001104 ],
1105 [
1106 # Check for existing socket only if we don't have a random device already
1107 if test "$USE_RAND_HELPER" = yes ; then
1108 AC_MSG_CHECKING(for PRNGD/EGD socket)
1109 # Insert other locations here
1110 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1111 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1112 PRNGD_SOCKET="$sock"
1113 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1114 break;
1115 fi
1116 done
1117 if test ! -z "$PRNGD_SOCKET" ; then
1118 AC_MSG_RESULT($PRNGD_SOCKET)
1119 else
1120 AC_MSG_RESULT(not found)
1121 fi
1122 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001123 ]
1124)
1125
1126# Change default command timeout for hashing entropy source
1127entropy_timeout=200
1128AC_ARG_WITH(entropy-timeout,
1129 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1130 [
1131 if test "x$withval" != "xno" ; then
1132 entropy_timeout=$withval
1133 fi
1134 ]
1135)
Damien Miller6c21c512002-01-22 21:57:53 +11001136AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1137
Damien Millerd3f6ad22002-06-25 10:24:47 +10001138SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001139AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001140 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001141 [
1142 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001143 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001144 fi
1145 ]
1146)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001147AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1148AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001149
Tim Rice88f2ab52002-03-17 12:17:34 -08001150# We do this little dance with the search path to insure
1151# that programs that we select for use by installed programs
1152# (which may be run by the super-user) come from trusted
1153# locations before they come from the user's private area.
1154# This should help avoid accidentally configuring some
1155# random version of a program in someone's personal bin.
1156
1157OPATH=$PATH
1158PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001159test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001160test -d /sbin && PATH=$PATH:/sbin
1161test -d /usr/sbin && PATH=$PATH:/usr/sbin
1162PATH=$PATH:/etc:$OPATH
1163
Damien Miller6c21c512002-01-22 21:57:53 +11001164# These programs are used by the command hashing source to gather entropy
1165OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1166OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1167OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1168OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1169OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1170OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1171OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1172OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1173OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1174OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1175OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1176OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1177OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1178OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1179OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1180OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001181# restore PATH
1182PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001183
1184# Where does ssh-rand-helper get its randomness from?
1185INSTALL_SSH_PRNG_CMDS=""
1186if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1187 if test ! -z "$PRNGD_PORT" ; then
1188 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1189 elif test ! -z "$PRNGD_SOCKET" ; then
1190 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1191 else
1192 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1193 RAND_HELPER_CMDHASH=yes
1194 INSTALL_SSH_PRNG_CMDS="yes"
1195 fi
1196fi
1197AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1198
1199
Ben Lindstromb5628642000-10-18 00:02:25 +00001200# Cheap hack to ensure NEWS-OS libraries are arranged right.
1201if test ! -z "$SONY" ; then
1202 LIBS="$LIBS -liberty";
1203fi
1204
Damien Millera22ba012000-03-02 23:09:20 +11001205# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001206AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001207AC_CHECK_SIZEOF(short int, 2)
1208AC_CHECK_SIZEOF(int, 4)
1209AC_CHECK_SIZEOF(long int, 4)
1210AC_CHECK_SIZEOF(long long int, 8)
1211
Damien Millerfa2bb692002-04-23 23:22:25 +10001212# Sanity check long long for some platforms (AIX)
1213if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1214 ac_cv_sizeof_long_long_int=0
1215fi
1216
Damien Millera22ba012000-03-02 23:09:20 +11001217# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001218AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1219 AC_TRY_COMPILE(
1220 [ #include <sys/types.h> ],
1221 [ u_int a; a = 1;],
1222 [ ac_cv_have_u_int="yes" ],
1223 [ ac_cv_have_u_int="no" ]
1224 )
1225])
1226if test "x$ac_cv_have_u_int" = "xyes" ; then
1227 AC_DEFINE(HAVE_U_INT)
1228 have_u_int=1
1229fi
1230
Damien Miller61e50f12000-05-08 20:49:37 +10001231AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1232 AC_TRY_COMPILE(
1233 [ #include <sys/types.h> ],
1234 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1235 [ ac_cv_have_intxx_t="yes" ],
1236 [ ac_cv_have_intxx_t="no" ]
1237 )
1238])
1239if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1240 AC_DEFINE(HAVE_INTXX_T)
1241 have_intxx_t=1
1242fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001243
1244if (test -z "$have_intxx_t" && \
1245 test "x$ac_cv_header_stdint_h" = "xyes")
1246then
1247 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1248 AC_TRY_COMPILE(
1249 [ #include <stdint.h> ],
1250 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1251 [
1252 AC_DEFINE(HAVE_INTXX_T)
1253 AC_MSG_RESULT(yes)
1254 ],
1255 [ AC_MSG_RESULT(no) ]
1256 )
1257fi
1258
Damien Miller578783e2000-09-23 14:12:24 +11001259AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1260 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001261 [
1262#include <sys/types.h>
1263#ifdef HAVE_STDINT_H
1264# include <stdint.h>
1265#endif
1266#include <sys/socket.h>
1267#ifdef HAVE_SYS_BITYPES_H
1268# include <sys/bitypes.h>
1269#endif
1270 ],
Damien Miller578783e2000-09-23 14:12:24 +11001271 [ int64_t a; a = 1;],
1272 [ ac_cv_have_int64_t="yes" ],
1273 [ ac_cv_have_int64_t="no" ]
1274 )
1275])
1276if test "x$ac_cv_have_int64_t" = "xyes" ; then
1277 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001278fi
1279
Damien Miller61e50f12000-05-08 20:49:37 +10001280AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1281 AC_TRY_COMPILE(
1282 [ #include <sys/types.h> ],
1283 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1284 [ ac_cv_have_u_intxx_t="yes" ],
1285 [ ac_cv_have_u_intxx_t="no" ]
1286 )
1287])
1288if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1289 AC_DEFINE(HAVE_U_INTXX_T)
1290 have_u_intxx_t=1
1291fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001292
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001293if test -z "$have_u_intxx_t" ; then
1294 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1295 AC_TRY_COMPILE(
1296 [ #include <sys/socket.h> ],
1297 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1298 [
1299 AC_DEFINE(HAVE_U_INTXX_T)
1300 AC_MSG_RESULT(yes)
1301 ],
1302 [ AC_MSG_RESULT(no) ]
1303 )
1304fi
1305
Damien Miller578783e2000-09-23 14:12:24 +11001306AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1307 AC_TRY_COMPILE(
1308 [ #include <sys/types.h> ],
1309 [ u_int64_t a; a = 1;],
1310 [ ac_cv_have_u_int64_t="yes" ],
1311 [ ac_cv_have_u_int64_t="no" ]
1312 )
1313])
1314if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1315 AC_DEFINE(HAVE_U_INT64_T)
1316 have_u_int64_t=1
1317fi
1318
Tim Rice4cec93f2002-02-26 08:40:48 -08001319if test -z "$have_u_int64_t" ; then
1320 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1321 AC_TRY_COMPILE(
1322 [ #include <sys/bitypes.h> ],
1323 [ u_int64_t a; a = 1],
1324 [
1325 AC_DEFINE(HAVE_U_INT64_T)
1326 AC_MSG_RESULT(yes)
1327 ],
1328 [ AC_MSG_RESULT(no) ]
1329 )
1330fi
1331
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001332if test -z "$have_u_intxx_t" ; then
1333 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1334 AC_TRY_COMPILE(
1335 [
1336#include <sys/types.h>
1337 ],
1338 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1339 [ ac_cv_have_uintxx_t="yes" ],
1340 [ ac_cv_have_uintxx_t="no" ]
1341 )
1342 ])
1343 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1344 AC_DEFINE(HAVE_UINTXX_T)
1345 fi
1346fi
1347
1348if test -z "$have_uintxx_t" ; then
1349 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1350 AC_TRY_COMPILE(
1351 [ #include <stdint.h> ],
1352 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1353 [
1354 AC_DEFINE(HAVE_UINTXX_T)
1355 AC_MSG_RESULT(yes)
1356 ],
1357 [ AC_MSG_RESULT(no) ]
1358 )
1359fi
1360
Damien Milleredb82922000-06-20 13:25:52 +10001361if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1362 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001363then
1364 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1365 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001366 [
1367#include <sys/bitypes.h>
1368 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001369 [
Damien Miller70494d12000-04-03 15:57:06 +10001370 int8_t a; int16_t b; int32_t c;
1371 u_int8_t e; u_int16_t f; u_int32_t g;
1372 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001373 ],
1374 [
1375 AC_DEFINE(HAVE_U_INTXX_T)
1376 AC_DEFINE(HAVE_INTXX_T)
1377 AC_MSG_RESULT(yes)
1378 ],
1379 [AC_MSG_RESULT(no)]
1380 )
1381fi
1382
Damien Miller58be7382001-09-15 21:31:54 +10001383
1384AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1385 AC_TRY_COMPILE(
1386 [
1387#include <sys/types.h>
1388 ],
1389 [ u_char foo; foo = 125; ],
1390 [ ac_cv_have_u_char="yes" ],
1391 [ ac_cv_have_u_char="no" ]
1392 )
1393])
1394if test "x$ac_cv_have_u_char" = "xyes" ; then
1395 AC_DEFINE(HAVE_U_CHAR)
1396fi
1397
Tim Rice13aae5e2001-10-21 17:53:58 -07001398TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001399
Tim Rice200a5c02002-02-26 22:12:34 -08001400AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001401
Damien Miller61e50f12000-05-08 20:49:37 +10001402AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1403 AC_TRY_COMPILE(
1404 [
1405#include <sys/types.h>
1406 ],
1407 [ size_t foo; foo = 1235; ],
1408 [ ac_cv_have_size_t="yes" ],
1409 [ ac_cv_have_size_t="no" ]
1410 )
1411])
1412if test "x$ac_cv_have_size_t" = "xyes" ; then
1413 AC_DEFINE(HAVE_SIZE_T)
1414fi
Damien Miller95058511999-12-29 10:36:45 +11001415
Damien Miller615f9392000-05-17 22:53:33 +10001416AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1417 AC_TRY_COMPILE(
1418 [
1419#include <sys/types.h>
1420 ],
1421 [ ssize_t foo; foo = 1235; ],
1422 [ ac_cv_have_ssize_t="yes" ],
1423 [ ac_cv_have_ssize_t="no" ]
1424 )
1425])
1426if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1427 AC_DEFINE(HAVE_SSIZE_T)
1428fi
1429
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001430AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1431 AC_TRY_COMPILE(
1432 [
1433#include <time.h>
1434 ],
1435 [ clock_t foo; foo = 1235; ],
1436 [ ac_cv_have_clock_t="yes" ],
1437 [ ac_cv_have_clock_t="no" ]
1438 )
1439])
1440if test "x$ac_cv_have_clock_t" = "xyes" ; then
1441 AC_DEFINE(HAVE_CLOCK_T)
1442fi
1443
Damien Millerb54b40e2000-06-23 08:23:34 +10001444AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1445 AC_TRY_COMPILE(
1446 [
1447#include <sys/types.h>
1448#include <sys/socket.h>
1449 ],
1450 [ sa_family_t foo; foo = 1235; ],
1451 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001452 [ AC_TRY_COMPILE(
1453 [
1454#include <sys/types.h>
1455#include <sys/socket.h>
1456#include <netinet/in.h>
1457 ],
1458 [ sa_family_t foo; foo = 1235; ],
1459 [ ac_cv_have_sa_family_t="yes" ],
1460
Damien Millerb54b40e2000-06-23 08:23:34 +10001461 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001462 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001463 )
1464])
1465if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1466 AC_DEFINE(HAVE_SA_FAMILY_T)
1467fi
1468
Damien Miller0f91b4e2000-06-18 15:43:25 +10001469AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1470 AC_TRY_COMPILE(
1471 [
1472#include <sys/types.h>
1473 ],
1474 [ pid_t foo; foo = 1235; ],
1475 [ ac_cv_have_pid_t="yes" ],
1476 [ ac_cv_have_pid_t="no" ]
1477 )
1478])
1479if test "x$ac_cv_have_pid_t" = "xyes" ; then
1480 AC_DEFINE(HAVE_PID_T)
1481fi
1482
1483AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1484 AC_TRY_COMPILE(
1485 [
1486#include <sys/types.h>
1487 ],
1488 [ mode_t foo; foo = 1235; ],
1489 [ ac_cv_have_mode_t="yes" ],
1490 [ ac_cv_have_mode_t="no" ]
1491 )
1492])
1493if test "x$ac_cv_have_mode_t" = "xyes" ; then
1494 AC_DEFINE(HAVE_MODE_T)
1495fi
1496
Damien Miller61e50f12000-05-08 20:49:37 +10001497
1498AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1499 AC_TRY_COMPILE(
1500 [
Damien Miller81171112000-04-23 11:14:01 +10001501#include <sys/types.h>
1502#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001503 ],
1504 [ struct sockaddr_storage s; ],
1505 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1506 [ ac_cv_have_struct_sockaddr_storage="no" ]
1507 )
1508])
1509if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1510 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1511fi
Damien Miller34132e52000-01-14 15:45:46 +11001512
Damien Miller61e50f12000-05-08 20:49:37 +10001513AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1514 AC_TRY_COMPILE(
1515 [
Damien Miller7b22d652000-06-18 14:07:04 +10001516#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001517#include <netinet/in.h>
1518 ],
1519 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1520 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1521 [ ac_cv_have_struct_sockaddr_in6="no" ]
1522 )
1523])
1524if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1525 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1526fi
Damien Miller34132e52000-01-14 15:45:46 +11001527
Damien Miller61e50f12000-05-08 20:49:37 +10001528AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1529 AC_TRY_COMPILE(
1530 [
Damien Miller7b22d652000-06-18 14:07:04 +10001531#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001532#include <netinet/in.h>
1533 ],
1534 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1535 [ ac_cv_have_struct_in6_addr="yes" ],
1536 [ ac_cv_have_struct_in6_addr="no" ]
1537 )
1538])
1539if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1540 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1541fi
Damien Miller34132e52000-01-14 15:45:46 +11001542
Damien Miller61e50f12000-05-08 20:49:37 +10001543AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1544 AC_TRY_COMPILE(
1545 [
Damien Miller81171112000-04-23 11:14:01 +10001546#include <sys/types.h>
1547#include <sys/socket.h>
1548#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001549 ],
1550 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1551 [ ac_cv_have_struct_addrinfo="yes" ],
1552 [ ac_cv_have_struct_addrinfo="no" ]
1553 )
1554])
1555if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1556 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1557fi
1558
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001559AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1560 AC_TRY_COMPILE(
1561 [ #include <sys/time.h> ],
1562 [ struct timeval tv; tv.tv_sec = 1;],
1563 [ ac_cv_have_struct_timeval="yes" ],
1564 [ ac_cv_have_struct_timeval="no" ]
1565 )
1566])
1567if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1568 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1569 have_struct_timeval=1
1570fi
1571
Tim Rice4e4dc562003-03-18 10:21:40 -08001572AC_CHECK_TYPES(struct timespec)
1573
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001574# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001575if test "x$ac_cv_have_int64_t" = "xno" -a \
1576 "x$ac_cv_sizeof_long_int" != "x8" -a \
1577 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001578 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1579 echo "an alternative compiler (I.E., GCC) before continuing."
1580 echo ""
1581 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001582else
1583dnl test snprintf (broken on SCO w/gcc)
1584 AC_TRY_RUN(
1585 [
1586#include <stdio.h>
1587#include <string.h>
1588#ifdef HAVE_SNPRINTF
1589main()
1590{
1591 char buf[50];
1592 char expected_out[50];
1593 int mazsize = 50 ;
1594#if (SIZEOF_LONG_INT == 8)
1595 long int num = 0x7fffffffffffffff;
1596#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001597 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001598#endif
1599 strcpy(expected_out, "9223372036854775807");
1600 snprintf(buf, mazsize, "%lld", num);
1601 if(strcmp(buf, expected_out) != 0)
1602 exit(1);
1603 exit(0);
1604}
1605#else
1606main() { exit(0); }
1607#endif
1608 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1609 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001610fi
1611
Damien Miller78315eb2000-09-29 23:01:36 +11001612dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001613OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1614OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1615OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1616OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1617OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001618OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001619OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1620OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001621OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001622OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1623OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1624OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1625OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001626OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1627OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1628OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1629OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001630
1631AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001632
Damien Miller61e50f12000-05-08 20:49:37 +10001633AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1634 ac_cv_have_ss_family_in_struct_ss, [
1635 AC_TRY_COMPILE(
1636 [
Damien Miller81171112000-04-23 11:14:01 +10001637#include <sys/types.h>
1638#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001639 ],
1640 [ struct sockaddr_storage s; s.ss_family = 1; ],
1641 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1642 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1643 )
1644])
1645if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1646 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1647fi
1648
Damien Miller61e50f12000-05-08 20:49:37 +10001649AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1650 ac_cv_have___ss_family_in_struct_ss, [
1651 AC_TRY_COMPILE(
1652 [
Damien Miller81171112000-04-23 11:14:01 +10001653#include <sys/types.h>
1654#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001655 ],
1656 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1657 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1658 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1659 )
1660])
1661if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1662 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1663fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001664
Damien Millerad833b32000-08-23 10:46:23 +10001665AC_CACHE_CHECK([for pw_class field in struct passwd],
1666 ac_cv_have_pw_class_in_struct_passwd, [
1667 AC_TRY_COMPILE(
1668 [
Damien Millerad833b32000-08-23 10:46:23 +10001669#include <pwd.h>
1670 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001671 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001672 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1673 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1674 )
1675])
1676if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1677 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1678fi
1679
Kevin Steves82456952001-06-22 21:14:18 +00001680AC_CACHE_CHECK([for pw_expire field in struct passwd],
1681 ac_cv_have_pw_expire_in_struct_passwd, [
1682 AC_TRY_COMPILE(
1683 [
1684#include <pwd.h>
1685 ],
1686 [ struct passwd p; p.pw_expire = 0; ],
1687 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1688 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1689 )
1690])
1691if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1692 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1693fi
1694
1695AC_CACHE_CHECK([for pw_change field in struct passwd],
1696 ac_cv_have_pw_change_in_struct_passwd, [
1697 AC_TRY_COMPILE(
1698 [
1699#include <pwd.h>
1700 ],
1701 [ struct passwd p; p.pw_change = 0; ],
1702 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1703 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1704 )
1705])
1706if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1707 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1708fi
Damien Miller61e50f12000-05-08 20:49:37 +10001709
Tim Rice28bbb0c2002-05-27 17:37:32 -07001710dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001711AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1712 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001713 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001714 [
Tim Riceae49fe62002-04-12 10:26:21 -07001715#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001716#include <sys/socket.h>
1717#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001718int main() {
1719#ifdef msg_accrights
1720exit(1);
1721#endif
1722struct msghdr m;
1723m.msg_accrights = 0;
1724exit(0);
1725}
Kevin Steves939c9db2002-03-22 17:23:25 +00001726 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001727 [ ac_cv_have_accrights_in_msghdr="yes" ],
1728 [ ac_cv_have_accrights_in_msghdr="no" ]
1729 )
1730])
1731if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1732 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1733fi
1734
Kevin Stevesa44e0352002-04-07 16:18:03 +00001735AC_CACHE_CHECK([for msg_control field in struct msghdr],
1736 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001737 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001738 [
Tim Riceae49fe62002-04-12 10:26:21 -07001739#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001740#include <sys/socket.h>
1741#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001742int main() {
1743#ifdef msg_control
1744exit(1);
1745#endif
1746struct msghdr m;
1747m.msg_control = 0;
1748exit(0);
1749}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001750 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001751 [ ac_cv_have_control_in_msghdr="yes" ],
1752 [ ac_cv_have_control_in_msghdr="no" ]
1753 )
1754])
1755if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1756 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1757fi
1758
Damien Miller61e50f12000-05-08 20:49:37 +10001759AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1760 AC_TRY_LINK([],
1761 [ extern char *__progname; printf("%s", __progname); ],
1762 [ ac_cv_libc_defines___progname="yes" ],
1763 [ ac_cv_libc_defines___progname="no" ]
1764 )
1765])
1766if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1767 AC_DEFINE(HAVE___PROGNAME)
1768fi
1769
Kevin Steves4846f4a2002-03-22 18:19:53 +00001770AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1771 AC_TRY_LINK([
1772#include <stdio.h>
1773],
1774 [ printf("%s", __FUNCTION__); ],
1775 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1776 [ ac_cv_cc_implements___FUNCTION__="no" ]
1777 )
1778])
1779if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1780 AC_DEFINE(HAVE___FUNCTION__)
1781fi
1782
1783AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1784 AC_TRY_LINK([
1785#include <stdio.h>
1786],
1787 [ printf("%s", __func__); ],
1788 [ ac_cv_cc_implements___func__="yes" ],
1789 [ ac_cv_cc_implements___func__="no" ]
1790 )
1791])
1792if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1793 AC_DEFINE(HAVE___func__)
1794fi
1795
Damien Miller4f8e6692001-07-14 13:22:53 +10001796AC_CACHE_CHECK([whether getopt has optreset support],
1797 ac_cv_have_getopt_optreset, [
1798 AC_TRY_LINK(
1799 [
1800#include <getopt.h>
1801 ],
1802 [ extern int optreset; optreset = 0; ],
1803 [ ac_cv_have_getopt_optreset="yes" ],
1804 [ ac_cv_have_getopt_optreset="no" ]
1805 )
1806])
1807if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1808 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1809fi
Damien Millera22ba012000-03-02 23:09:20 +11001810
Damien Millerecbb26d2000-07-15 14:59:14 +10001811AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1812 AC_TRY_LINK([],
1813 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1814 [ ac_cv_libc_defines_sys_errlist="yes" ],
1815 [ ac_cv_libc_defines_sys_errlist="no" ]
1816 )
1817])
1818if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1819 AC_DEFINE(HAVE_SYS_ERRLIST)
1820fi
1821
1822
Damien Miller11fa2cc2000-08-16 10:35:58 +10001823AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1824 AC_TRY_LINK([],
1825 [ extern int sys_nerr; printf("%i", sys_nerr);],
1826 [ ac_cv_libc_defines_sys_nerr="yes" ],
1827 [ ac_cv_libc_defines_sys_nerr="no" ]
1828 )
1829])
1830if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1831 AC_DEFINE(HAVE_SYS_NERR)
1832fi
1833
Damien Miller85de5802001-09-18 14:01:11 +10001834SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001835# Check whether user wants sectok support
1836AC_ARG_WITH(sectok,
1837 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001838 [
1839 if test "x$withval" != "xno" ; then
1840 if test "x$withval" != "xyes" ; then
1841 CPPFLAGS="$CPPFLAGS -I${withval}"
1842 LDFLAGS="$LDFLAGS -L${withval}"
1843 if test ! -z "$need_dash_r" ; then
1844 LDFLAGS="$LDFLAGS -R${withval}"
1845 fi
1846 if test ! -z "$blibpath" ; then
1847 blibpath="$blibpath:${withval}"
1848 fi
1849 fi
1850 AC_CHECK_HEADERS(sectok.h)
1851 if test "$ac_cv_header_sectok_h" != yes; then
1852 AC_MSG_ERROR(Can't find sectok.h)
1853 fi
1854 AC_CHECK_LIB(sectok, sectok_open)
1855 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1856 AC_MSG_ERROR(Can't find libsectok)
1857 fi
1858 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001859 AC_DEFINE(USE_SECTOK)
1860 SCARD_MSG="yes, using sectok"
1861 fi
1862 ]
1863)
1864
1865# Check whether user wants OpenSC support
1866AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001867 AC_HELP_STRING([--with-opensc=PFX],
1868 [Enable smartcard support using OpenSC]),
1869 opensc_config_prefix="$withval", opensc_config_prefix="")
1870if test x$opensc_config_prefix != x ; then
1871 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1872 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1873 if test "$OPENSC_CONFIG" != "no"; then
1874 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1875 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1876 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1877 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1878 AC_DEFINE(SMARTCARD)
1879 AC_DEFINE(USE_OPENSC)
1880 SCARD_MSG="yes, using OpenSC"
1881 fi
1882fi
Damien Miller85de5802001-09-18 14:01:11 +10001883
Damien Miller7abe09b2003-05-15 10:53:49 +10001884# Check whether user wants DNS support
1885DNS_MSG="no"
1886AC_ARG_WITH(dns,
1887 [ --with-dns Support for fetching keys from DNS (experimental)],
1888 [
1889 if test "x$withval" != "xno" ; then
Damien Millerd9ec3702003-05-15 12:27:08 +10001890 DNS_MSG="yes"
1891 AC_DEFINE(DNS)
1892 AC_SEARCH_LIBS(getrrsetbyname, resolv,
Damien Miller200d0a72003-06-30 19:21:36 +10001893 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1894 [
1895 # Needed by our getrrsetbyname()
1896 AC_SEARCH_LIBS(res_query, resolv)
1897 AC_SEARCH_LIBS(dn_expand, resolv)
1898 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10001899 fi
1900 ]
1901)
1902
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001903# Check whether user wants Kerberos 5 support
1904KRB5_MSG="no"
1905AC_ARG_WITH(kerberos5,
1906 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1907 [
1908 if test "x$withval" != "xno" ; then
1909 if test "x$withval" = "xyes" ; then
1910 KRB5ROOT="/usr/local"
1911 else
1912 KRB5ROOT=${withval}
1913 fi
1914 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1915 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1916 AC_DEFINE(KRB5)
1917 KRB5_MSG="yes"
1918 AC_MSG_CHECKING(whether we are using Heimdal)
1919 AC_TRY_COMPILE([ #include <krb5.h> ],
1920 [ char *tmp = heimdal_version; ],
1921 [ AC_MSG_RESULT(yes)
1922 AC_DEFINE(HEIMDAL)
1923 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1924 ],
1925 [ AC_MSG_RESULT(no)
1926 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1927 ]
1928 )
1929 if test ! -z "$need_dash_r" ; then
1930 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1931 fi
1932 if test ! -z "$blibpath" ; then
1933 blibpath="$blibpath:${KRB5ROOT}/lib"
1934 fi
Damien Miller200d0a72003-06-30 19:21:36 +10001935 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001936
1937 KRB5=yes
1938 fi
1939 ]
1940)
1941# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001942KRB4_MSG="no"
1943AC_ARG_WITH(kerberos4,
1944 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1945 [
1946 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001947 if test "x$withval" != "xyes" ; then
1948 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1949 LDFLAGS="$LDFLAGS -L${withval}/lib"
1950 if test ! -z "$need_dash_r" ; then
1951 LDFLAGS="$LDFLAGS -R${withval}/lib"
1952 fi
1953 if test ! -z "$blibpath" ; then
1954 blibpath="$blibpath:${withval}/lib"
1955 fi
1956 else
1957 if test -d /usr/include/kerberosIV ; then
1958 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1959 fi
1960 fi
1961
1962 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001963 if test "$ac_cv_header_krb_h" != yes; then
1964 AC_MSG_WARN([Cannot find krb.h, build may fail])
1965 fi
Damien Miller98344742001-03-28 14:37:06 +10001966 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001967 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001968 AC_CHECK_LIB(krb4, main)
1969 if test "$ac_cv_lib_krb4_main" != yes; then
1970 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1971 else
1972 KLIBS="-lkrb4"
1973 fi
1974 else
1975 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001976 fi
Damien Miller98344742001-03-28 14:37:06 +10001977 AC_CHECK_LIB(des, des_cbc_encrypt)
1978 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1979 AC_CHECK_LIB(des425, des_cbc_encrypt)
1980 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1981 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1982 else
1983 KLIBS="-ldes425"
1984 fi
1985 else
1986 KLIBS="-ldes"
1987 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001988 AC_CHECK_LIB(resolv, dn_expand, , )
1989 KRB4=yes
1990 KRB4_MSG="yes"
1991 AC_DEFINE(KRB4)
1992 fi
1993 ]
1994)
1995
1996# Check whether user wants AFS support
1997AFS_MSG="no"
1998AC_ARG_WITH(afs,
1999 [ --with-afs=PATH Enable AFS support],
2000 [
2001 if test "x$withval" != "xno" ; then
2002
2003 if test "x$withval" != "xyes" ; then
2004 CPPFLAGS="$CPPFLAGS -I${withval}/include"
2005 LDFLAGS="$LDFLAGS -L${withval}/lib"
2006 fi
2007
2008 if test -z "$KRB4" ; then
2009 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
2010 fi
2011
2012 LIBS="-lkafs $LIBS"
2013 if test ! -z "$AFS_LIBS" ; then
2014 LIBS="$LIBS $AFS_LIBS"
2015 fi
2016 AC_DEFINE(AFS)
2017 AFS_MSG="yes"
2018 fi
2019 ]
2020)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002021LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002022
Damien Millera22ba012000-03-02 23:09:20 +11002023# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002024
Damien Millerf58c6722002-05-13 13:15:42 +10002025PRIVSEP_PATH=/var/empty
2026AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002027 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002028 [
2029 if test "x$withval" != "$no" ; then
2030 PRIVSEP_PATH=$withval
2031 fi
2032 ]
2033)
2034AC_SUBST(PRIVSEP_PATH)
2035
Damien Millera22ba012000-03-02 23:09:20 +11002036AC_ARG_WITH(xauth,
2037 [ --with-xauth=PATH Specify path to xauth program ],
2038 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002039 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002040 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002041 fi
2042 ],
2043 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002044 TestPath="$PATH"
2045 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2046 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2047 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2048 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2049 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002050 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002051 xauth_path="/usr/openwin/bin/xauth"
2052 fi
2053 ]
2054)
2055
Damien Miller7d901272003-01-13 16:55:22 +11002056STRIP_OPT=-s
2057AC_ARG_ENABLE(strip,
2058 [ --disable-strip Disable calling strip(1) on install],
2059 [
2060 if test "x$enableval" = "xno" ; then
2061 STRIP_OPT=
2062 fi
2063 ]
2064)
2065AC_SUBST(STRIP_OPT)
2066
Damien Millera19cf472000-11-29 13:28:50 +11002067if test -z "$xauth_path" ; then
2068 XAUTH_PATH="undefined"
2069 AC_SUBST(XAUTH_PATH)
2070else
Damien Millera22ba012000-03-02 23:09:20 +11002071 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002072 XAUTH_PATH=$xauth_path
2073 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002074fi
Damien Millera22ba012000-03-02 23:09:20 +11002075
2076# Check for mail directory (last resort if we cannot get it from headers)
2077if test ! -z "$MAIL" ; then
2078 maildir=`dirname $MAIL`
2079 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2080fi
2081
Damien Millera22ba012000-03-02 23:09:20 +11002082if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002083 if test "x$disable_ptmx_check" != "xyes" ; then
2084 AC_CHECK_FILE("/dev/ptmx",
2085 [
2086 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2087 have_dev_ptmx=1
2088 ]
2089 )
2090 fi
Damien Millera22ba012000-03-02 23:09:20 +11002091fi
Damien Miller204ad072000-03-02 23:56:12 +11002092AC_CHECK_FILE("/dev/ptc",
2093 [
2094 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2095 have_dev_ptc=1
2096 ]
2097)
2098
Damien Millera22ba012000-03-02 23:09:20 +11002099# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002100AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002101 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002102 [
Damien Miller897741e2001-04-16 10:41:46 +10002103 case "$withval" in
2104 man|cat|doc)
2105 MANTYPE=$withval
2106 ;;
2107 *)
2108 AC_MSG_ERROR(invalid man type: $withval)
2109 ;;
2110 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002111 ]
2112)
Ben Lindstrombc709922001-04-18 18:04:21 +00002113if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002114 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2115 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002116 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2117 MANTYPE=doc
2118 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2119 MANTYPE=man
2120 else
2121 MANTYPE=cat
2122 fi
2123fi
Damien Miller670a4b82000-01-22 13:53:11 +11002124AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002125if test "$MANTYPE" = "doc"; then
2126 mansubdir=man;
2127else
2128 mansubdir=$MANTYPE;
2129fi
2130AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002131
Damien Millera22ba012000-03-02 23:09:20 +11002132# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002133MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002134AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002135 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002136 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002137 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002138 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002139 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002140 fi
2141 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002142)
2143
Damien Millera22ba012000-03-02 23:09:20 +11002144# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002145AC_ARG_WITH(shadow,
2146 [ --without-shadow Disable shadow password support],
2147 [
2148 if test "x$withval" = "xno" ; then
2149 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002150 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002151 fi
2152 ]
2153)
2154
Damien Miller1f335fb2000-06-26 11:31:33 +10002155if test -z "$disable_shadow" ; then
2156 AC_MSG_CHECKING([if the systems has expire shadow information])
2157 AC_TRY_COMPILE(
2158 [
2159#include <sys/types.h>
2160#include <shadow.h>
2161 struct spwd sp;
2162 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2163 [ sp_expire_available=yes ], []
2164 )
2165
2166 if test "x$sp_expire_available" = "xyes" ; then
2167 AC_MSG_RESULT(yes)
2168 AC_DEFINE(HAS_SHADOW_EXPIRE)
2169 else
2170 AC_MSG_RESULT(no)
2171 fi
2172fi
2173
Damien Millera22ba012000-03-02 23:09:20 +11002174# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002175if test ! -z "$IPADDR_IN_DISPLAY" ; then
2176 DISPLAY_HACK_MSG="yes"
2177 AC_DEFINE(IPADDR_IN_DISPLAY)
2178else
2179 DISPLAY_HACK_MSG="no"
2180 AC_ARG_WITH(ipaddr-display,
2181 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2182 [
2183 if test "x$withval" != "xno" ; then
2184 AC_DEFINE(IPADDR_IN_DISPLAY)
2185 DISPLAY_HACK_MSG="yes"
2186 fi
2187 ]
2188 )
2189fi
Damien Miller76112de1999-12-21 11:18:08 +11002190
Tim Rice43a1c132002-04-17 21:19:14 -07002191dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2192if test $ac_cv_func_login_getcapbool = "yes" -a \
2193 $ac_cv_header_login_cap_h = "yes" ; then
2194 USES_LOGIN_CONF=yes
2195fi
Damien Millera22ba012000-03-02 23:09:20 +11002196# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002197SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002198AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002199 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002200 [
Tim Rice43a1c132002-04-17 21:19:14 -07002201 if test "$USES_LOGIN_CONF" = "yes" ; then
2202 AC_MSG_WARN([
2203--with-default-path=PATH has no effect on this system.
2204Edit /etc/login.conf instead.])
2205 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002206 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002207 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002208 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002209 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002210 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2211 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2212 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002213 AC_TRY_RUN(
2214 [
2215/* find out what STDPATH is */
2216#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002217#ifdef HAVE_PATHS_H
2218# include <paths.h>
2219#endif
2220#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002221# ifdef _PATH_USERPATH /* Irix */
2222# define _PATH_STDPATH _PATH_USERPATH
2223# else
2224# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2225# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002226#endif
2227#include <sys/types.h>
2228#include <sys/stat.h>
2229#include <fcntl.h>
2230#define DATA "conftest.stdpath"
2231
2232main()
2233{
2234 FILE *fd;
2235 int rc;
2236
2237 fd = fopen(DATA,"w");
2238 if(fd == NULL)
2239 exit(1);
2240
2241 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2242 exit(1);
2243
2244 exit(0);
2245}
2246 ], [ user_path=`cat conftest.stdpath` ],
2247 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2248 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2249 )
2250# make sure $bindir is in USER_PATH so scp will work
2251 t_bindir=`eval echo ${bindir}`
2252 case $t_bindir in
2253 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2254 esac
2255 case $t_bindir in
2256 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2257 esac
2258 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2259 if test $? -ne 0 ; then
2260 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2261 if test $? -ne 0 ; then
2262 user_path=$user_path:$t_bindir
2263 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2264 fi
2265 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002266 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002267)
Tim Rice43a1c132002-04-17 21:19:14 -07002268if test "$USES_LOGIN_CONF" != "yes" ; then
2269 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2270 AC_SUBST(user_path)
2271fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002272
Damien Millera18bbd32002-05-13 10:48:57 +10002273# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002274AC_ARG_WITH(superuser-path,
2275 [ --with-superuser-path= Specify different path for super-user],
2276 [
2277 if test "x$withval" != "xno" ; then
2278 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2279 superuser_path=$withval
2280 fi
2281 ]
2282)
2283
2284
Damien Miller61e50f12000-05-08 20:49:37 +10002285AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002286IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002287AC_ARG_WITH(4in6,
2288 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2289 [
2290 if test "x$withval" != "xno" ; then
2291 AC_MSG_RESULT(yes)
2292 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002293 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002294 else
2295 AC_MSG_RESULT(no)
2296 fi
2297 ],[
2298 if test "x$inet6_default_4in6" = "xyes"; then
2299 AC_MSG_RESULT([yes (default)])
2300 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002301 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002302 else
2303 AC_MSG_RESULT([no (default)])
2304 fi
2305 ]
2306)
2307
Damien Miller60396b02001-02-18 17:01:00 +11002308# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002309BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002310AC_ARG_WITH(bsd-auth,
2311 [ --with-bsd-auth Enable BSD auth support],
2312 [
2313 if test "x$withval" != "xno" ; then
2314 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002315 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002316 fi
2317 ]
2318)
2319
Damien Millera22ba012000-03-02 23:09:20 +11002320# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002321piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002322# make sure the directory exists
2323if test ! -d $piddir ; then
2324 piddir=`eval echo ${sysconfdir}`
2325 case $piddir in
2326 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2327 esac
2328fi
2329
Tim Rice88f2ab52002-03-17 12:17:34 -08002330AC_ARG_WITH(pid-dir,
2331 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2332 [
2333 if test "x$withval" != "xno" ; then
2334 piddir=$withval
2335 if test ! -d $piddir ; then
2336 AC_MSG_WARN([** no $piddir directory on this system **])
2337 fi
2338 fi
2339 ]
2340)
2341
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002342AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002343AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002344
andre2ff7b5d2000-06-03 14:57:40 +00002345dnl allow user to disable some login recording features
2346AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002347 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002348 [
2349 if test "x$enableval" = "xno" ; then
2350 AC_DEFINE(DISABLE_LASTLOG)
2351 fi
2352 ]
andre2ff7b5d2000-06-03 14:57:40 +00002353)
2354AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002355 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002356 [
2357 if test "x$enableval" = "xno" ; then
2358 AC_DEFINE(DISABLE_UTMP)
2359 fi
2360 ]
andre2ff7b5d2000-06-03 14:57:40 +00002361)
2362AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002363 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002364 [
2365 if test "x$enableval" = "xno" ; then
2366 AC_DEFINE(DISABLE_UTMPX)
2367 fi
2368 ]
andre2ff7b5d2000-06-03 14:57:40 +00002369)
2370AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002371 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002372 [
2373 if test "x$enableval" = "xno" ; then
2374 AC_DEFINE(DISABLE_WTMP)
2375 fi
2376 ]
andre2ff7b5d2000-06-03 14:57:40 +00002377)
2378AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002379 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002380 [
2381 if test "x$enableval" = "xno" ; then
2382 AC_DEFINE(DISABLE_WTMPX)
2383 fi
2384 ]
andre2ff7b5d2000-06-03 14:57:40 +00002385)
2386AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002387 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002388 [
2389 if test "x$enableval" = "xno" ; then
2390 AC_DEFINE(DISABLE_LOGIN)
2391 fi
2392 ]
andre2ff7b5d2000-06-03 14:57:40 +00002393)
2394AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002395 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002396 [
2397 if test "x$enableval" = "xno" ; then
2398 AC_DEFINE(DISABLE_PUTUTLINE)
2399 fi
2400 ]
andre2ff7b5d2000-06-03 14:57:40 +00002401)
2402AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002403 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002404 [
2405 if test "x$enableval" = "xno" ; then
2406 AC_DEFINE(DISABLE_PUTUTXLINE)
2407 fi
2408 ]
andre2ff7b5d2000-06-03 14:57:40 +00002409)
2410AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002411 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002412 [
2413 if test "x$withval" = "xno" ; then
2414 AC_DEFINE(DISABLE_LASTLOG)
2415 else
2416 conf_lastlog_location=$withval
2417 fi
2418 ]
2419)
andre2ff7b5d2000-06-03 14:57:40 +00002420
2421dnl lastlog, [uw]tmpx? detection
2422dnl NOTE: set the paths in the platform section to avoid the
2423dnl need for command-line parameters
2424dnl lastlog and [uw]tmp are subject to a file search if all else fails
2425
2426dnl lastlog detection
2427dnl NOTE: the code itself will detect if lastlog is a directory
2428AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2429AC_TRY_COMPILE([
2430#include <sys/types.h>
2431#include <utmp.h>
2432#ifdef HAVE_LASTLOG_H
2433# include <lastlog.h>
2434#endif
Damien Miller2994e082000-06-04 15:51:47 +10002435#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002436# include <paths.h>
2437#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002438#ifdef HAVE_LOGIN_H
2439# include <login.h>
2440#endif
andre2ff7b5d2000-06-03 14:57:40 +00002441 ],
2442 [ char *lastlog = LASTLOG_FILE; ],
2443 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002444 [
2445 AC_MSG_RESULT(no)
2446 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2447 AC_TRY_COMPILE([
2448#include <sys/types.h>
2449#include <utmp.h>
2450#ifdef HAVE_LASTLOG_H
2451# include <lastlog.h>
2452#endif
2453#ifdef HAVE_PATHS_H
2454# include <paths.h>
2455#endif
2456 ],
2457 [ char *lastlog = _PATH_LASTLOG; ],
2458 [ AC_MSG_RESULT(yes) ],
2459 [
andree441aa32000-06-12 22:34:38 +00002460 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002461 system_lastlog_path=no
2462 ])
2463 ]
andre2ff7b5d2000-06-03 14:57:40 +00002464)
Damien Miller2994e082000-06-04 15:51:47 +10002465
andre2ff7b5d2000-06-03 14:57:40 +00002466if test -z "$conf_lastlog_location"; then
2467 if test x"$system_lastlog_path" = x"no" ; then
2468 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002469 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002470 conf_lastlog_location=$f
2471 fi
2472 done
2473 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002474 AC_MSG_WARN([** Cannot find lastlog **])
2475 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002476 fi
2477 fi
2478fi
2479
2480if test -n "$conf_lastlog_location"; then
2481 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2482fi
2483
2484dnl utmp detection
2485AC_MSG_CHECKING([if your system defines UTMP_FILE])
2486AC_TRY_COMPILE([
2487#include <sys/types.h>
2488#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002489#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002490# include <paths.h>
2491#endif
2492 ],
2493 [ char *utmp = UTMP_FILE; ],
2494 [ AC_MSG_RESULT(yes) ],
2495 [ AC_MSG_RESULT(no)
2496 system_utmp_path=no ]
2497)
2498if test -z "$conf_utmp_location"; then
2499 if test x"$system_utmp_path" = x"no" ; then
2500 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2501 if test -f $f ; then
2502 conf_utmp_location=$f
2503 fi
2504 done
2505 if test -z "$conf_utmp_location"; then
2506 AC_DEFINE(DISABLE_UTMP)
2507 fi
2508 fi
2509fi
2510if test -n "$conf_utmp_location"; then
2511 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2512fi
2513
2514dnl wtmp detection
2515AC_MSG_CHECKING([if your system defines WTMP_FILE])
2516AC_TRY_COMPILE([
2517#include <sys/types.h>
2518#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002519#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002520# include <paths.h>
2521#endif
2522 ],
2523 [ char *wtmp = WTMP_FILE; ],
2524 [ AC_MSG_RESULT(yes) ],
2525 [ AC_MSG_RESULT(no)
2526 system_wtmp_path=no ]
2527)
2528if test -z "$conf_wtmp_location"; then
2529 if test x"$system_wtmp_path" = x"no" ; then
2530 for f in /usr/adm/wtmp /var/log/wtmp; do
2531 if test -f $f ; then
2532 conf_wtmp_location=$f
2533 fi
2534 done
2535 if test -z "$conf_wtmp_location"; then
2536 AC_DEFINE(DISABLE_WTMP)
2537 fi
2538 fi
2539fi
2540if test -n "$conf_wtmp_location"; then
2541 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2542fi
2543
2544
2545dnl utmpx detection - I don't know any system so perverse as to require
2546dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2547dnl there, though.
2548AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2549AC_TRY_COMPILE([
2550#include <sys/types.h>
2551#include <utmp.h>
2552#ifdef HAVE_UTMPX_H
2553#include <utmpx.h>
2554#endif
Damien Miller2994e082000-06-04 15:51:47 +10002555#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002556# include <paths.h>
2557#endif
2558 ],
2559 [ char *utmpx = UTMPX_FILE; ],
2560 [ AC_MSG_RESULT(yes) ],
2561 [ AC_MSG_RESULT(no)
2562 system_utmpx_path=no ]
2563)
2564if test -z "$conf_utmpx_location"; then
2565 if test x"$system_utmpx_path" = x"no" ; then
2566 AC_DEFINE(DISABLE_UTMPX)
2567 fi
2568else
2569 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2570fi
2571
2572dnl wtmpx detection
2573AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2574AC_TRY_COMPILE([
2575#include <sys/types.h>
2576#include <utmp.h>
2577#ifdef HAVE_UTMPX_H
2578#include <utmpx.h>
2579#endif
Damien Miller2994e082000-06-04 15:51:47 +10002580#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002581# include <paths.h>
2582#endif
2583 ],
2584 [ char *wtmpx = WTMPX_FILE; ],
2585 [ AC_MSG_RESULT(yes) ],
2586 [ AC_MSG_RESULT(no)
2587 system_wtmpx_path=no ]
2588)
2589if test -z "$conf_wtmpx_location"; then
2590 if test x"$system_wtmpx_path" = x"no" ; then
2591 AC_DEFINE(DISABLE_WTMPX)
2592 fi
2593else
2594 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2595fi
2596
Damien Miller4018c192000-04-30 09:30:44 +10002597
Damien Miller29ea30d2000-03-17 10:54:15 +11002598if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002599 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2600 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002601fi
2602
Tim Rice4cec93f2002-02-26 08:40:48 -08002603dnl remove pam and dl because they are in $LIBPAM
2604if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002605 LIBS=`echo $LIBS | sed 's/-lpam //'`
2606fi
2607if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2608 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002609fi
2610
Damien Millerbac2d8a2000-09-05 16:13:06 +11002611AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002612AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2613AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002614
Damien Miller7b22d652000-06-18 14:07:04 +10002615# Print summary of options
2616
Damien Miller7b22d652000-06-18 14:07:04 +10002617# Someone please show me a better way :)
2618A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2619B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2620C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2621D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002622E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002623F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002624G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002625H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2626I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2627J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002628
2629echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002630echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002631echo " User binaries: $B"
2632echo " System binaries: $C"
2633echo " Configuration files: $D"
2634echo " Askpass program: $E"
2635echo " Manual pages: $F"
2636echo " PID file: $G"
2637echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002638if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002639echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002640else
Damien Millerf58c6722002-05-13 13:15:42 +10002641echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002642fi
Damien Millera18bbd32002-05-13 10:48:57 +10002643if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002644echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002645fi
Damien Millerf58c6722002-05-13 13:15:42 +10002646echo " Manpage format: $MANTYPE"
Damien Miller9d2be482003-05-15 11:12:19 +10002647echo " DNS support: $DNS_MSG"
Damien Miller7abe09b2003-05-15 10:53:49 +10002648echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002649echo " KerberosIV support: $KRB4_MSG"
2650echo " KerberosV support: $KRB5_MSG"
2651echo " Smartcard support: $SCARD_MSG"
2652echo " AFS support: $AFS_MSG"
2653echo " S/KEY support: $SKEY_MSG"
2654echo " TCP Wrappers support: $TCPW_MSG"
2655echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002656echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002657echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2658echo " BSD Auth support: $BSD_AUTH_MSG"
2659echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002660if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002661echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002662fi
2663
Damien Miller7b22d652000-06-18 14:07:04 +10002664echo ""
2665
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002666echo " Host: ${host}"
2667echo " Compiler: ${CC}"
2668echo " Compiler flags: ${CFLAGS}"
2669echo "Preprocessor flags: ${CPPFLAGS}"
2670echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002671echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002672
2673echo ""
2674
Damien Miller82cf0ce2000-12-20 13:34:48 +11002675if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002676 echo "PAM is enabled. You may need to install a PAM control file "
2677 echo "for sshd, otherwise password authentication may fail. "
2678 echo "Example PAM control files can be found in the contrib/ "
2679 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002680 echo ""
2681fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002682
Damien Miller6c21c512002-01-22 21:57:53 +11002683if test ! -z "$RAND_HELPER_CMDHASH" ; then
2684 echo "WARNING: you are using the builtin random number collection "
2685 echo "service. Please read WARNING.RNG and request that your OS "
2686 echo "vendor includes kernel-based random number collection in "
2687 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002688 echo ""
2689fi
Damien Miller60396b02001-02-18 17:01:00 +11002690