]> andersk Git - openssh.git/blame - configure.ac
- (dtucker) [configure.ac] Bug #1126: AIX 5.2 and 5.3 (and presumably newer,
[openssh.git] / configure.ac
CommitLineData
eb5d7ff6 1# $Id$
2b983b95 2#
3# Copyright (c) 1999-2004 Damien Miller
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0b202697 16
76e6410a 17AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org)
98a7c37b 18AC_CONFIG_SRCDIR([ssh.c])
5881cd60 19
20AC_CONFIG_HEADER(config.h)
b14b2ae7 21AC_PROG_CC
a7effaac 22AC_CANONICAL_HOST
cf0c5df5 23AC_C_BIGENDIAN
5881cd60 24
a0391976 25# Checks for programs.
4bbf95fa 26AC_PROG_AWK
4cca272e 27AC_PROG_CPP
5881cd60 28AC_PROG_RANLIB
cf8dd513 29AC_PROG_INSTALL
bee0a37e 30AC_PATH_PROG(AR, ar)
ddd8c95b 31AC_PATH_PROG(CAT, cat)
32AC_PATH_PROG(KILL, kill)
13dd877b 33AC_PATH_PROGS(PERL, perl5 perl)
c3690df3 34AC_PATH_PROG(SED, sed)
a0f84251 35AC_SUBST(PERL)
ad85db64 36AC_PATH_PROG(ENT, ent)
37AC_SUBST(ENT)
6958bd37 38AC_PATH_PROG(TEST_MINUS_S_SH, bash)
39AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
40AC_PATH_PROG(TEST_MINUS_S_SH, sh)
6193497b 41AC_PATH_PROG(SH, sh)
a3245b92 42AC_SUBST(TEST_SHELL,sh)
f498ed15 43
9cefe228 44dnl for buildpkg.sh
45AC_PATH_PROG(PATH_GROUPADD_PROG, groupadd, groupadd,
46 [/usr/sbin${PATH_SEPARATOR}/etc])
47AC_PATH_PROG(PATH_USERADD_PROG, useradd, useradd,
48 [/usr/sbin${PATH_SEPARATOR}/etc])
49AC_CHECK_PROG(MAKE_PACKAGE_SUPPORTED, pkgmk, yes, no)
50
948fd8b9 51# System features
52AC_SYS_LARGEFILE
53
c193d002 54if test -z "$AR" ; then
55 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
56fi
57
2e73a022 58# Use LOGIN_PROGRAM from environment if possible
59if test ! -z "$LOGIN_PROGRAM" ; then
3466e002 60 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM",
61 [If your header files don't define LOGIN_PROGRAM,
62 then use this (detected) from environment and PATH])
2e73a022 63else
64 # Search for login
65 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
66 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
67 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
68 fi
69fi
70
37656beb 71AC_PATH_PROG(PATH_PASSWD_PROG, passwd)
72if test ! -z "$PATH_PASSWD_PROG" ; then
3466e002 73 AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG",
74 [Full path of your "passwd" program])
37656beb 75fi
76
d423d822 77if test -z "$LD" ; then
78 LD=$CC
79fi
80AC_SUBST(LD)
82f4e93d 81
d423d822 82AC_C_INLINE
dfafb2e1 83
84AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include <limits.h>])
85
aff51935 86if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
af40ca44 87 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized"
eeee8237 88 GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'`
5fdabf45 89 case $GCC_VER in
90 1.*) ;;
91 2.8* | 2.9*) CFLAGS="$CFLAGS -Wsign-compare" ;;
92 2.*) ;;
dbf07ba2 93 3.*) CFLAGS="$CFLAGS -Wsign-compare" ;;
cd595991 94 4.*) CFLAGS="$CFLAGS -Wsign-compare -Wno-pointer-sign" ;;
95 *) ;;
5fdabf45 96 esac
8a3ff1aa 97
dfafb2e1 98 if test -z "$have_llong_max"; then
99 # retry LLONG_MAX with -std=gnu99, needed on some Linuxes
100 unset ac_cv_have_decl_LLONG_MAX
101 saved_CFLAGS="$CFLAGS"
102 CFLAGS="$CFLAGS -std=gnu99"
103 AC_CHECK_DECL(LLONG_MAX,
104 [have_llong_max=1],
105 [CFLAGS="$saved_CFLAGS"],
106 [#include <limits.h>]
107 )
108 fi
d423d822 109fi
110
e6354014 111AC_ARG_WITH(rpath,
112 [ --without-rpath Disable auto-added -R linker paths],
113 [
82f4e93d 114 if test "x$withval" = "xno" ; then
e6354014 115 need_dash_r=""
116 fi
117 if test "x$withval" = "xyes" ; then
118 need_dash_r=1
119 fi
120 ]
121)
122
a0391976 123# Check for some target-specific stuff
a7effaac 124case "$host" in
9d6b1b96 125*-*-aix*)
aff51935 126 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
68ece370 127 if (test -z "$blibpath"); then
0a15d73b 128 blibpath="/usr/lib:/lib"
68ece370 129 fi
130 saved_LDFLAGS="$LDFLAGS"
131 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
132 if (test -z "$blibflags"); then
133 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
134 AC_TRY_LINK([], [], [blibflags=$tryflags])
135 fi
136 done
137 if (test -z "$blibflags"); then
138 AC_MSG_RESULT(not found)
139 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
140 else
141 AC_MSG_RESULT($blibflags)
bd499f9e 142 fi
68ece370 143 LDFLAGS="$saved_LDFLAGS"
e351e493 144 dnl Check for authenticate. Might be in libs.a on older AIXes
3466e002 145 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE, 1,
146 [Define if you want to enable AIX4's authenticate function])],
0764e748 147 [AC_CHECK_LIB(s,authenticate,
e351e493 148 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
0764e748 149 LIBS="$LIBS -ls"
150 ])
151 ])
ba603e06 152 dnl Check for various auth function declarations in headers.
c85ed8e2 153 AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess,
72ad335d 154 passwdexpired, setauthdb], , , [#include <usersec.h>])
e351e493 155 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
ba603e06 156 AC_CHECK_DECLS(loginfailed,
e351e493 157 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
158 AC_TRY_COMPILE(
f58c0e01 159 [#include <usersec.h>],
e351e493 160 [(void)loginfailed("user","host","tty",0);],
161 [AC_MSG_RESULT(yes)
3466e002 162 AC_DEFINE(AIX_LOGINFAILED_4ARG, 1,
163 [Define if your AIX loginfailed() function
164 takes 4 arguments (AIX >= 5.2)])],
f58c0e01 165 [AC_MSG_RESULT(no)]
e351e493 166 )],
167 [],
168 [#include <usersec.h>]
169 )
2aa3a16c 170 AC_CHECK_FUNCS(setauthdb)
5ccf88cb 171 check_for_aix_broken_getaddrinfo=1
3466e002 172 AC_DEFINE(BROKEN_REALPATH, 1, [Define if you have a broken realpath.])
173 AC_DEFINE(SETEUID_BREAKS_SETUID, 1,
174 [Define if your platform breaks doing a seteuid before a setuid])
175 AC_DEFINE(BROKEN_SETREUID, 1, [Define if your setreuid() is broken])
176 AC_DEFINE(BROKEN_SETREGID, 1, [Define if your setregid() is broken])
a3cef3ca 177 dnl AIX handles lastlog as part of its login message
3466e002 178 AC_DEFINE(DISABLE_LASTLOG, 1, [Define if you don't want to use lastlog])
179 AC_DEFINE(LOGIN_NEEDS_UTMPX, 1,
180 [Some systems need a utmpx entry for /bin/login to work])
181 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV,
182 [Define to a Set Process Title type if your system is
183 supported by bsd-setproctitle.c])
961c2997 184 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1,
185 [AIX 5.2 and 5.3 (and presumably newer) require this])
9d6b1b96 186 ;;
3c62e7eb 187*-*-cygwin*)
a52997bd 188 check_for_libcrypt_later=1
ffb8d130 189 LIBS="$LIBS /usr/lib/textmode.o"
3466e002 190 AC_DEFINE(HAVE_CYGWIN, 1, [Define if you are on Cygwin])
191 AC_DEFINE(USE_PIPES, 1, [Use PIPES instead of a socketpair()])
192 AC_DEFINE(DISABLE_SHADOW, 1,
193 [Define if you want to disable shadow passwords])
194 AC_DEFINE(IP_TOS_IS_BROKEN, 1,
195 [Define if your system choked on IP TOS setting])
196 AC_DEFINE(NO_X11_UNIX_SOCKETS, 1,
197 [Define if X11 doesn't support AF_UNIX sockets on that system])
198 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT, 1,
199 [Define if the concept of ports only accessible to
200 superusers isn't known])
201 AC_DEFINE(DISABLE_FD_PASSING, 1,
202 [Define if your platform needs to skip post auth
203 file descriptor passing])
3c62e7eb 204 ;;
d6fdb079 205*-*-dgux*)
206 AC_DEFINE(IP_TOS_IS_BROKEN)
0c6a72a5 207 AC_DEFINE(SETEUID_BREAKS_SETUID)
208 AC_DEFINE(BROKEN_SETREUID)
209 AC_DEFINE(BROKEN_SETREGID)
d6fdb079 210 ;;
39c98ef7 211*-*-darwin*)
33e2e066 212 AC_MSG_CHECKING(if we have working getaddrinfo)
213 AC_TRY_RUN([#include <mach-o/dyld.h>
214main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
215 exit(0);
216 else
217 exit(1);
218}], [AC_MSG_RESULT(working)],
219 [AC_MSG_RESULT(buggy)
3466e002 220 AC_DEFINE(BROKEN_GETADDRINFO, 1, [getaddrinfo is broken (if present)])],
b27e573d 221 [AC_MSG_RESULT(assume it is working)])
635e0c42 222 AC_DEFINE(SETEUID_BREAKS_SETUID)
223 AC_DEFINE(BROKEN_SETREUID)
224 AC_DEFINE(BROKEN_SETREGID)
3466e002 225 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1,
226 [Define if your resolver libs need this for getrrsetbyname])
39c98ef7 227 ;;
7d458c86 228*-*-hpux*)
229 # first we define all of the options common to all HP-UX releases
b8fea62d 230 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
44839801 231 IPADDR_IN_DISPLAY=yes
2b10f47a 232 AC_DEFINE(USE_PIPES)
3466e002 233 AC_DEFINE(LOGIN_NO_ENDOPT, 1,
234 [Define if your login program cannot handle end of options ("--")])
a2572aa7 235 AC_DEFINE(LOGIN_NEEDS_UTMPX)
3466e002 236 AC_DEFINE(LOCKED_PASSWD_STRING, "*",
237 [String used in /etc/passwd to denote locked account])
3a2b2b44 238 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
83f987c3 239 MAIL="/var/mail/username"
f75ca46d 240 LIBS="$LIBS -lsec"
7d458c86 241 AC_CHECK_LIB(xnet, t_error, ,
242 AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
243
244 # next, we define all of the options specific to major releases
245 case "$host" in
246 *-*-hpux10*)
247 if test -z "$GCC"; then
248 CFLAGS="$CFLAGS -Ae"
249 fi
250 ;;
251 *-*-hpux11*)
3466e002 252 AC_DEFINE(PAM_SUN_CODEBASE, 1,
253 [Define if you are using Solaris-derived PAM which
254 passes pam_messages to the conversation function
255 with an extra level of indirection])
256 AC_DEFINE(DISABLE_UTMP, 1,
257 [Define if you don't want to use utmp])
7d458c86 258 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
259 check_for_hpux_broken_getaddrinfo=1
260 check_for_conflicting_getspnam=1
261 ;;
262 esac
263
264 # lastly, we define options specific to minor releases
265 case "$host" in
266 *-*-hpux10.26)
3466e002 267 AC_DEFINE(HAVE_SECUREWARE, 1,
268 [Define if you have SecureWare-based
269 protected password database])
7d458c86 270 disable_ptmx_check=yes
271 LIBS="$LIBS -lsecpw"
272 ;;
273 esac
2b763e31 274 ;;
d94aa2ae 275*-*-irix5*)
6ac7829a 276 PATH="$PATH:/usr/etc"
3466e002 277 AC_DEFINE(BROKEN_INET_NTOA, 1,
278 [Define if you system's inet_ntoa is busted
279 (e.g. Irix gcc issue)])
cb433561 280 AC_DEFINE(SETEUID_BREAKS_SETUID)
281 AC_DEFINE(BROKEN_SETREUID)
282 AC_DEFINE(BROKEN_SETREGID)
3466e002 283 AC_DEFINE(WITH_ABBREV_NO_TTY, 1,
284 [Define if you shouldn't strip 'tty' from your
285 ttyname in [uw]tmp])
3e6e3da0 286 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
b9795b89 287 ;;
288*-*-irix6*)
6ac7829a 289 PATH="$PATH:/usr/etc"
3466e002 290 AC_DEFINE(WITH_IRIX_ARRAY, 1,
291 [Define if you have/want arrays
292 (cluster-wide session managment, not C arrays)])
293 AC_DEFINE(WITH_IRIX_PROJECT, 1,
294 [Define if you want IRIX project management])
295 AC_DEFINE(WITH_IRIX_AUDIT, 1,
296 [Define if you want IRIX audit trails])
297 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS, 1,
298 [Define if you want IRIX kernel jobs])])
416ed5a7 299 AC_DEFINE(BROKEN_INET_NTOA)
412c0eaa 300 AC_DEFINE(SETEUID_BREAKS_SETUID)
301 AC_DEFINE(BROKEN_SETREUID)
302 AC_DEFINE(BROKEN_SETREGID)
3466e002 303 AC_DEFINE(BROKEN_UPDWTMPX, 1, [updwtmpx is broken (if present)])
0e8f4eba 304 AC_DEFINE(WITH_ABBREV_NO_TTY)
3e6e3da0 305 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
d94aa2ae 306 ;;
5cdfe03f 307*-*-linux*)
308 no_dev_ptmx=1
717057b6 309 check_for_libcrypt_later=1
eacb954e 310 check_for_openpty_ctty_bug=1
3466e002 311 AC_DEFINE(DONT_TRY_OTHER_AF, 1, [Workaround more Linux IPv6 quirks])
312 AC_DEFINE(PAM_TTY_KLUDGE, 1,
313 [Work around problematic Linux PAM modules handling of PAM_TTY])
314 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!",
315 [String used in /etc/passwd to denote locked account])
3a2b2b44 316 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
3466e002 317 AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM,
318 [Define to whatever link() returns for "not supported"
319 if it doesn't return EOPNOTSUPP.])
b6610e8f 320 AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts])
3466e002 321 AC_DEFINE(USE_BTMP)
80faa19f 322 inet6_default_4in6=yes
bf7c1e6c 323 case `uname -r` in
ad84c479 324 1.*|2.0.*)
3466e002 325 AC_DEFINE(BROKEN_CMSG_TYPE, 1,
326 [Define if cmsg_type is not passed correctly])
bf7c1e6c 327 ;;
bf7c1e6c 328 esac
5cdfe03f 329 ;;
66d6c27e 330mips-sony-bsd|mips-sony-newsos4)
3466e002 331 AC_DEFINE(NEED_SETPRGP, 1, [Need setpgrp to acquire controlling tty])
66d6c27e 332 SONY=1
66d6c27e 333 ;;
d468fc76 334*-*-netbsd*)
33e2e066 335 check_for_libcrypt_before=1
82f4e93d 336 if test "x$withval" != "xno" ; then
e6354014 337 need_dash_r=1
338 fi
d468fc76 339 ;;
86b416a7 340*-*-freebsd*)
341 check_for_libcrypt_later=1
988c5031 342 AC_DEFINE(LOCKED_PASSWD_PREFIX, "*LOCKED*", [Account locked with pw(1)])
86b416a7 343 ;;
8707b7eb 344*-*-bsdi*)
345 AC_DEFINE(SETEUID_BREAKS_SETUID)
346 AC_DEFINE(BROKEN_SETREUID)
347 AC_DEFINE(BROKEN_SETREGID)
348 ;;
729bfe59 349*-next-*)
729bfe59 350 conf_lastlog_location="/usr/adm/lastlog"
698d107e 351 conf_utmp_location=/etc/utmp
352 conf_wtmp_location=/usr/adm/wtmp
353 MAIL=/usr/spool/mail
3466e002 354 AC_DEFINE(HAVE_NEXT, 1, [Define if you are on NeXT])
443172c4 355 AC_DEFINE(BROKEN_REALPATH)
00937921 356 AC_DEFINE(USE_PIPES)
3466e002 357 AC_DEFINE(BROKEN_SAVED_UIDS, 1, [Needed for NeXT])
729bfe59 358 ;;
5b7b5e23 359*-*-openbsd*)
360 AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel])
8034a348 361 AC_DEFINE(HAVE_ATTRIBUTE__BOUNDED__, 1, [OpenBSD's gcc has bounded])
5b7b5e23 362 ;;
9d6b1b96 363*-*-solaris*)
82f4e93d 364 if test "x$withval" != "xno" ; then
010e9d5b 365 need_dash_r=1
366 fi
adeebd37 367 AC_DEFINE(PAM_SUN_CODEBASE)
7e2d5fa4 368 AC_DEFINE(LOGIN_NEEDS_UTMPX)
3466e002 369 AC_DEFINE(LOGIN_NEEDS_TERM, 1,
370 [Some versions of /bin/login need the TERM supplied
371 on the commandline])
7f0a4ff1 372 AC_DEFINE(PAM_TTY_KLUDGE)
3466e002 373 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1,
374 [Define if pam_chauthtok wants real uid set
375 to the unpriv'ed user])
3e6e3da0 376 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
ad84c479 377 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
3466e002 378 AC_DEFINE(SSHD_ACQUIRES_CTTY, 1,
379 [Define if sshd somehow reacquires a controlling TTY
380 after setsid()])
95b99395 381 external_path_file=/etc/default/login
1d7b9b20 382 # hardwire lastlog location (can't detect it on some versions)
383 conf_lastlog_location="/var/adm/lastlog"
32c80420 384 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
385 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
386 if test "$sol2ver" -ge 8; then
387 AC_MSG_RESULT(yes)
388 AC_DEFINE(DISABLE_UTMP)
3466e002 389 AC_DEFINE(DISABLE_WTMP, 1,
390 [Define if you don't want to use wtmp])
32c80420 391 else
392 AC_MSG_RESULT(no)
393 fi
9d6b1b96 394 ;;
a423beaf 395*-*-sunos4*)
0c2fb82f 396 CPPFLAGS="$CPPFLAGS -DSUNOS4"
a423beaf 397 AC_CHECK_FUNCS(getpwanam)
adeebd37 398 AC_DEFINE(PAM_SUN_CODEBASE)
32eec038 399 conf_utmp_location=/etc/utmp
400 conf_wtmp_location=/var/adm/wtmp
401 conf_lastlog_location=/var/adm/lastlog
137d7b6c 402 AC_DEFINE(USE_PIPES)
a423beaf 403 ;;
6f68f28a 404*-ncr-sysv*)
98a7c37b 405 LIBS="$LIBS -lc89"
29525240 406 AC_DEFINE(USE_PIPES)
eabb99c6 407 AC_DEFINE(SSHD_ACQUIRES_CTTY)
6fb3618d 408 AC_DEFINE(SETEUID_BREAKS_SETUID)
409 AC_DEFINE(BROKEN_SETREUID)
410 AC_DEFINE(BROKEN_SETREGID)
6f68f28a 411 ;;
132dd316 412*-sni-sysv*)
c8c15bcb 413 # /usr/ucblib MUST NOT be searched on ReliantUNIX
e2798e96 414 AC_CHECK_LIB(dl, dlsym, ,)
d08db6d1 415 # -lresolv needs to be at the end of LIBS or DNS lookups break
416 AC_CHECK_LIB(resolv, res_query, [ LIBS="$LIBS -lresolv" ])
9548d6c8 417 IPADDR_IN_DISPLAY=yes
418 AC_DEFINE(USE_PIPES)
132dd316 419 AC_DEFINE(IP_TOS_IS_BROKEN)
605369bb 420 AC_DEFINE(SETEUID_BREAKS_SETUID)
421 AC_DEFINE(BROKEN_SETREUID)
422 AC_DEFINE(BROKEN_SETREGID)
eabb99c6 423 AC_DEFINE(SSHD_ACQUIRES_CTTY)
95b99395 424 external_path_file=/etc/default/login
c8c15bcb 425 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
426 # Attention: always take care to bind libsocket and libnsl before libc,
427 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
132dd316 428 ;;
79a7ba96 429# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
77bb0bca 430*-*-sysv4.2*)
9a406e1e 431 CFLAGS="$CFLAGS -Dva_list=_VA_LIST"
ed6553e2 432 AC_DEFINE(USE_PIPES)
7ed101c0 433 AC_DEFINE(SETEUID_BREAKS_SETUID)
434 AC_DEFINE(BROKEN_SETREUID)
435 AC_DEFINE(BROKEN_SETREGID)
46f853b9 436 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd])
77bb0bca 437 ;;
79a7ba96 438# UnixWare 7.x, OpenUNIX 8
77bb0bca 439*-*-sysv5*)
d7d2cc6e 440 check_for_libcrypt_later=1
441 AC_DEFINE(UNIXWARE_LONG_PASSWORDS, 1, [Support passwords > 8 chars])
ed6553e2 442 AC_DEFINE(USE_PIPES)
7ed101c0 443 AC_DEFINE(SETEUID_BREAKS_SETUID)
444 AC_DEFINE(BROKEN_SETREUID)
445 AC_DEFINE(BROKEN_SETREGID)
3466e002 446 AC_DEFINE(PASSWD_NEEDS_USERNAME)
822015dd 447 case "$host" in
448 *-*-sysv5SCO_SV*) # SCO OpenServer 6.x
449 TEST_SHELL=/u95/bin/sh
3466e002 450 AC_DEFINE(BROKEN_LIBIAF, 1,
451 [ia_uinfo routines not supported by OS yet])
822015dd 452 ;;
453 esac
77bb0bca 454 ;;
9d6b1b96 455*-*-sysv*)
9d6b1b96 456 ;;
79a7ba96 457# SCO UNIX and OEM versions of SCO UNIX
77bb0bca 458*-*-sco3.2v4*)
11cf4f1f 459 AC_MSG_ERROR("This Platform is no longer supported.")
77bb0bca 460 ;;
79a7ba96 461# SCO OpenServer 5.x
77bb0bca 462*-*-sco3.2v5*)
21710e39 463 if test -z "$GCC"; then
464 CFLAGS="$CFLAGS -belf"
465 fi
ed6553e2 466 LIBS="$LIBS -lprot -lx -ltinfo -lm"
509b1f88 467 no_dev_ptmx=1
ed6553e2 468 AC_DEFINE(USE_PIPES)
6e879cb4 469 AC_DEFINE(HAVE_SECUREWARE)
d287c664 470 AC_DEFINE(DISABLE_SHADOW)
94d8258b 471 AC_DEFINE(DISABLE_FD_PASSING)
7ed101c0 472 AC_DEFINE(SETEUID_BREAKS_SETUID)
473 AC_DEFINE(BROKEN_SETREUID)
474 AC_DEFINE(BROKEN_SETREGID)
bcebad47 475 AC_DEFINE(WITH_ABBREV_NO_TTY)
34f2baf0 476 AC_DEFINE(BROKEN_UPDWTMPX)
3466e002 477 AC_DEFINE(PASSWD_NEEDS_USERNAME)
aca75d94 478 AC_CHECK_FUNCS(getluid setluid)
533875af 479 MANTYPE=man
a3245b92 480 TEST_SHELL=ksh
509b1f88 481 ;;
ccbb983c 482*-*-unicosmk*)
3466e002 483 AC_DEFINE(NO_SSH_LASTLOG, 1,
484 [Define if you don't want to use lastlog in session.c])
c1ad5966 485 AC_DEFINE(SETEUID_BREAKS_SETUID)
486 AC_DEFINE(BROKEN_SETREUID)
487 AC_DEFINE(BROKEN_SETREGID)
ccbb983c 488 AC_DEFINE(USE_PIPES)
489 AC_DEFINE(DISABLE_FD_PASSING)
490 LDFLAGS="$LDFLAGS"
491 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
492 MANTYPE=cat
d262b7f2 493 ;;
7b9a8c6e 494*-*-unicosmp*)
c1ad5966 495 AC_DEFINE(SETEUID_BREAKS_SETUID)
496 AC_DEFINE(BROKEN_SETREUID)
497 AC_DEFINE(BROKEN_SETREGID)
7b9a8c6e 498 AC_DEFINE(WITH_ABBREV_NO_TTY)
499 AC_DEFINE(USE_PIPES)
500 AC_DEFINE(DISABLE_FD_PASSING)
501 LDFLAGS="$LDFLAGS"
c1ad5966 502 LIBS="$LIBS -lgen -lacid -ldb"
7b9a8c6e 503 MANTYPE=cat
504 ;;
ca5c7d6a 505*-*-unicos*)
c1ad5966 506 AC_DEFINE(SETEUID_BREAKS_SETUID)
507 AC_DEFINE(BROKEN_SETREUID)
508 AC_DEFINE(BROKEN_SETREGID)
ca5c7d6a 509 AC_DEFINE(USE_PIPES)
94d8258b 510 AC_DEFINE(DISABLE_FD_PASSING)
ef51930f 511 AC_DEFINE(NO_SSH_LASTLOG)
ccbb983c 512 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
513 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
514 MANTYPE=cat
a704dd54 515 ;;
4d33e531 516*-dec-osf*)
99c8ddac 517 AC_MSG_CHECKING(for Digital Unix SIA)
518 no_osfsia=""
519 AC_ARG_WITH(osfsia,
520 [ --with-osfsia Enable Digital Unix SIA],
521 [
522 if test "x$withval" = "xno" ; then
523 AC_MSG_RESULT(disabled)
524 no_osfsia=1
525 fi
526 ],
527 )
528 if test -z "$no_osfsia" ; then
4d33e531 529 if test -f /etc/sia/matrix.conf; then
530 AC_MSG_RESULT(yes)
3466e002 531 AC_DEFINE(HAVE_OSF_SIA, 1,
532 [Define if you have Digital Unix Security
533 Integration Architecture])
534 AC_DEFINE(DISABLE_LOGIN, 1,
535 [Define if you don't want to use your
536 system's login() call])
58d0df4e 537 AC_DEFINE(DISABLE_FD_PASSING)
4d33e531 538 LIBS="$LIBS -lsecurity -ldb -lm -laud"
539 else
540 AC_MSG_RESULT(no)
3466e002 541 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin",
542 [String used in /etc/passwd to denote locked account])
4d33e531 543 fi
544 fi
a6e67b60 545 AC_DEFINE(BROKEN_GETADDRINFO)
f4f2ff4f 546 AC_DEFINE(SETEUID_BREAKS_SETUID)
08da2d08 547 AC_DEFINE(BROKEN_SETREUID)
548 AC_DEFINE(BROKEN_SETREGID)
4d33e531 549 ;;
41cb4569 550
551*-*-nto-qnx)
552 AC_DEFINE(USE_PIPES)
553 AC_DEFINE(NO_X11_UNIX_SOCKETS)
3466e002 554 AC_DEFINE(MISSING_NFDBITS, 1, [Define on *nto-qnx systems])
555 AC_DEFINE(MISSING_HOWMANY, 1, [Define on *nto-qnx systems])
556 AC_DEFINE(MISSING_FD_MASK, 1, [Define on *nto-qnx systems])
41cb4569 557 ;;
35fc74ed 558
559*-*-ultrix*)
3466e002 560 AC_DEFINE(BROKEN_GETGROUPS, 1, [getgroups(0,NULL) will return -1])
561 AC_DEFINE(BROKEN_MMAP, 1, [Ultrix mmap can't map files])
562 AC_DEFINE(NEED_SETPRGP)
b5765e1d 563 AC_DEFINE(HAVE_SYS_SYSLOG_H, 1, [Force use of sys/syslog.h on Ultrix])
564 ;;
157b6700 565
566*-*-lynxos)
567 CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"
3466e002 568 AC_DEFINE(MISSING_HOWMANY)
157b6700 569 AC_DEFINE(BROKEN_SETVBUF, 1, [LynxOS has broken setvbuf() implementation])
570 ;;
a7effaac 571esac
572
8e7b16f8 573# Allow user to specify flags
574AC_ARG_WITH(cflags,
575 [ --with-cflags Specify additional flags to pass to compiler],
576 [
6cf0200f 577 if test -n "$withval" && test "x$withval" != "xno" && \
578 test "x${withval}" != "xyes"; then
8e7b16f8 579 CFLAGS="$CFLAGS $withval"
580 fi
82f4e93d 581 ]
8e7b16f8 582)
0c2fb82f 583AC_ARG_WITH(cppflags,
584 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
585 [
6cf0200f 586 if test -n "$withval" && test "x$withval" != "xno" && \
587 test "x${withval}" != "xyes"; then
0c2fb82f 588 CPPFLAGS="$CPPFLAGS $withval"
589 fi
590 ]
591)
8e7b16f8 592AC_ARG_WITH(ldflags,
97b378bf 593 [ --with-ldflags Specify additional flags to pass to linker],
8e7b16f8 594 [
6cf0200f 595 if test -n "$withval" && test "x$withval" != "xno" && \
596 test "x${withval}" != "xyes"; then
8e7b16f8 597 LDFLAGS="$LDFLAGS $withval"
598 fi
82f4e93d 599 ]
8e7b16f8 600)
601AC_ARG_WITH(libs,
602 [ --with-libs Specify additional libraries to link with],
603 [
6cf0200f 604 if test -n "$withval" && test "x$withval" != "xno" && \
605 test "x${withval}" != "xyes"; then
8e7b16f8 606 LIBS="$LIBS $withval"
607 fi
82f4e93d 608 ]
8e7b16f8 609)
ed89c848 610AC_ARG_WITH(Werror,
611 [ --with-Werror Build main code with -Werror],
612 [
613 if test -n "$withval" && test "x$withval" != "xno"; then
614 werror_flags="-Werror"
1012885d 615 if test "x${withval}" != "xyes"; then
ed89c848 616 werror_flags="$withval"
617 fi
618 fi
619 ]
620)
8e7b16f8 621
c5829391 622AC_MSG_CHECKING(compiler and flags for sanity)
479cece8 623AC_RUN_IFELSE(
624 [AC_LANG_SOURCE([
c5829391 625#include <stdio.h>
626int main(){exit(0);}
479cece8 627 ])],
c5829391 628 [ AC_MSG_RESULT(yes) ],
629 [
630 AC_MSG_RESULT(no)
631 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
1a01a50c 632 ],
633 [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
c5829391 634)
635
b04a9f8c 636dnl Checks for header files.
637AC_CHECK_HEADERS( \
638 bstring.h \
639 crypt.h \
640 dirent.h \
641 endian.h \
642 features.h \
643 floatingpoint.h \
644 getopt.h \
645 glob.h \
646 ia.h \
4c653d8e 647 iaf.h \
b04a9f8c 648 lastlog.h \
649 limits.h \
650 login.h \
651 login_cap.h \
652 maillock.h \
653 ndir.h \
654 netdb.h \
655 netgroup.h \
656 netinet/in_systm.h \
657 pam/pam_appl.h \
658 paths.h \
659 pty.h \
660 readpassphrase.h \
661 rpc/types.h \
662 security/pam_appl.h \
663 shadow.h \
664 stddef.h \
665 stdint.h \
0957c2cf 666 string.h \
b04a9f8c 667 strings.h \
668 sys/audit.h \
669 sys/bitypes.h \
670 sys/bsdtty.h \
671 sys/cdefs.h \
672 sys/dir.h \
673 sys/mman.h \
674 sys/ndir.h \
675 sys/prctl.h \
676 sys/pstat.h \
677 sys/select.h \
678 sys/stat.h \
679 sys/stream.h \
680 sys/stropts.h \
681 sys/strtio.h \
682 sys/sysmacros.h \
683 sys/time.h \
684 sys/timers.h \
685 sys/un.h \
686 time.h \
687 tmpdir.h \
688 ttyent.h \
25dd2ce6 689 unistd.h \
b04a9f8c 690 usersec.h \
691 util.h \
692 utime.h \
693 utmp.h \
694 utmpx.h \
ea76f54c 695 vis.h \
b04a9f8c 696)
ddceb1c8 697
765a24cd 698# sys/ptms.h requires sys/stream.h to be included first on Solaris
699AC_CHECK_HEADERS(sys/ptms.h, [], [], [
700#ifdef HAVE_SYS_STREAM_H
701# include <sys/stream.h>
702#endif
703])
704
a0391976 705# Checks for libraries.
98a7c37b 706AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
707AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
2c523de9 708
446227d6 709dnl IRIX and Solaris 2.5.1 have dirname() in libgen
710AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
711 AC_CHECK_LIB(gen, dirname,[
712 AC_CACHE_CHECK([for broken dirname],
713 ac_cv_have_broken_dirname, [
714 save_LIBS="$LIBS"
715 LIBS="$LIBS -lgen"
b0e7249f 716 AC_RUN_IFELSE(
717 [AC_LANG_SOURCE([[
446227d6 718#include <libgen.h>
719#include <string.h>
720
721int main(int argc, char **argv) {
722 char *s, buf[32];
723
724 strncpy(buf,"/etc", 32);
725 s = dirname(buf);
726 if (!s || strncmp(s, "/", 32) != 0) {
727 exit(1);
728 } else {
729 exit(0);
730 }
731}
b0e7249f 732 ]])],
733 [ ac_cv_have_broken_dirname="no" ],
734 [ ac_cv_have_broken_dirname="yes" ],
446227d6 735 [ ac_cv_have_broken_dirname="no" ],
446227d6 736 )
737 LIBS="$save_LIBS"
738 ])
739 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
740 LIBS="$LIBS -lgen"
741 AC_DEFINE(HAVE_DIRNAME)
742 AC_CHECK_HEADERS(libgen.h)
743 fi
744 ])
745])
746
747AC_CHECK_FUNC(getspnam, ,
748 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
3466e002 749AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME, 1,
750 [Define if you have the basename function.]))
446227d6 751
98a7c37b 752dnl zlib is required
753AC_ARG_WITH(zlib,
754 [ --with-zlib=PATH Use zlib in PATH],
6dd05556 755 [ if test "x$withval" = "xno" ; then
756 AC_MSG_ERROR([*** zlib is required ***])
757 elif test "x$withval" != "xyes"; then
98a7c37b 758 if test -d "$withval/lib"; then
759 if test -n "${need_dash_r}"; then
5a162955 760 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
98a7c37b 761 else
5a162955 762 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
98a7c37b 763 fi
764 else
765 if test -n "${need_dash_r}"; then
5a162955 766 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
98a7c37b 767 else
5a162955 768 LDFLAGS="-L${withval} ${LDFLAGS}"
98a7c37b 769 fi
770 fi
771 if test -d "$withval/include"; then
5a162955 772 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
98a7c37b 773 else
5a162955 774 CPPFLAGS="-I${withval} ${CPPFLAGS}"
98a7c37b 775 fi
6dd05556 776 fi ]
98a7c37b 777)
778
0a15d73b 779AC_CHECK_LIB(z, deflate, ,
780 [
781 saved_CPPFLAGS="$CPPFLAGS"
782 saved_LDFLAGS="$LDFLAGS"
783 save_LIBS="$LIBS"
784 dnl Check default zlib install dir
785 if test -n "${need_dash_r}"; then
786 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
787 else
788 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
789 fi
790 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
791 LIBS="$LIBS -lz"
792 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
793 [
794 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
795 ]
796 )
797 ]
798)
4ad65809 799AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
8068d564 800
801AC_ARG_WITH(zlib-version-check,
802 [ --without-zlib-version-check Disable zlib version check],
803 [ if test "x$withval" = "xno" ; then
804 zlib_check_nonfatal=1
805 fi
806 ]
807)
808
5c7fc85d 809AC_MSG_CHECKING(for possibly buggy zlib)
479cece8 810AC_RUN_IFELSE([AC_LANG_SOURCE([[
5c7fc85d 811#include <stdio.h>
4ad65809 812#include <zlib.h>
813int main()
814{
5c7fc85d 815 int a=0, b=0, c=0, d=0, n, v;
816 n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d);
817 if (n != 3 && n != 4)
4ad65809 818 exit(1);
5c7fc85d 819 v = a*1000000 + b*10000 + c*100 + d;
820 fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v);
821
822 /* 1.1.4 is OK */
823 if (a == 1 && b == 1 && c >= 4)
4ad65809 824 exit(0);
5c7fc85d 825
0072b59d 826 /* 1.2.3 and up are OK */
827 if (v >= 1020300)
5c7fc85d 828 exit(0);
829
4ad65809 830 exit(2);
831}
479cece8 832 ]])],
5c7fc85d 833 AC_MSG_RESULT(no),
834 [ AC_MSG_RESULT(yes)
8068d564 835 if test -z "$zlib_check_nonfatal" ; then
836 AC_MSG_ERROR([*** zlib too old - check config.log ***
837Your reported zlib version has known security problems. It's possible your
838vendor has fixed these problems without changing the version number. If you
839are sure this is the case, you can disable the check by running
840"./configure --without-zlib-version-check".
6090bcfe 841If you are in doubt, upgrade zlib to version 1.2.3 or greater.
5c7fc85d 842See http://www.gzip.org/zlib/ for details.])
8068d564 843 else
844 AC_MSG_WARN([zlib version may have security problems])
845 fi
1a01a50c 846 ],
847 [ AC_MSG_WARN([cross compiling: not checking zlib version]) ]
4ad65809 848)
48e7916f 849
2c523de9 850dnl UnixWare 2.x
aff51935 851AC_CHECK_FUNC(strcasecmp,
2c523de9 852 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
853)
23361281 854AC_CHECK_FUNCS(utimes,
cda1ebcb 855 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
856 LIBS="$LIBS -lc89"]) ]
2c523de9 857)
4cca272e 858
7c6d759d 859dnl Checks for libutil functions
860AC_CHECK_HEADERS(libutil.h)
3466e002 861AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN, 1,
862 [Define if your libraries define login()])])
7c6d759d 863AC_CHECK_FUNCS(logout updwtmp logwtmp)
864
a738c3b0 865AC_FUNC_STRFTIME
866
84ceda19 867# Check for ALTDIRFUNC glob() extension
868AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
869AC_EGREP_CPP(FOUNDIT,
870 [
871 #include <glob.h>
872 #ifdef GLOB_ALTDIRFUNC
873 FOUNDIT
874 #endif
aff51935 875 ],
84ceda19 876 [
3466e002 877 AC_DEFINE(GLOB_HAS_ALTDIRFUNC, 1,
878 [Define if your system glob() function has
879 the GLOB_ALTDIRFUNC extension])
84ceda19 880 AC_MSG_RESULT(yes)
881 ],
882 [
883 AC_MSG_RESULT(no)
884 ]
885)
4cca272e 886
40849fdb 887# Check for g.gl_matchc glob() extension
888AC_MSG_CHECKING(for gl_matchc field in glob_t)
889AC_EGREP_CPP(FOUNDIT,
aff51935 890 [
891 #include <glob.h>
40849fdb 892 int main(void){glob_t g; g.gl_matchc = 1;}
aff51935 893 ],
894 [
3466e002 895 AC_DEFINE(GLOB_HAS_GL_MATCHC, 1,
896 [Define if your system glob() function has
897 gl_matchc options in glob_t])
aff51935 898 AC_MSG_RESULT(yes)
899 ],
900 [
901 AC_MSG_RESULT(no)
902 ]
40849fdb 903)
904
edbe6722 905AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
1a01a50c 906AC_RUN_IFELSE(
479cece8 907 [AC_LANG_SOURCE([[
edbe6722 908#include <sys/types.h>
909#include <dirent.h>
aec4cb4f 910int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
479cece8 911 ]])],
aff51935 912 [AC_MSG_RESULT(yes)],
edbe6722 913 [
914 AC_MSG_RESULT(no)
3466e002 915 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME, 1,
d08db6d1 916 [Define if your struct dirent expects you to
3466e002 917 allocate extra space for d_name])
1a01a50c 918 ],
82f4e93d 919 [
1a01a50c 920 AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
921 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
edbe6722 922 ]
923)
924
419e26e7 925AC_MSG_CHECKING([for /proc/pid/fd directory])
926if test -d "/proc/$$/fd" ; then
3466e002 927 AC_DEFINE(HAVE_PROC_PID, 1, [Define if you have /proc/$pid/fd])
419e26e7 928 AC_MSG_RESULT(yes)
929else
930 AC_MSG_RESULT(no)
931fi
932
278588d8 933# Check whether user wants S/Key support
aff51935 934SKEY_MSG="no"
278588d8 935AC_ARG_WITH(skey,
6ff3d0dc 936 [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)],
278588d8 937 [
938 if test "x$withval" != "xno" ; then
939
940 if test "x$withval" != "xyes" ; then
941 CPPFLAGS="$CPPFLAGS -I${withval}/include"
942 LDFLAGS="$LDFLAGS -L${withval}/lib"
943 fi
944
3466e002 945 AC_DEFINE(SKEY, 1, [Define if you want S/Key support])
278588d8 946 LIBS="-lskey $LIBS"
aff51935 947 SKEY_MSG="yes"
82f4e93d 948
ddceb1c8 949 AC_MSG_CHECKING([for s/key support])
b0e7249f 950 AC_LINK_IFELSE(
951 [AC_LANG_SOURCE([[
ddceb1c8 952#include <stdio.h>
953#include <skey.h>
aec4cb4f 954int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
b0e7249f 955 ]])],
ddceb1c8 956 [AC_MSG_RESULT(yes)],
278588d8 957 [
ddceb1c8 958 AC_MSG_RESULT(no)
278588d8 959 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
960 ])
141fc639 961 AC_MSG_CHECKING(if skeychallenge takes 4 arguments)
962 AC_TRY_COMPILE(
963 [#include <stdio.h>
964 #include <skey.h>],
965 [(void)skeychallenge(NULL,"name","",0);],
966 [AC_MSG_RESULT(yes)
3466e002 967 AC_DEFINE(SKEYCHALLENGE_4ARG, 1,
968 [Define if your skeychallenge()
969 function takes 4 arguments (NetBSD)])],
141fc639 970 [AC_MSG_RESULT(no)]
971 )
278588d8 972 fi
973 ]
974)
975
976# Check whether user wants TCP wrappers support
98a7c37b 977TCPW_MSG="no"
278588d8 978AC_ARG_WITH(tcp-wrappers,
6ff3d0dc 979 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)],
278588d8 980 [
981 if test "x$withval" != "xno" ; then
982 saved_LIBS="$LIBS"
98a7c37b 983 saved_LDFLAGS="$LDFLAGS"
984 saved_CPPFLAGS="$CPPFLAGS"
4b492aab 985 if test -n "${withval}" && \
6cf0200f 986 test "x${withval}" != "xyes"; then
98a7c37b 987 if test -d "${withval}/lib"; then
988 if test -n "${need_dash_r}"; then
5a162955 989 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
98a7c37b 990 else
5a162955 991 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
98a7c37b 992 fi
993 else
994 if test -n "${need_dash_r}"; then
5a162955 995 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
98a7c37b 996 else
5a162955 997 LDFLAGS="-L${withval} ${LDFLAGS}"
98a7c37b 998 fi
999 fi
1000 if test -d "${withval}/include"; then
5a162955 1001 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
98a7c37b 1002 else
5a162955 1003 CPPFLAGS="-I${withval} ${CPPFLAGS}"
98a7c37b 1004 fi
98a7c37b 1005 fi
ddceb1c8 1006 LIBWRAP="-lwrap"
1007 LIBS="$LIBWRAP $LIBS"
278588d8 1008 AC_MSG_CHECKING(for libwrap)
1009 AC_TRY_LINK(
1010 [
77f09220 1011#include <sys/types.h>
1012#include <sys/socket.h>
1013#include <netinet/in.h>
278588d8 1014#include <tcpd.h>
1015 int deny_severity = 0, allow_severity = 0;
1016 ],
1017 [hosts_access(0);],
1018 [
1019 AC_MSG_RESULT(yes)
3466e002 1020 AC_DEFINE(LIBWRAP, 1,
1021 [Define if you want
1022 TCP Wrappers support])
ddceb1c8 1023 AC_SUBST(LIBWRAP)
98a7c37b 1024 TCPW_MSG="yes"
278588d8 1025 ],
1026 [
1027 AC_MSG_ERROR([*** libwrap missing])
1028 ]
1029 )
ddceb1c8 1030 LIBS="$saved_LIBS"
278588d8 1031 fi
1032 ]
1033)
1034
59031773 1035# Check whether user wants libedit support
1036LIBEDIT_MSG="no"
1037AC_ARG_WITH(libedit,
6ff3d0dc 1038 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
59031773 1039 [ if test "x$withval" != "xno" ; then
737edf04 1040 if test "x$withval" != "xyes"; then
bb116c8e 1041 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1042 if test -n "${need_dash_r}"; then
1043 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1044 else
1045 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1046 fi
737edf04 1047 fi
59031773 1048 AC_CHECK_LIB(edit, el_init,
3466e002 1049 [ AC_DEFINE(USE_LIBEDIT, 1, [Use libedit for sftp])
59031773 1050 LIBEDIT="-ledit -lcurses"
1051 LIBEDIT_MSG="yes"
1052 AC_SUBST(LIBEDIT)
1053 ],
737edf04 1054 [ AC_MSG_ERROR(libedit not found) ],
1055 [ -lcurses ]
59031773 1056 )
f47ddccb 1057 AC_MSG_CHECKING(if libedit version is compatible)
d92622f9 1058 AC_COMPILE_IFELSE(
1059 [AC_LANG_SOURCE([[
1060#include <histedit.h>
f47ddccb 1061int main(void)
1062{
1063 int i = H_SETSIZE;
1064 el_init("", NULL, NULL, NULL);
1065 exit(0);
1066}
d92622f9 1067 ]])],
f47ddccb 1068 [ AC_MSG_RESULT(yes) ],
1069 [ AC_MSG_RESULT(no)
1070 AC_MSG_ERROR(libedit version is not compatible) ]
1071 )
59031773 1072 fi ]
1073)
1074
7b578f7d 1075AUDIT_MODULE=none
1076AC_ARG_WITH(audit,
1077 [ --with-audit=module Enable EXPERIMENTAL audit support (modules=debug,bsm)],
1078 [
1079 AC_MSG_CHECKING(for supported audit module)
1080 case "$withval" in
1081 bsm)
1082 AC_MSG_RESULT(bsm)
1083 AUDIT_MODULE=bsm
1084 dnl Checks for headers, libs and functions
1085 AC_CHECK_HEADERS(bsm/audit.h, [],
1086 [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)])
1087 AC_CHECK_LIB(bsm, getaudit, [],
1088 [AC_MSG_ERROR(BSM enabled and required library not found)])
1089 AC_CHECK_FUNCS(getaudit, [],
1090 [AC_MSG_ERROR(BSM enabled and required function not found)])
1091 # These are optional
7939c496 1092 AC_CHECK_FUNCS(getaudit_addr)
3466e002 1093 AC_DEFINE(USE_BSM_AUDIT, 1, [Use BSM audit module])
7b578f7d 1094 ;;
1095 debug)
1096 AUDIT_MODULE=debug
1097 AC_MSG_RESULT(debug)
3466e002 1098 AC_DEFINE(SSH_AUDIT_EVENTS, 1, Use audit debugging module)
7b578f7d 1099 ;;
a2b3321d 1100 no)
d92622f9 1101 AC_MSG_RESULT(no)
a2b3321d 1102 ;;
7b578f7d 1103 *)
1104 AC_MSG_ERROR([Unknown audit module $withval])
1105 ;;
1106 esac ]
1107)
1108
19160674 1109dnl Checks for library functions. Please keep in alphabetical order
b04a9f8c 1110AC_CHECK_FUNCS( \
1111 arc4random \
9a406e1e 1112 asprintf \
b04a9f8c 1113 b64_ntop \
1114 __b64_ntop \
1115 b64_pton \
1116 __b64_pton \
1117 bcopy \
1118 bindresvport_sa \
1119 clock \
1120 closefrom \
1121 dirfd \
b04a9f8c 1122 fchmod \
1123 fchown \
1124 freeaddrinfo \
1125 futimes \
1126 getaddrinfo \
1127 getcwd \
1128 getgrouplist \
1129 getnameinfo \
1130 getopt \
1131 getpeereid \
1132 _getpty \
1133 getrlimit \
1134 getttyent \
1135 glob \
1136 inet_aton \
1137 inet_ntoa \
1138 inet_ntop \
1139 innetgr \
1140 login_getcapbool \
1141 md5_crypt \
1142 memmove \
1143 mkdtemp \
1144 mmap \
1145 ngetaddrinfo \
1146 nsleep \
1147 ogetaddrinfo \
1148 openlog_r \
1149 openpty \
1150 prctl \
1151 pstat \
1152 readpassphrase \
1153 realpath \
1154 recvmsg \
1155 rresvport_af \
1156 sendmsg \
1157 setdtablesize \
1158 setegid \
1159 setenv \
1160 seteuid \
1161 setgroups \
1162 setlogin \
1163 setpcred \
1164 setproctitle \
1165 setregid \
1166 setreuid \
1167 setrlimit \
1168 setsid \
1169 setvbuf \
1170 sigaction \
1171 sigvec \
1172 snprintf \
1173 socketpair \
1174 strdup \
1175 strerror \
1176 strlcat \
1177 strlcpy \
1178 strmode \
1179 strnvis \
1180 strtonum \
1e29a0c8 1181 strtoll \
b04a9f8c 1182 strtoul \
1183 sysconf \
1184 tcgetpgrp \
1185 truncate \
1186 unsetenv \
1187 updwtmpx \
9a406e1e 1188 vasprintf \
b04a9f8c 1189 vhangup \
1190 vsnprintf \
1191 waitpid \
19160674 1192)
98a7c37b 1193
1a086f97 1194# IRIX has a const char return value for gai_strerror()
1195AC_CHECK_FUNCS(gai_strerror,[
1196 AC_DEFINE(HAVE_GAI_STRERROR)
1197 AC_TRY_COMPILE([
1198#include <sys/types.h>
1199#include <sys/socket.h>
1200#include <netdb.h>
1201
1202const char *gai_strerror(int);],[
1203char *str;
1204
1205str = gai_strerror(0);],[
1206 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
1207 [Define if gai_strerror() returns const char *])])])
1208
3466e002 1209AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1,
1210 [Some systems put nanosleep outside of libc]))
92b1decf 1211
309709db 1212dnl Make sure prototypes are defined for these before using them.
309709db 1213AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
0957c2cf 1214AC_CHECK_DECL(strsep,
1215 [AC_CHECK_FUNCS(strsep)],
1216 [],
1217 [
1218#ifdef HAVE_STRING_H
1219# include <string.h>
1220#endif
1221 ])
08412d26 1222
3490699c 1223dnl tcsendbreak might be a macro
1224AC_CHECK_DECL(tcsendbreak,
1225 [AC_DEFINE(HAVE_TCSENDBREAK)],
aff51935 1226 [AC_CHECK_FUNCS(tcsendbreak)],
3490699c 1227 [#include <termios.h>]
1228)
1229
41e0e158 1230AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
1231
3f176010 1232AC_CHECK_FUNCS(setresuid, [
1233 dnl Some platorms have setresuid that isn't implemented, test for this
1234 AC_MSG_CHECKING(if setresuid seems to work)
479cece8 1235 AC_RUN_IFELSE(
1236 [AC_LANG_SOURCE([[
9a3fe0e2 1237#include <stdlib.h>
1238#include <errno.h>
1239int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
479cece8 1240 ]])],
3f176010 1241 [AC_MSG_RESULT(yes)],
3466e002 1242 [AC_DEFINE(BROKEN_SETRESUID, 1,
1243 [Define if your setresuid() is broken])
1a01a50c 1244 AC_MSG_RESULT(not implemented)],
1245 [AC_MSG_WARN([cross compiling: not checking setresuid])]
3f176010 1246 )
1247])
9a3fe0e2 1248
3f176010 1249AC_CHECK_FUNCS(setresgid, [
1250 dnl Some platorms have setresgid that isn't implemented, test for this
1251 AC_MSG_CHECKING(if setresgid seems to work)
479cece8 1252 AC_RUN_IFELSE(
1253 [AC_LANG_SOURCE([[
9a3fe0e2 1254#include <stdlib.h>
1255#include <errno.h>
1256int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
479cece8 1257 ]])],
3f176010 1258 [AC_MSG_RESULT(yes)],
3466e002 1259 [AC_DEFINE(BROKEN_SETRESGID, 1,
1260 [Define if your setresgid() is broken])
1a01a50c 1261 AC_MSG_RESULT(not implemented)],
1262 [AC_MSG_WARN([cross compiling: not checking setresuid])]
3f176010 1263 )
1264])
9a3fe0e2 1265
2e73a022 1266dnl Checks for time functions
1d7b9b20 1267AC_CHECK_FUNCS(gettimeofday time)
2e73a022 1268dnl Checks for utmp functions
b03bd394 1269AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
1d7b9b20 1270AC_CHECK_FUNCS(utmpname)
2e73a022 1271dnl Checks for utmpx functions
b03bd394 1272AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
1d7b9b20 1273AC_CHECK_FUNCS(setutxent utmpxname)
76cd7316 1274
aff51935 1275AC_CHECK_FUNC(daemon,
3466e002 1276 [AC_DEFINE(HAVE_DAEMON, 1, [Define if your libraries define daemon()])],
1277 [AC_CHECK_LIB(bsd, daemon,
1278 [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
beb43d31 1279)
1280
aff51935 1281AC_CHECK_FUNC(getpagesize,
3466e002 1282 [AC_DEFINE(HAVE_GETPAGESIZE, 1,
1283 [Define if your libraries define getpagesize()])],
1284 [AC_CHECK_LIB(ucb, getpagesize,
1285 [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
aa6bd60a 1286)
1287
2647ae26 1288# Check for broken snprintf
1289if test "x$ac_cv_func_snprintf" = "xyes" ; then
1290 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
1a01a50c 1291 AC_RUN_IFELSE(
479cece8 1292 [AC_LANG_SOURCE([[
2647ae26 1293#include <stdio.h>
aec4cb4f 1294int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
479cece8 1295 ]])],
aff51935 1296 [AC_MSG_RESULT(yes)],
2647ae26 1297 [
1298 AC_MSG_RESULT(no)
3466e002 1299 AC_DEFINE(BROKEN_SNPRINTF, 1,
1300 [Define if your snprintf is busted])
2647ae26 1301 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
1a01a50c 1302 ],
1303 [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
2647ae26 1304 )
1305fi
1306
9a406e1e 1307# If we don't have a working asprintf, then we strongly depend on vsnprintf
1308# returning the right thing on overflow: the number of characters it tried to
1309# create (as per SUSv3)
1310if test "x$ac_cv_func_asprintf" != "xyes" && \
1311 test "x$ac_cv_func_vsnprintf" = "xyes" ; then
1312 AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow])
1313 AC_RUN_IFELSE(
1314 [AC_LANG_SOURCE([[
1315#include <sys/types.h>
1316#include <stdio.h>
1317#include <stdarg.h>
1318
1319int x_snprintf(char *str,size_t count,const char *fmt,...)
1320{
1321 size_t ret; va_list ap;
1322 va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap);
1323 return ret;
1324}
1325int main(void)
1326{
1327 char x[1];
1328 exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1);
1329} ]])],
1330 [AC_MSG_RESULT(yes)],
1331 [
1332 AC_MSG_RESULT(no)
1333 AC_DEFINE(BROKEN_SNPRINTF, 1,
1334 [Define if your snprintf is busted])
1335 AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor])
1336 ],
1337 [ AC_MSG_WARN([cross compiling: Assuming working vsnprintf()]) ]
1338 )
1339fi
1340
2f6f9cff 1341# Check for missing getpeereid (or equiv) support
1342NO_PEERCHECK=""
1343if test "x$ac_cv_func_getpeereid" != "xyes" ; then
1344 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
1345 AC_TRY_COMPILE(
1346 [#include <sys/types.h>
1347 #include <sys/socket.h>],
1348 [int i = SO_PEERCRED;],
62eb7db4 1349 [ AC_MSG_RESULT(yes)
3466e002 1350 AC_DEFINE(HAVE_SO_PEERCRED, 1, [Have PEERCRED socket option])
62eb7db4 1351 ],
2f6f9cff 1352 [AC_MSG_RESULT(no)
1353 NO_PEERCHECK=1]
1354 )
1355fi
1356
70e7d0b0 1357dnl see whether mkstemp() requires XXXXXX
1358if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
1359AC_MSG_CHECKING([for (overly) strict mkstemp])
b0e7249f 1360AC_RUN_IFELSE(
1361 [AC_LANG_SOURCE([[
70e7d0b0 1362#include <stdlib.h>
1363main() { char template[]="conftest.mkstemp-test";
1364if (mkstemp(template) == -1)
1365 exit(1);
1366unlink(template); exit(0);
1367}
b0e7249f 1368 ]])],
70e7d0b0 1369 [
1370 AC_MSG_RESULT(no)
1371 ],
aff51935 1372 [
70e7d0b0 1373 AC_MSG_RESULT(yes)
3466e002 1374 AC_DEFINE(HAVE_STRICT_MKSTEMP, 1, [Silly mkstemp()])
70e7d0b0 1375 ],
1376 [
1377 AC_MSG_RESULT(yes)
1378 AC_DEFINE(HAVE_STRICT_MKSTEMP)
aff51935 1379 ]
70e7d0b0 1380)
1381fi
1382
eacb954e 1383dnl make sure that openpty does not reacquire controlling terminal
1384if test ! -z "$check_for_openpty_ctty_bug"; then
1385 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
b0e7249f 1386 AC_RUN_IFELSE(
1387 [AC_LANG_SOURCE([[
eacb954e 1388#include <stdio.h>
1389#include <sys/fcntl.h>
1390#include <sys/types.h>
1391#include <sys/wait.h>
1392
1393int
1394main()
1395{
1396 pid_t pid;
1397 int fd, ptyfd, ttyfd, status;
1398
1399 pid = fork();
1400 if (pid < 0) { /* failed */
1401 exit(1);
1402 } else if (pid > 0) { /* parent */
1403 waitpid(pid, &status, 0);
aff51935 1404 if (WIFEXITED(status))
eacb954e 1405 exit(WEXITSTATUS(status));
1406 else
1407 exit(2);
1408 } else { /* child */
1409 close(0); close(1); close(2);
1410 setsid();
1411 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
1412 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
1413 if (fd >= 0)
1414 exit(3); /* Acquired ctty: broken */
1415 else
1416 exit(0); /* Did not acquire ctty: OK */
1417 }
1418}
b0e7249f 1419 ]])],
eacb954e 1420 [
1421 AC_MSG_RESULT(yes)
1422 ],
1423 [
1424 AC_MSG_RESULT(no)
1425 AC_DEFINE(SSHD_ACQUIRES_CTTY)
b0e7249f 1426 ],
1427 [
1428 AC_MSG_RESULT(cross-compiling, assuming yes)
eacb954e 1429 ]
1430 )
1431fi
1432
4b492aab 1433if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1434 test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
2fe51906 1435 AC_MSG_CHECKING(if getaddrinfo seems to work)
b0e7249f 1436 AC_RUN_IFELSE(
1437 [AC_LANG_SOURCE([[
2fe51906 1438#include <stdio.h>
1439#include <sys/socket.h>
1440#include <netdb.h>
1441#include <errno.h>
1442#include <netinet/in.h>
1443
1444#define TEST_PORT "2222"
1445
1446int
1447main(void)
1448{
1449 int err, sock;
1450 struct addrinfo *gai_ai, *ai, hints;
1451 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1452
1453 memset(&hints, 0, sizeof(hints));
1454 hints.ai_family = PF_UNSPEC;
1455 hints.ai_socktype = SOCK_STREAM;
1456 hints.ai_flags = AI_PASSIVE;
1457
1458 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1459 if (err != 0) {
1460 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1461 exit(1);
1462 }
1463
1464 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1465 if (ai->ai_family != AF_INET6)
1466 continue;
1467
1468 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1469 sizeof(ntop), strport, sizeof(strport),
1470 NI_NUMERICHOST|NI_NUMERICSERV);
1471
1472 if (err != 0) {
1473 if (err == EAI_SYSTEM)
1474 perror("getnameinfo EAI_SYSTEM");
1475 else
1476 fprintf(stderr, "getnameinfo failed: %s\n",
1477 gai_strerror(err));
1478 exit(2);
1479 }
1480
1481 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1482 if (sock < 0)
1483 perror("socket");
1484 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1485 if (errno == EBADF)
1486 exit(3);
1487 }
1488 }
1489 exit(0);
1490}
b0e7249f 1491 ]])],
2fe51906 1492 [
1493 AC_MSG_RESULT(yes)
1494 ],
1495 [
1496 AC_MSG_RESULT(no)
1497 AC_DEFINE(BROKEN_GETADDRINFO)
b0e7249f 1498 ],
1499 [
1500 AC_MSG_RESULT(cross-compiling, assuming yes)
2fe51906 1501 ]
1502 )
1503fi
1504
4b492aab 1505if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1506 test "x$check_for_aix_broken_getaddrinfo" = "x1"; then
5ccf88cb 1507 AC_MSG_CHECKING(if getaddrinfo seems to work)
b0e7249f 1508 AC_RUN_IFELSE(
1509 [AC_LANG_SOURCE([[
5ccf88cb 1510#include <stdio.h>
1511#include <sys/socket.h>
1512#include <netdb.h>
1513#include <errno.h>
1514#include <netinet/in.h>
1515
1516#define TEST_PORT "2222"
1517
1518int
1519main(void)
1520{
1521 int err, sock;
1522 struct addrinfo *gai_ai, *ai, hints;
1523 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1524
1525 memset(&hints, 0, sizeof(hints));
1526 hints.ai_family = PF_UNSPEC;
1527 hints.ai_socktype = SOCK_STREAM;
1528 hints.ai_flags = AI_PASSIVE;
1529
1530 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1531 if (err != 0) {
1532 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1533 exit(1);
1534 }
1535
1536 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1537 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
1538 continue;
1539
1540 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1541 sizeof(ntop), strport, sizeof(strport),
1542 NI_NUMERICHOST|NI_NUMERICSERV);
1543
1544 if (ai->ai_family == AF_INET && err != 0) {
1545 perror("getnameinfo");
1546 exit(2);
1547 }
1548 }
1549 exit(0);
1550}
b0e7249f 1551 ]])],
5ccf88cb 1552 [
1553 AC_MSG_RESULT(yes)
3466e002 1554 AC_DEFINE(AIX_GETNAMEINFO_HACK, 1,
1555 [Define if you have a getaddrinfo that fails
1556 for the all-zeros IPv6 address])
5ccf88cb 1557 ],
1558 [
1559 AC_MSG_RESULT(no)
1560 AC_DEFINE(BROKEN_GETADDRINFO)
b0e7249f 1561 ],
1562 AC_MSG_RESULT(cross-compiling, assuming no)
5ccf88cb 1563 ]
1564 )
1565fi
1566
b29fd59f 1567if test "x$check_for_conflicting_getspnam" = "x1"; then
1568 AC_MSG_CHECKING(for conflicting getspnam in shadow.h)
1569 AC_COMPILE_IFELSE(
1570 [
1571#include <shadow.h>
1572int main(void) {exit(0);}
1573 ],
1574 [
1575 AC_MSG_RESULT(no)
1576 ],
1577 [
1578 AC_MSG_RESULT(yes)
1579 AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1,
1580 [Conflicting defs for getspnam])
1581 ]
1582 )
1583fi
1584
7f8f5e00 1585AC_FUNC_GETPGRP
1586
717057b6 1587# Check for PAM libs
cbd7492e 1588PAM_MSG="no"
a0391976 1589AC_ARG_WITH(pam,
717057b6 1590 [ --with-pam Enable PAM support ],
a0391976 1591 [
717057b6 1592 if test "x$withval" != "xno" ; then
2511d104 1593 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1594 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
717057b6 1595 AC_MSG_ERROR([PAM headers not found])
1596 fi
a0391976 1597
717057b6 1598 AC_CHECK_LIB(dl, dlopen, , )
1599 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1600 AC_CHECK_FUNCS(pam_getenvlist)
749560dd 1601 AC_CHECK_FUNCS(pam_putenv)
2b763e31 1602
717057b6 1603 PAM_MSG="yes"
4cb5ffa0 1604
3466e002 1605 AC_DEFINE(USE_PAM, 1,
1606 [Define if you want to enable PAM support])
98f2d9d5 1607 if test $ac_cv_lib_dl_dlopen = yes; then
1608 LIBPAM="-lpam -ldl"
1609 else
1610 LIBPAM="-lpam"
1611 fi
1612 AC_SUBST(LIBPAM)
717057b6 1613 fi
1614 ]
1615)
cbd7492e 1616
717057b6 1617# Check for older PAM
1618if test "x$PAM_MSG" = "xyes" ; then
a0391976 1619 # Check PAM strerror arguments (old PAM)
1620 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1621 AC_TRY_COMPILE(
1622 [
18ba2aab 1623#include <stdlib.h>
2511d104 1624#if defined(HAVE_SECURITY_PAM_APPL_H)
18ba2aab 1625#include <security/pam_appl.h>
2511d104 1626#elif defined (HAVE_PAM_PAM_APPL_H)
1627#include <pam/pam_appl.h>
1628#endif
aff51935 1629 ],
1630 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
a0391976 1631 [AC_MSG_RESULT(no)],
1632 [
3466e002 1633 AC_DEFINE(HAVE_OLD_PAM, 1,
1634 [Define if you have an old version of PAM
1635 which takes only one argument to pam_strerror])
a0391976 1636 AC_MSG_RESULT(yes)
cbd7492e 1637 PAM_MSG="yes (old library)"
a0391976 1638 ]
717057b6 1639 )
a0391976 1640fi
1641
5b991353 1642# Search for OpenSSL
1643saved_CPPFLAGS="$CPPFLAGS"
1644saved_LDFLAGS="$LDFLAGS"
a0391976 1645AC_ARG_WITH(ssl-dir,
1646 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1647 [
e9e4a1c7 1648 if test "x$withval" != "xno" ; then
99eb0f64 1649 case "$withval" in
1650 # Relative paths
1651 ./*|../*) withval="`pwd`/$withval"
1652 esac
5b991353 1653 if test -d "$withval/lib"; then
1654 if test -n "${need_dash_r}"; then
1655 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1656 else
1657 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
d6f13fbb 1658 fi
1659 else
5b991353 1660 if test -n "${need_dash_r}"; then
1661 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1662 else
1663 LDFLAGS="-L${withval} ${LDFLAGS}"
d6f13fbb 1664 fi
1665 fi
5b991353 1666 if test -d "$withval/include"; then
1667 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
d6f13fbb 1668 else
5b991353 1669 CPPFLAGS="-I${withval} ${CPPFLAGS}"
58d100bf 1670 fi
a0391976 1671 fi
5b991353 1672 ]
1673)
5486a457 1674LIBS="-lcrypto $LIBS"
3466e002 1675AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL, 1,
1676 [Define if your ssl headers are included
1677 with #include <openssl/header.h>]),
d45e3d76 1678 [
5b991353 1679 dnl Check default openssl install dir
1680 if test -n "${need_dash_r}"; then
1681 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
d45e3d76 1682 else
5b991353 1683 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
d45e3d76 1684 fi
5b991353 1685 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1686 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1687 [
1688 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1689 ]
1690 )
1691 ]
1692)
1693
cd018561 1694# Determine OpenSSL header version
1695AC_MSG_CHECKING([OpenSSL header version])
1a01a50c 1696AC_RUN_IFELSE(
479cece8 1697 [AC_LANG_SOURCE([[
cd018561 1698#include <stdio.h>
1699#include <string.h>
1700#include <openssl/opensslv.h>
1701#define DATA "conftest.sslincver"
1702int main(void) {
aff51935 1703 FILE *fd;
1704 int rc;
cd018561 1705
aff51935 1706 fd = fopen(DATA,"w");
1707 if(fd == NULL)
1708 exit(1);
cd018561 1709
1710 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1711 exit(1);
1712
1713 exit(0);
1714}
479cece8 1715 ]])],
cd018561 1716 [
1717 ssl_header_ver=`cat conftest.sslincver`
1718 AC_MSG_RESULT($ssl_header_ver)
1719 ],
1720 [
1721 AC_MSG_RESULT(not found)
1722 AC_MSG_ERROR(OpenSSL version header not found.)
1a01a50c 1723 ],
1724 [
1725 AC_MSG_WARN([cross compiling: not checking])
cd018561 1726 ]
1727)
1728
1729# Determine OpenSSL library version
1730AC_MSG_CHECKING([OpenSSL library version])
1a01a50c 1731AC_RUN_IFELSE(
479cece8 1732 [AC_LANG_SOURCE([[
cd018561 1733#include <stdio.h>
1734#include <string.h>
1735#include <openssl/opensslv.h>
1736#include <openssl/crypto.h>
1737#define DATA "conftest.ssllibver"
1738int main(void) {
aff51935 1739 FILE *fd;
1740 int rc;
cd018561 1741
aff51935 1742 fd = fopen(DATA,"w");
1743 if(fd == NULL)
1744 exit(1);
cd018561 1745
1746 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1747 exit(1);
1748
1749 exit(0);
1750}
479cece8 1751 ]])],
cd018561 1752 [
1753 ssl_library_ver=`cat conftest.ssllibver`
1754 AC_MSG_RESULT($ssl_library_ver)
1755 ],
1756 [
1757 AC_MSG_RESULT(not found)
1758 AC_MSG_ERROR(OpenSSL library not found.)
1a01a50c 1759 ],
1760 [
1761 AC_MSG_WARN([cross compiling: not checking])
cd018561 1762 ]
1763)
58d100bf 1764
9780116c 1765# Sanity check OpenSSL headers
1766AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1a01a50c 1767AC_RUN_IFELSE(
479cece8 1768 [AC_LANG_SOURCE([[
9780116c 1769#include <string.h>
1770#include <openssl/opensslv.h>
aec4cb4f 1771int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
479cece8 1772 ]])],
9780116c 1773 [
1774 AC_MSG_RESULT(yes)
1775 ],
1776 [
1777 AC_MSG_RESULT(no)
e15ba28b 1778 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1779Check config.log for details.
1780Also see contrib/findssl.sh for help identifying header/library mismatches.])
1a01a50c 1781 ],
1782 [
1783 AC_MSG_WARN([cross compiling: not checking])
9780116c 1784 ]
1785)
1786
5486a457 1787# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1788# because the system crypt() is more featureful.
1789if test "x$check_for_libcrypt_before" = "x1"; then
1790 AC_CHECK_LIB(crypt, crypt)
1791fi
1792
aff51935 1793# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
8087c5ee 1794# version in OpenSSL.
05114c74 1795if test "x$check_for_libcrypt_later" = "x1"; then
20cad736 1796 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
717057b6 1797fi
1798
4c653d8e 1799AC_CHECK_LIB(iaf, ia_openinfo)
f1b0ecc3 1800
1801### Configure cryptographic random number support
1802
1803# Check wheter OpenSSL seeds itself
1804AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1a01a50c 1805AC_RUN_IFELSE(
479cece8 1806 [AC_LANG_SOURCE([[
f1b0ecc3 1807#include <string.h>
1808#include <openssl/rand.h>
aec4cb4f 1809int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
479cece8 1810 ]])],
f1b0ecc3 1811 [
1812 OPENSSL_SEEDS_ITSELF=yes
1813 AC_MSG_RESULT(yes)
1814 ],
1815 [
1816 AC_MSG_RESULT(no)
1817 # Default to use of the rand helper if OpenSSL doesn't
1818 # seed itself
1819 USE_RAND_HELPER=yes
1a01a50c 1820 ],
1821 [
1822 AC_MSG_WARN([cross compiling: assuming yes])
1823 # This is safe, since all recent OpenSSL versions will
82f4e93d 1824 # complain at runtime if not seeded correctly.
1a01a50c 1825 OPENSSL_SEEDS_ITSELF=yes
f1b0ecc3 1826 ]
1827)
1828
1829
1830# Do we want to force the use of the rand helper?
1831AC_ARG_WITH(rand-helper,
1832 [ --with-rand-helper Use subprocess to gather strong randomness ],
1833 [
1834 if test "x$withval" = "xno" ; then
aff51935 1835 # Force use of OpenSSL's internal RNG, even if
f1b0ecc3 1836 # the previous test showed it to be unseeded.
1837 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1838 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1839 OPENSSL_SEEDS_ITSELF=yes
1840 USE_RAND_HELPER=""
1841 fi
1842 else
1843 USE_RAND_HELPER=yes
1844 fi
1845 ],
82f4e93d 1846)
f1b0ecc3 1847
1848# Which randomness source do we use?
4b492aab 1849if test ! -z "$OPENSSL_SEEDS_ITSELF" && test -z "$USE_RAND_HELPER" ; then
f1b0ecc3 1850 # OpenSSL only
3466e002 1851 AC_DEFINE(OPENSSL_PRNG_ONLY, 1,
1852 [Define if you want OpenSSL's internally seeded PRNG only])
f1b0ecc3 1853 RAND_MSG="OpenSSL internal ONLY"
1854 INSTALL_SSH_RAND_HELPER=""
70e2f2f3 1855elif test ! -z "$USE_RAND_HELPER" ; then
1856 # install rand helper
f1b0ecc3 1857 RAND_MSG="ssh-rand-helper"
1858 INSTALL_SSH_RAND_HELPER="yes"
1859fi
1860AC_SUBST(INSTALL_SSH_RAND_HELPER)
1861
1862### Configuration of ssh-rand-helper
1863
1864# PRNGD TCP socket
1865AC_ARG_WITH(prngd-port,
1866 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1867 [
eb5d7ff6 1868 case "$withval" in
1869 no)
1870 withval=""
1871 ;;
1872 [[0-9]]*)
1873 ;;
1874 *)
1875 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1876 ;;
1877 esac
1878 if test ! -z "$withval" ; then
f1b0ecc3 1879 PRNGD_PORT="$withval"
3466e002 1880 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT,
1881 [Port number of PRNGD/EGD random number socket])
f1b0ecc3 1882 fi
1883 ]
1884)
1885
1886# PRNGD Unix domain socket
1887AC_ARG_WITH(prngd-socket,
1888 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1889 [
eb5d7ff6 1890 case "$withval" in
1891 yes)
f1b0ecc3 1892 withval="/var/run/egd-pool"
eb5d7ff6 1893 ;;
1894 no)
1895 withval=""
1896 ;;
1897 /*)
1898 ;;
1899 *)
1900 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1901 ;;
1902 esac
1903
1904 if test ! -z "$withval" ; then
f1b0ecc3 1905 if test ! -z "$PRNGD_PORT" ; then
1906 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1907 fi
906e811b 1908 if test ! -r "$withval" ; then
f1b0ecc3 1909 AC_MSG_WARN(Entropy socket is not readable)
1910 fi
1911 PRNGD_SOCKET="$withval"
3466e002 1912 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET",
1913 [Location of PRNGD/EGD random number socket])
f1b0ecc3 1914 fi
ddceb1c8 1915 ],
1916 [
1917 # Check for existing socket only if we don't have a random device already
1918 if test "$USE_RAND_HELPER" = yes ; then
1919 AC_MSG_CHECKING(for PRNGD/EGD socket)
1920 # Insert other locations here
1921 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1922 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1923 PRNGD_SOCKET="$sock"
1924 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1925 break;
1926 fi
1927 done
1928 if test ! -z "$PRNGD_SOCKET" ; then
1929 AC_MSG_RESULT($PRNGD_SOCKET)
1930 else
1931 AC_MSG_RESULT(not found)
1932 fi
1933 fi
f1b0ecc3 1934 ]
1935)
1936
1937# Change default command timeout for hashing entropy source
1938entropy_timeout=200
1939AC_ARG_WITH(entropy-timeout,
1940 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1941 [
6cf0200f 1942 if test -n "$withval" && test "x$withval" != "xno" && \
1943 test "x${withval}" != "xyes"; then
f1b0ecc3 1944 entropy_timeout=$withval
1945 fi
82f4e93d 1946 ]
f1b0ecc3 1947)
3466e002 1948AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout,
1949 [Builtin PRNG command timeout])
f1b0ecc3 1950
fd3cbf67 1951SSH_PRIVSEP_USER=sshd
9a0fbcb3 1952AC_ARG_WITH(privsep-user,
5222e7ef 1953 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
9a0fbcb3 1954 [
6cf0200f 1955 if test -n "$withval" && test "x$withval" != "xno" && \
1956 test "x${withval}" != "xyes"; then
fd3cbf67 1957 SSH_PRIVSEP_USER=$withval
9a0fbcb3 1958 fi
82f4e93d 1959 ]
9a0fbcb3 1960)
3466e002 1961AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER",
1962 [non-privileged user for privilege separation])
fd3cbf67 1963AC_SUBST(SSH_PRIVSEP_USER)
9a0fbcb3 1964
81dadca3 1965# We do this little dance with the search path to insure
1966# that programs that we select for use by installed programs
1967# (which may be run by the super-user) come from trusted
1968# locations before they come from the user's private area.
1969# This should help avoid accidentally configuring some
1970# random version of a program in someone's personal bin.
1971
1972OPATH=$PATH
1973PATH=/bin:/usr/bin
f95c8ce8 1974test -h /bin 2> /dev/null && PATH=/usr/bin
81dadca3 1975test -d /sbin && PATH=$PATH:/sbin
1976test -d /usr/sbin && PATH=$PATH:/usr/sbin
1977PATH=$PATH:/etc:$OPATH
1978
aff51935 1979# These programs are used by the command hashing source to gather entropy
f1b0ecc3 1980OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1981OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1982OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1983OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1984OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1985OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1986OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1987OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1988OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1989OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1990OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1991OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1992OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1993OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1994OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1995OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
81dadca3 1996# restore PATH
1997PATH=$OPATH
f1b0ecc3 1998
1999# Where does ssh-rand-helper get its randomness from?
2000INSTALL_SSH_PRNG_CMDS=""
2001if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
2002 if test ! -z "$PRNGD_PORT" ; then
2003 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
2004 elif test ! -z "$PRNGD_SOCKET" ; then
2005 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
2006 else
2007 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
2008 RAND_HELPER_CMDHASH=yes
2009 INSTALL_SSH_PRNG_CMDS="yes"
2010 fi
2011fi
2012AC_SUBST(INSTALL_SSH_PRNG_CMDS)
2013
2014
66d6c27e 2015# Cheap hack to ensure NEWS-OS libraries are arranged right.
2016if test ! -z "$SONY" ; then
2017 LIBS="$LIBS -liberty";
2018fi
2019
9a406e1e 2020# Check for long long datatypes
2021AC_CHECK_TYPES([long long, unsigned long long, long double])
2022
2023# Check datatype sizes
976f7e19 2024AC_CHECK_SIZEOF(char, 1)
2b942fe0 2025AC_CHECK_SIZEOF(short int, 2)
2026AC_CHECK_SIZEOF(int, 4)
2027AC_CHECK_SIZEOF(long int, 4)
2028AC_CHECK_SIZEOF(long long int, 8)
2029
52f1ccb2 2030# Sanity check long long for some platforms (AIX)
2031if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
2032 ac_cv_sizeof_long_long_int=0
2033fi
2034
90f15776 2035# compute LLONG_MIN and LLONG_MAX if we don't know them.
2036if test -z "$have_llong_max"; then
2037 AC_MSG_CHECKING([for max value of long long])
2038 AC_RUN_IFELSE(
2039 [AC_LANG_SOURCE([[
2040#include <stdio.h>
2041/* Why is this so damn hard? */
2042#ifdef __GNUC__
2043# undef __GNUC__
2044#endif
2045#define __USE_ISOC99
2046#include <limits.h>
2047#define DATA "conftest.llminmax"
2048int main(void) {
2049 FILE *f;
2050 long long i, llmin, llmax = 0;
2051
2052 if((f = fopen(DATA,"w")) == NULL)
2053 exit(1);
2054
2055#if defined(LLONG_MIN) && defined(LLONG_MAX)
2056 fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
2057 llmin = LLONG_MIN;
2058 llmax = LLONG_MAX;
2059#else
2060 fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n");
2061 /* This will work on one's complement and two's complement */
2062 for (i = 1; i > llmax; i <<= 1, i++)
2063 llmax = i;
2064 llmin = llmax + 1LL; /* wrap */
2065#endif
2066
2067 /* Sanity check */
2068 if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax
2069 || llmax - 1 > llmax) {
2070 fprintf(f, "unknown unknown\n");
2071 exit(2);
2072 }
2073
2074 if (fprintf(f ,"%lld %lld", llmin, llmax) < 0)
2075 exit(3);
2076
2077 exit(0);
2078}
2079 ]])],
2080 [
2081 llong_min=`$AWK '{print $1}' conftest.llminmax`
2082 llong_max=`$AWK '{print $2}' conftest.llminmax`
2083
2084 # snprintf on some Tru64s doesn't understand "%lld"
2085 case "$host" in
2086 alpha-dec-osf*)
2087 if test "x$ac_cv_sizeof_long_long_int" = "x8" &&
2088 test "x$llong_max" = "xld"; then
2089 llong_min="-9223372036854775808"
2090 llong_max="9223372036854775807"
2091 fi
2092 ;;
2093 esac
2094
2095 AC_MSG_RESULT($llong_max)
2096 AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL],
2097 [max value of long long calculated by configure])
2098 AC_MSG_CHECKING([for min value of long long])
2099 AC_MSG_RESULT($llong_min)
2100 AC_DEFINE_UNQUOTED(LLONG_MIN, [${llong_min}LL],
2101 [min value of long long calculated by configure])
2102 ],
2103 [
2104 AC_MSG_RESULT(not found)
2105 ],
2106 [
2107 AC_MSG_WARN([cross compiling: not checking])
2108 ]
2109 )
2110fi
2111
2112
a0391976 2113# More checks for data types
14a9a859 2114AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
2115 AC_TRY_COMPILE(
aff51935 2116 [ #include <sys/types.h> ],
2117 [ u_int a; a = 1;],
14a9a859 2118 [ ac_cv_have_u_int="yes" ],
2119 [ ac_cv_have_u_int="no" ]
2120 )
2121])
2122if test "x$ac_cv_have_u_int" = "xyes" ; then
3466e002 2123 AC_DEFINE(HAVE_U_INT, 1, [define if you have u_int data type])
14a9a859 2124 have_u_int=1
2125fi
2126
58d100bf 2127AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
2128 AC_TRY_COMPILE(
aff51935 2129 [ #include <sys/types.h> ],
2130 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
58d100bf 2131 [ ac_cv_have_intxx_t="yes" ],
2132 [ ac_cv_have_intxx_t="no" ]
2133 )
2134])
2135if test "x$ac_cv_have_intxx_t" = "xyes" ; then
3466e002 2136 AC_DEFINE(HAVE_INTXX_T, 1, [define if you have intxx_t data type])
58d100bf 2137 have_intxx_t=1
2138fi
41cb4569 2139
2140if (test -z "$have_intxx_t" && \
aff51935 2141 test "x$ac_cv_header_stdint_h" = "xyes")
41cb4569 2142then
2143 AC_MSG_CHECKING([for intXX_t types in stdint.h])
2144 AC_TRY_COMPILE(
aff51935 2145 [ #include <stdint.h> ],
2146 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
41cb4569 2147 [
2148 AC_DEFINE(HAVE_INTXX_T)
2149 AC_MSG_RESULT(yes)
2150 ],
2151 [ AC_MSG_RESULT(no) ]
2152 )
2153fi
2154
bd590612 2155AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
2156 AC_TRY_COMPILE(
1cbbe6c8 2157 [
2158#include <sys/types.h>
2159#ifdef HAVE_STDINT_H
2160# include <stdint.h>
2161#endif
2162#include <sys/socket.h>
2163#ifdef HAVE_SYS_BITYPES_H
2164# include <sys/bitypes.h>
2165#endif
aff51935 2166 ],
2167 [ int64_t a; a = 1;],
bd590612 2168 [ ac_cv_have_int64_t="yes" ],
2169 [ ac_cv_have_int64_t="no" ]
2170 )
2171])
2172if test "x$ac_cv_have_int64_t" = "xyes" ; then
3466e002 2173 AC_DEFINE(HAVE_INT64_T, 1, [define if you have int64_t data type])
ddceb1c8 2174fi
2175
58d100bf 2176AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
2177 AC_TRY_COMPILE(
aff51935 2178 [ #include <sys/types.h> ],
2179 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
58d100bf 2180 [ ac_cv_have_u_intxx_t="yes" ],
2181 [ ac_cv_have_u_intxx_t="no" ]
2182 )
2183])
2184if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
3466e002 2185 AC_DEFINE(HAVE_U_INTXX_T, 1, [define if you have u_intxx_t data type])
58d100bf 2186 have_u_intxx_t=1
2187fi
2b942fe0 2188
41cb4569 2189if test -z "$have_u_intxx_t" ; then
2190 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
2191 AC_TRY_COMPILE(
aff51935 2192 [ #include <sys/socket.h> ],
2193 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
41cb4569 2194 [
2195 AC_DEFINE(HAVE_U_INTXX_T)
2196 AC_MSG_RESULT(yes)
2197 ],
2198 [ AC_MSG_RESULT(no) ]
2199 )
2200fi
2201
bd590612 2202AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
2203 AC_TRY_COMPILE(
aff51935 2204 [ #include <sys/types.h> ],
2205 [ u_int64_t a; a = 1;],
bd590612 2206 [ ac_cv_have_u_int64_t="yes" ],
2207 [ ac_cv_have_u_int64_t="no" ]
2208 )
2209])
2210if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
3466e002 2211 AC_DEFINE(HAVE_U_INT64_T, 1, [define if you have u_int64_t data type])
bd590612 2212 have_u_int64_t=1
2213fi
2214
ddceb1c8 2215if test -z "$have_u_int64_t" ; then
2216 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
2217 AC_TRY_COMPILE(
aff51935 2218 [ #include <sys/bitypes.h> ],
ddceb1c8 2219 [ u_int64_t a; a = 1],
2220 [
2221 AC_DEFINE(HAVE_U_INT64_T)
2222 AC_MSG_RESULT(yes)
2223 ],
2224 [ AC_MSG_RESULT(no) ]
2225 )
2226fi
2227
41cb4569 2228if test -z "$have_u_intxx_t" ; then
2229 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
2230 AC_TRY_COMPILE(
2231 [
2232#include <sys/types.h>
aff51935 2233 ],
2234 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
41cb4569 2235 [ ac_cv_have_uintxx_t="yes" ],
2236 [ ac_cv_have_uintxx_t="no" ]
2237 )
2238 ])
2239 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
3466e002 2240 AC_DEFINE(HAVE_UINTXX_T, 1,
2241 [define if you have uintxx_t data type])
41cb4569 2242 fi
2243fi
2244
2245if test -z "$have_uintxx_t" ; then
2246 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
2247 AC_TRY_COMPILE(
aff51935 2248 [ #include <stdint.h> ],
2249 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
41cb4569 2250 [
2251 AC_DEFINE(HAVE_UINTXX_T)
2252 AC_MSG_RESULT(yes)
2253 ],
2254 [ AC_MSG_RESULT(no) ]
2255 )
2256fi
2257
e5fe9a1f 2258if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
aff51935 2259 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
5cdfe03f 2260then
2261 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2262 AC_TRY_COMPILE(
58d100bf 2263 [
2264#include <sys/bitypes.h>
aff51935 2265 ],
5cdfe03f 2266 [
837c30b8 2267 int8_t a; int16_t b; int32_t c;
2268 u_int8_t e; u_int16_t f; u_int32_t g;
2269 a = b = c = e = f = g = 1;
aff51935 2270 ],
5cdfe03f 2271 [
2272 AC_DEFINE(HAVE_U_INTXX_T)
2273 AC_DEFINE(HAVE_INTXX_T)
2274 AC_MSG_RESULT(yes)
2275 ],
2276 [AC_MSG_RESULT(no)]
aff51935 2277 )
5cdfe03f 2278fi
2279
0362750e 2280
2281AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
2282 AC_TRY_COMPILE(
2283 [
2284#include <sys/types.h>
2285 ],
2286 [ u_char foo; foo = 125; ],
2287 [ ac_cv_have_u_char="yes" ],
2288 [ ac_cv_have_u_char="no" ]
2289 )
2290])
2291if test "x$ac_cv_have_u_char" = "xyes" ; then
3466e002 2292 AC_DEFINE(HAVE_U_CHAR, 1, [define if you have u_char data type])
0362750e 2293fi
2294
98a7c37b 2295TYPE_SOCKLEN_T
2b942fe0 2296
2d16d9a3 2297AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
ddceb1c8 2298
777ece68 2299AC_CHECK_TYPES(in_addr_t,,,
2300[#include <sys/types.h>
2301#include <netinet/in.h>])
7b578f7d 2302
58d100bf 2303AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
2304 AC_TRY_COMPILE(
2305 [
18ba2aab 2306#include <sys/types.h>
58d100bf 2307 ],
2308 [ size_t foo; foo = 1235; ],
2309 [ ac_cv_have_size_t="yes" ],
2310 [ ac_cv_have_size_t="no" ]
2311 )
2312])
2313if test "x$ac_cv_have_size_t" = "xyes" ; then
3466e002 2314 AC_DEFINE(HAVE_SIZE_T, 1, [define if you have size_t data type])
58d100bf 2315fi
ea1970a3 2316
c04f75f1 2317AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
2318 AC_TRY_COMPILE(
2319 [
2320#include <sys/types.h>
2321 ],
2322 [ ssize_t foo; foo = 1235; ],
2323 [ ac_cv_have_ssize_t="yes" ],
2324 [ ac_cv_have_ssize_t="no" ]
2325 )
2326])
2327if test "x$ac_cv_have_ssize_t" = "xyes" ; then
3466e002 2328 AC_DEFINE(HAVE_SSIZE_T, 1, [define if you have ssize_t data type])
c04f75f1 2329fi
2330
f1c4659d 2331AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
2332 AC_TRY_COMPILE(
2333 [
2334#include <time.h>
2335 ],
2336 [ clock_t foo; foo = 1235; ],
2337 [ ac_cv_have_clock_t="yes" ],
2338 [ ac_cv_have_clock_t="no" ]
2339 )
2340])
2341if test "x$ac_cv_have_clock_t" = "xyes" ; then
3466e002 2342 AC_DEFINE(HAVE_CLOCK_T, 1, [define if you have clock_t data type])
f1c4659d 2343fi
2344
1c04b088 2345AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
2346 AC_TRY_COMPILE(
2347 [
2348#include <sys/types.h>
2349#include <sys/socket.h>
2350 ],
2351 [ sa_family_t foo; foo = 1235; ],
2352 [ ac_cv_have_sa_family_t="yes" ],
77bb0bca 2353 [ AC_TRY_COMPILE(
2354 [
2355#include <sys/types.h>
2356#include <sys/socket.h>
2357#include <netinet/in.h>
2358 ],
2359 [ sa_family_t foo; foo = 1235; ],
2360 [ ac_cv_have_sa_family_t="yes" ],
2361
1c04b088 2362 [ ac_cv_have_sa_family_t="no" ]
77bb0bca 2363 )]
1c04b088 2364 )
2365])
2366if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
3466e002 2367 AC_DEFINE(HAVE_SA_FAMILY_T, 1,
2368 [define if you have sa_family_t data type])
1c04b088 2369fi
2370
729bfe59 2371AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
2372 AC_TRY_COMPILE(
2373 [
2374#include <sys/types.h>
2375 ],
2376 [ pid_t foo; foo = 1235; ],
2377 [ ac_cv_have_pid_t="yes" ],
2378 [ ac_cv_have_pid_t="no" ]
2379 )
2380])
2381if test "x$ac_cv_have_pid_t" = "xyes" ; then
3466e002 2382 AC_DEFINE(HAVE_PID_T, 1, [define if you have pid_t data type])
729bfe59 2383fi
2384
2385AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
2386 AC_TRY_COMPILE(
2387 [
2388#include <sys/types.h>
2389 ],
2390 [ mode_t foo; foo = 1235; ],
2391 [ ac_cv_have_mode_t="yes" ],
2392 [ ac_cv_have_mode_t="no" ]
2393 )
2394])
2395if test "x$ac_cv_have_mode_t" = "xyes" ; then
3466e002 2396 AC_DEFINE(HAVE_MODE_T, 1, [define if you have mode_t data type])
729bfe59 2397fi
2398
e3a93db0 2399
58d100bf 2400AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
2401 AC_TRY_COMPILE(
2402 [
18ba2aab 2403#include <sys/types.h>
2404#include <sys/socket.h>
58d100bf 2405 ],
2406 [ struct sockaddr_storage s; ],
2407 [ ac_cv_have_struct_sockaddr_storage="yes" ],
2408 [ ac_cv_have_struct_sockaddr_storage="no" ]
2409 )
2410])
2411if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
3466e002 2412 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1,
2413 [define if you have struct sockaddr_storage data type])
58d100bf 2414fi
48e671d5 2415
58d100bf 2416AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
2417 AC_TRY_COMPILE(
2418 [
cbd7492e 2419#include <sys/types.h>
58d100bf 2420#include <netinet/in.h>
2421 ],
2422 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
2423 [ ac_cv_have_struct_sockaddr_in6="yes" ],
2424 [ ac_cv_have_struct_sockaddr_in6="no" ]
2425 )
2426])
2427if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
3466e002 2428 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1,
2429 [define if you have struct sockaddr_in6 data type])
58d100bf 2430fi
48e671d5 2431
58d100bf 2432AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
2433 AC_TRY_COMPILE(
2434 [
cbd7492e 2435#include <sys/types.h>
58d100bf 2436#include <netinet/in.h>
2437 ],
2438 [ struct in6_addr s; s.s6_addr[0] = 0; ],
2439 [ ac_cv_have_struct_in6_addr="yes" ],
2440 [ ac_cv_have_struct_in6_addr="no" ]
2441 )
2442])
2443if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
3466e002 2444 AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1,
2445 [define if you have struct in6_addr data type])
58d100bf 2446fi
48e671d5 2447
58d100bf 2448AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
2449 AC_TRY_COMPILE(
2450 [
18ba2aab 2451#include <sys/types.h>
2452#include <sys/socket.h>
2453#include <netdb.h>
58d100bf 2454 ],
2455 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
2456 [ ac_cv_have_struct_addrinfo="yes" ],
2457 [ ac_cv_have_struct_addrinfo="no" ]
2458 )
2459])
2460if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
3466e002 2461 AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1,
2462 [define if you have struct addrinfo data type])
58d100bf 2463fi
2464
89c7e31c 2465AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
2466 AC_TRY_COMPILE(
aff51935 2467 [ #include <sys/time.h> ],
2468 [ struct timeval tv; tv.tv_sec = 1;],
89c7e31c 2469 [ ac_cv_have_struct_timeval="yes" ],
2470 [ ac_cv_have_struct_timeval="no" ]
2471 )
2472])
2473if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
3466e002 2474 AC_DEFINE(HAVE_STRUCT_TIMEVAL, 1, [define if you have struct timeval])
89c7e31c 2475 have_struct_timeval=1
2476fi
2477
5271b55c 2478AC_CHECK_TYPES(struct timespec)
2479
85abc74b 2480# We need int64_t or else certian parts of the compile will fail.
4b492aab 2481if test "x$ac_cv_have_int64_t" = "xno" && \
2482 test "x$ac_cv_sizeof_long_int" != "x8" && \
2483 test "x$ac_cv_sizeof_long_long_int" = "x0" ; then
85abc74b 2484 echo "OpenSSH requires int64_t support. Contact your vendor or install"
2485 echo "an alternative compiler (I.E., GCC) before continuing."
2486 echo ""
2487 exit 1;
733cf7f4 2488else
2489dnl test snprintf (broken on SCO w/gcc)
1a01a50c 2490 AC_RUN_IFELSE(
479cece8 2491 [AC_LANG_SOURCE([[
733cf7f4 2492#include <stdio.h>
2493#include <string.h>
2494#ifdef HAVE_SNPRINTF
2495main()
2496{
2497 char buf[50];
2498 char expected_out[50];
2499 int mazsize = 50 ;
2500#if (SIZEOF_LONG_INT == 8)
2501 long int num = 0x7fffffffffffffff;
2502#else
763a1a18 2503 long long num = 0x7fffffffffffffffll;
733cf7f4 2504#endif
2505 strcpy(expected_out, "9223372036854775807");
2506 snprintf(buf, mazsize, "%lld", num);
2507 if(strcmp(buf, expected_out) != 0)
aff51935 2508 exit(1);
733cf7f4 2509 exit(0);
2510}
2511#else
2512main() { exit(0); }
2513#endif
479cece8 2514 ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
1a01a50c 2515 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
733cf7f4 2516 )
2c523de9 2517fi
2518
77bb0bca 2519dnl Checks for structure members
58d100bf 2520OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
2521OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
2522OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
2523OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
2524OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
25422c70 2525OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
58d100bf 2526OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
2527OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
daaff4d5 2528OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
58d100bf 2529OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
2530OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
2531OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
2532OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1d7b9b20 2533OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
2534OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
2535OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
2536OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
98a7c37b 2537
2538AC_CHECK_MEMBERS([struct stat.st_blksize])
ccc45ee0 2539AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE(__res_state, state,
2540 [Define if we don't have struct __res_state in resolv.h])],
2541[
2542#include <stdio.h>
2543#if HAVE_SYS_TYPES_H
2544# include <sys/types.h>
2545#endif
2546#include <netinet/in.h>
2547#include <arpa/nameser.h>
2548#include <resolv.h>
2549])
1d7b9b20 2550
58d100bf 2551AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
2552 ac_cv_have_ss_family_in_struct_ss, [
2553 AC_TRY_COMPILE(
2554 [
18ba2aab 2555#include <sys/types.h>
2556#include <sys/socket.h>
58d100bf 2557 ],
2558 [ struct sockaddr_storage s; s.ss_family = 1; ],
2559 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
2560 [ ac_cv_have_ss_family_in_struct_ss="no" ],
2561 )
2562])
2563if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
3466e002 2564 AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Fields in struct sockaddr_storage])
58d100bf 2565fi
2566
58d100bf 2567AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
2568 ac_cv_have___ss_family_in_struct_ss, [
2569 AC_TRY_COMPILE(
2570 [
18ba2aab 2571#include <sys/types.h>
2572#include <sys/socket.h>
58d100bf 2573 ],
2574 [ struct sockaddr_storage s; s.__ss_family = 1; ],
2575 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
2576 [ ac_cv_have___ss_family_in_struct_ss="no" ]
2577 )
2578])
2579if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
3466e002 2580 AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1,
2581 [Fields in struct sockaddr_storage])
58d100bf 2582fi
2583
2e73a022 2584AC_CACHE_CHECK([for pw_class field in struct passwd],
2585 ac_cv_have_pw_class_in_struct_passwd, [
2586 AC_TRY_COMPILE(
2587 [
2e73a022 2588#include <pwd.h>
2589 ],
97994d32 2590 [ struct passwd p; p.pw_class = 0; ],
2e73a022 2591 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
2592 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
2593 )
2594])
2595if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
3466e002 2596 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD, 1,
2597 [Define if your password has a pw_class field])
2e73a022 2598fi
2599
7751d4eb 2600AC_CACHE_CHECK([for pw_expire field in struct passwd],
2601 ac_cv_have_pw_expire_in_struct_passwd, [
2602 AC_TRY_COMPILE(
2603 [
2604#include <pwd.h>
2605 ],
2606 [ struct passwd p; p.pw_expire = 0; ],
2607 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
2608 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
2609 )
2610])
2611if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
3466e002 2612 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD, 1,
2613 [Define if your password has a pw_expire field])
7751d4eb 2614fi
2615
2616AC_CACHE_CHECK([for pw_change field in struct passwd],
2617 ac_cv_have_pw_change_in_struct_passwd, [
2618 AC_TRY_COMPILE(
2619 [
2620#include <pwd.h>
2621 ],
2622 [ struct passwd p; p.pw_change = 0; ],
2623 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
2624 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
2625 )
2626])
2627if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
3466e002 2628 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD, 1,
2629 [Define if your password has a pw_change field])
7751d4eb 2630fi
58d100bf 2631
637f9177 2632dnl make sure we're using the real structure members and not defines
6f34652e 2633AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2634 ac_cv_have_accrights_in_msghdr, [
1a01a50c 2635 AC_COMPILE_IFELSE(
6f34652e 2636 [
f95c8ce8 2637#include <sys/types.h>
6f34652e 2638#include <sys/socket.h>
2639#include <sys/uio.h>
637f9177 2640int main() {
2641#ifdef msg_accrights
1a01a50c 2642#error "msg_accrights is a macro"
637f9177 2643exit(1);
2644#endif
2645struct msghdr m;
2646m.msg_accrights = 0;
2647exit(0);
2648}
6f34652e 2649 ],
6f34652e 2650 [ ac_cv_have_accrights_in_msghdr="yes" ],
2651 [ ac_cv_have_accrights_in_msghdr="no" ]
2652 )
2653])
2654if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
3466e002 2655 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR, 1,
2656 [Define if your system uses access rights style
2657 file descriptor passing])
6f34652e 2658fi
2659
7176df4f 2660AC_CACHE_CHECK([for msg_control field in struct msghdr],
2661 ac_cv_have_control_in_msghdr, [
1a01a50c 2662 AC_COMPILE_IFELSE(
7176df4f 2663 [
f95c8ce8 2664#include <sys/types.h>
7176df4f 2665#include <sys/socket.h>
2666#include <sys/uio.h>
637f9177 2667int main() {
2668#ifdef msg_control
1a01a50c 2669#error "msg_control is a macro"
637f9177 2670exit(1);
2671#endif
2672struct msghdr m;
2673m.msg_control = 0;
2674exit(0);
2675}
7176df4f 2676 ],
7176df4f 2677 [ ac_cv_have_control_in_msghdr="yes" ],
2678 [ ac_cv_have_control_in_msghdr="no" ]
2679 )
2680])
2681if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
3466e002 2682 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR, 1,
2683 [Define if your system uses ancillary data style
2684 file descriptor passing])
7176df4f 2685fi
2686
58d100bf 2687AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
aff51935 2688 AC_TRY_LINK([],
2689 [ extern char *__progname; printf("%s", __progname); ],
58d100bf 2690 [ ac_cv_libc_defines___progname="yes" ],
2691 [ ac_cv_libc_defines___progname="no" ]
2692 )
2693])
2694if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
3466e002 2695 AC_DEFINE(HAVE___PROGNAME, 1, [Define if libc defines __progname])
58d100bf 2696fi
8946db53 2697
c921ee00 2698AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
2699 AC_TRY_LINK([
2700#include <stdio.h>
aff51935 2701],
2702 [ printf("%s", __FUNCTION__); ],
c921ee00 2703 [ ac_cv_cc_implements___FUNCTION__="yes" ],
2704 [ ac_cv_cc_implements___FUNCTION__="no" ]
2705 )
2706])
2707if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
3466e002 2708 AC_DEFINE(HAVE___FUNCTION__, 1,
2709 [Define if compiler implements __FUNCTION__])
c921ee00 2710fi
2711
2712AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
2713 AC_TRY_LINK([
2714#include <stdio.h>
aff51935 2715],
2716 [ printf("%s", __func__); ],
c921ee00 2717 [ ac_cv_cc_implements___func__="yes" ],
2718 [ ac_cv_cc_implements___func__="no" ]
2719 )
2720])
2721if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
3466e002 2722 AC_DEFINE(HAVE___func__, 1, [Define if compiler implements __func__])
c921ee00 2723fi
2724
9a406e1e 2725AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [
2726 AC_TRY_LINK(
2727 [#include <stdarg.h>
2728 va_list x,y;],
2729 [va_copy(x,y);],
2730 [ ac_cv_have_va_copy="yes" ],
2731 [ ac_cv_have_va_copy="no" ]
2732 )
2733])
2734if test "x$ac_cv_have_va_copy" = "xyes" ; then
2735 AC_DEFINE(HAVE_VA_COPY, 1, [Define if va_copy exists])
2736fi
2737
2738AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [
2739 AC_TRY_LINK(
2740 [#include <stdarg.h>
2741 va_list x,y;],
2742 [__va_copy(x,y);],
2743 [ ac_cv_have___va_copy="yes" ],
2744 [ ac_cv_have___va_copy="no" ]
2745 )
2746])
2747if test "x$ac_cv_have___va_copy" = "xyes" ; then
2748 AC_DEFINE(HAVE___VA_COPY, 1, [Define if __va_copy exists])
2749fi
2750
1812a662 2751AC_CACHE_CHECK([whether getopt has optreset support],
2752 ac_cv_have_getopt_optreset, [
2753 AC_TRY_LINK(
2754 [
2755#include <getopt.h>
2756 ],
2757 [ extern int optreset; optreset = 0; ],
2758 [ ac_cv_have_getopt_optreset="yes" ],
2759 [ ac_cv_have_getopt_optreset="no" ]
2760 )
2761])
2762if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
3466e002 2763 AC_DEFINE(HAVE_GETOPT_OPTRESET, 1,
2764 [Define if your getopt(3) defines and uses optreset])
1812a662 2765fi
a0391976 2766
819b676f 2767AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
aff51935 2768 AC_TRY_LINK([],
2769 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
819b676f 2770 [ ac_cv_libc_defines_sys_errlist="yes" ],
2771 [ ac_cv_libc_defines_sys_errlist="no" ]
2772 )
2773])
2774if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
3466e002 2775 AC_DEFINE(HAVE_SYS_ERRLIST, 1,
2776 [Define if your system defines sys_errlist[]])
819b676f 2777fi
2778
2779
416ed5a7 2780AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
aff51935 2781 AC_TRY_LINK([],
2782 [ extern int sys_nerr; printf("%i", sys_nerr);],
416ed5a7 2783 [ ac_cv_libc_defines_sys_nerr="yes" ],
2784 [ ac_cv_libc_defines_sys_nerr="no" ]
2785 )
2786])
2787if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
3466e002 2788 AC_DEFINE(HAVE_SYS_NERR, 1, [Define if your system defines sys_nerr])
416ed5a7 2789fi
2790
aff51935 2791SCARD_MSG="no"
295c8801 2792# Check whether user wants sectok support
2793AC_ARG_WITH(sectok,
2794 [ --with-sectok Enable smartcard support using libsectok],
d0b19c95 2795 [
2796 if test "x$withval" != "xno" ; then
2797 if test "x$withval" != "xyes" ; then
2798 CPPFLAGS="$CPPFLAGS -I${withval}"
2799 LDFLAGS="$LDFLAGS -L${withval}"
2800 if test ! -z "$need_dash_r" ; then
2801 LDFLAGS="$LDFLAGS -R${withval}"
2802 fi
2803 if test ! -z "$blibpath" ; then
2804 blibpath="$blibpath:${withval}"
2805 fi
2806 fi
2807 AC_CHECK_HEADERS(sectok.h)
2808 if test "$ac_cv_header_sectok_h" != yes; then
2809 AC_MSG_ERROR(Can't find sectok.h)
2810 fi
2811 AC_CHECK_LIB(sectok, sectok_open)
2812 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2813 AC_MSG_ERROR(Can't find libsectok)
2814 fi
3466e002 2815 AC_DEFINE(SMARTCARD, 1,
2816 [Define if you want smartcard support])
2817 AC_DEFINE(USE_SECTOK, 1,
2818 [Define if you want smartcard support
2819 using sectok])
aff51935 2820 SCARD_MSG="yes, using sectok"
295c8801 2821 fi
2822 ]
2823)
2824
2825# Check whether user wants OpenSC support
987b458f 2826OPENSC_CONFIG="no"
295c8801 2827AC_ARG_WITH(opensc,
e47fb473 2828 [ --with-opensc[[=PFX]] Enable smartcard support using OpenSC (optionally in PATH)],
987b458f 2829 [
2830 if test "x$withval" != "xno" ; then
2831 if test "x$withval" != "xyes" ; then
2832 OPENSC_CONFIG=$withval/bin/opensc-config
2833 else
2834 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2835 fi
2836 if test "$OPENSC_CONFIG" != "no"; then
2837 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2838 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2839 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2840 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2841 AC_DEFINE(SMARTCARD)
3466e002 2842 AC_DEFINE(USE_OPENSC, 1,
2843 [Define if you want smartcard support
2844 using OpenSC])
987b458f 2845 SCARD_MSG="yes, using OpenSC"
2846 fi
2847 fi
2848 ]
2849)
d0b19c95 2850
c31dc31c 2851# Check libraries needed by DNS fingerprint support
aff51935 2852AC_SEARCH_LIBS(getrrsetbyname, resolv,
3466e002 2853 [AC_DEFINE(HAVE_GETRRSETBYNAME, 1,
2854 [Define if getrrsetbyname() exists])],
3e05e934 2855 [
c31dc31c 2856 # Needed by our getrrsetbyname()
2857 AC_SEARCH_LIBS(res_query, resolv)
2858 AC_SEARCH_LIBS(dn_expand, resolv)
dabb524a 2859 AC_MSG_CHECKING(if res_query will link)
2860 AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes),
2861 [AC_MSG_RESULT(no)
2862 saved_LIBS="$LIBS"
2863 LIBS="$LIBS -lresolv"
2864 AC_MSG_CHECKING(for res_query in -lresolv)
2865 AC_LINK_IFELSE([
2866#include <resolv.h>
2867int main()
2868{
2869 res_query (0, 0, 0, 0, 0);
2870 return 0;
2871}
2872 ],
2873 [LIBS="$LIBS -lresolv"
2874 AC_MSG_RESULT(yes)],
2875 [LIBS="$saved_LIBS"
2876 AC_MSG_RESULT(no)])
2877 ])
c31dc31c 2878 AC_CHECK_FUNCS(_getshort _getlong)
1c829da5 2879 AC_CHECK_DECLS([_getshort, _getlong], , ,
b5765e1d 2880 [#include <sys/types.h>
2881 #include <arpa/nameser.h>])
c31dc31c 2882 AC_CHECK_MEMBER(HEADER.ad,
3466e002 2883 [AC_DEFINE(HAVE_HEADER_AD, 1,
2884 [Define if HEADER.ad exists in arpa/nameser.h])],,
c31dc31c 2885 [#include <arpa/nameser.h>])
2886 ])
3e05e934 2887
12928e80 2888# Check whether user wants Kerberos 5 support
aff51935 2889KRB5_MSG="no"
12928e80 2890AC_ARG_WITH(kerberos5,
aff51935 2891 [ --with-kerberos5=PATH Enable Kerberos 5 support],
5585c441 2892 [ if test "x$withval" != "xno" ; then
2893 if test "x$withval" = "xyes" ; then
2894 KRB5ROOT="/usr/local"
2895 else
2896 KRB5ROOT=${withval}
2897 fi
2898
3466e002 2899 AC_DEFINE(KRB5, 1, [Define if you want Kerberos 5 support])
5585c441 2900 KRB5_MSG="yes"
2901
2902 AC_MSG_CHECKING(for krb5-config)
2903 if test -x $KRB5ROOT/bin/krb5-config ; then
2904 KRB5CONF=$KRB5ROOT/bin/krb5-config
2905 AC_MSG_RESULT($KRB5CONF)
2906
2907 AC_MSG_CHECKING(for gssapi support)
2908 if $KRB5CONF | grep gssapi >/dev/null ; then
2909 AC_MSG_RESULT(yes)
3466e002 2910 AC_DEFINE(GSSAPI, 1,
2911 [Define this if you want GSSAPI
2912 support in the version 2 protocol])
071970fb 2913 k5confopts=gssapi
aff51935 2914 else
5585c441 2915 AC_MSG_RESULT(no)
071970fb 2916 k5confopts=""
aff51935 2917 fi
071970fb 2918 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2919 K5LIBS="`$KRB5CONF --libs $k5confopts`"
5585c441 2920 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
5585c441 2921 AC_MSG_CHECKING(whether we are using Heimdal)
2922 AC_TRY_COMPILE([ #include <krb5.h> ],
2923 [ char *tmp = heimdal_version; ],
2924 [ AC_MSG_RESULT(yes)
3466e002 2925 AC_DEFINE(HEIMDAL, 1,
2926 [Define this if you are using the
2927 Heimdal version of Kerberos V5]) ],
5585c441 2928 AC_MSG_RESULT(no)
2929 )
2930 else
2931 AC_MSG_RESULT(no)
12928e80 2932 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
aff51935 2933 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
aff51935 2934 AC_MSG_CHECKING(whether we are using Heimdal)
2935 AC_TRY_COMPILE([ #include <krb5.h> ],
2936 [ char *tmp = heimdal_version; ],
2937 [ AC_MSG_RESULT(yes)
2938 AC_DEFINE(HEIMDAL)
41707f74 2939 K5LIBS="-lkrb5 -ldes"
2940 K5LIBS="$K5LIBS -lcom_err -lasn1"
82f4e93d 2941 AC_CHECK_LIB(roken, net_write,
41707f74 2942 [K5LIBS="$K5LIBS -lroken"])
aff51935 2943 ],
2944 [ AC_MSG_RESULT(no)
2945 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2946 ]
2947 )
4e00038c 2948 AC_SEARCH_LIBS(dn_expand, resolv)
12928e80 2949
749560dd 2950 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2951 [ AC_DEFINE(GSSAPI)
2952 K5LIBS="-lgssapi $K5LIBS" ],
2953 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2954 [ AC_DEFINE(GSSAPI)
aff51935 2955 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
749560dd 2956 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2957 $K5LIBS)
2958 ],
2959 $K5LIBS)
82f4e93d 2960
749560dd 2961 AC_CHECK_HEADER(gssapi.h, ,
2962 [ unset ac_cv_header_gssapi_h
aff51935 2963 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
749560dd 2964 AC_CHECK_HEADERS(gssapi.h, ,
2965 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
aff51935 2966 )
749560dd 2967 ]
2968 )
2969
2970 oldCPP="$CPPFLAGS"
2971 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2972 AC_CHECK_HEADER(gssapi_krb5.h, ,
2973 [ CPPFLAGS="$oldCPP" ])
2974
aff51935 2975 fi
5585c441 2976 if test ! -z "$need_dash_r" ; then
2977 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2978 fi
2979 if test ! -z "$blibpath" ; then
2980 blibpath="$blibpath:${KRB5ROOT}/lib"
2981 fi
071970fb 2982
f5555364 2983 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
2984 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
2985 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
071970fb 2986
f5555364 2987 LIBS="$LIBS $K5LIBS"
3466e002 2988 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS, 1,
2989 [Define this if you want to use libkafs' AFS support]))
f5555364 2990 fi
071970fb 2991 ]
12928e80 2992)
b5b68128 2993
a0391976 2994# Looking for programs, paths and files
a0391976 2995
ecac8ee5 2996PRIVSEP_PATH=/var/empty
2997AC_ARG_WITH(privsep-path,
cda1ebcb 2998 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
ecac8ee5 2999 [
6cf0200f 3000 if test -n "$withval" && test "x$withval" != "xno" && \
3001 test "x${withval}" != "xyes"; then
ecac8ee5 3002 PRIVSEP_PATH=$withval
3003 fi
3004 ]
3005)
3006AC_SUBST(PRIVSEP_PATH)
3007
a0391976 3008AC_ARG_WITH(xauth,
3009 [ --with-xauth=PATH Specify path to xauth program ],
3010 [
6cf0200f 3011 if test -n "$withval" && test "x$withval" != "xno" && \
3012 test "x${withval}" != "xyes"; then
cbd7492e 3013 xauth_path=$withval
a0391976 3014 fi
3015 ],
3016 [
2bf42e4a 3017 TestPath="$PATH"
3018 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
3019 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
3020 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
3021 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
3022 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
e5fe9a1f 3023 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
a0391976 3024 xauth_path="/usr/openwin/bin/xauth"
3025 fi
3026 ]
3027)
3028
65a4b4af 3029STRIP_OPT=-s
3030AC_ARG_ENABLE(strip,
3031 [ --disable-strip Disable calling strip(1) on install],
3032 [
3033 if test "x$enableval" = "xno" ; then
3034 STRIP_OPT=
3035 fi
3036 ]
3037)
3038AC_SUBST(STRIP_OPT)
3039
b3ec54b4 3040if test -z "$xauth_path" ; then
3041 XAUTH_PATH="undefined"
3042 AC_SUBST(XAUTH_PATH)
3043else
3466e002 3044 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path",
3045 [Define if xauth is found in your path])
b3ec54b4 3046 XAUTH_PATH=$xauth_path
3047 AC_SUBST(XAUTH_PATH)
a0391976 3048fi
a0391976 3049
3050# Check for mail directory (last resort if we cannot get it from headers)
3051if test ! -z "$MAIL" ; then
3052 maildir=`dirname $MAIL`
3466e002 3053 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir",
3054 [Set this to your mail directory if you don't have maillock.h])
a0391976 3055fi
3056
479cece8 3057if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
1a01a50c 3058 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
3059 disable_ptmx_check=yes
3060fi
a0391976 3061if test -z "$no_dev_ptmx" ; then
6e879cb4 3062 if test "x$disable_ptmx_check" != "xyes" ; then
aff51935 3063 AC_CHECK_FILE("/dev/ptmx",
6e879cb4 3064 [
3466e002 3065 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1,
3066 [Define if you have /dev/ptmx])
6e879cb4 3067 have_dev_ptmx=1
3068 ]
3069 )
3070 fi
3276571c 3071fi
1a01a50c 3072
479cece8 3073if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
1a01a50c 3074 AC_CHECK_FILE("/dev/ptc",
3075 [
3466e002 3076 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1,
3077 [Define if you have /dev/ptc])
1a01a50c 3078 have_dev_ptc=1
3079 ]
3080 )
3081else
3082 AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
3083fi
3276571c 3084
a0391976 3085# Options from here on. Some of these are preset by platform above
fdf6b7aa 3086AC_ARG_WITH(mantype,
5d97cfbf 3087 [ --with-mantype=man|cat|doc Set man page type],
c54a6257 3088 [
5d97cfbf 3089 case "$withval" in
3090 man|cat|doc)
3091 MANTYPE=$withval
3092 ;;
3093 *)
3094 AC_MSG_ERROR(invalid man type: $withval)
3095 ;;
3096 esac
c54a6257 3097 ]
3098)
e0c4d3ac 3099if test -z "$MANTYPE"; then
2bf42e4a 3100 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
3101 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
e0c4d3ac 3102 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
3103 MANTYPE=doc
3104 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
3105 MANTYPE=man
3106 else
3107 MANTYPE=cat
3108 fi
3109fi
c54a6257 3110AC_SUBST(MANTYPE)
e0c4d3ac 3111if test "$MANTYPE" = "doc"; then
3112 mansubdir=man;
3113else
3114 mansubdir=$MANTYPE;
3115fi
3116AC_SUBST(mansubdir)
0bc5b6fb 3117
a0391976 3118# Check whether to enable MD5 passwords
aff51935 3119MD5_MSG="no"
2ddcfdf3 3120AC_ARG_WITH(md5-passwords,
caf3bc51 3121 [ --with-md5-passwords Enable use of MD5 passwords],
0bc5b6fb 3122 [
bcf36c78 3123 if test "x$withval" != "xno" ; then
3466e002 3124 AC_DEFINE(HAVE_MD5_PASSWORDS, 1,
3125 [Define if you want to allow MD5 passwords])
aff51935 3126 MD5_MSG="yes"
0bc5b6fb 3127 fi
3128 ]
caf3bc51 3129)
3130
a0391976 3131# Whether to disable shadow password support
a7effaac 3132AC_ARG_WITH(shadow,
3133 [ --without-shadow Disable shadow password support],
3134 [
82f4e93d 3135 if test "x$withval" = "xno" ; then
a7effaac 3136 AC_DEFINE(DISABLE_SHADOW)
4cb5ffa0 3137 disable_shadow=yes
a7effaac 3138 fi
3139 ]
3140)
3141
4cb5ffa0 3142if test -z "$disable_shadow" ; then
3143 AC_MSG_CHECKING([if the systems has expire shadow information])
3144 AC_TRY_COMPILE(
3145 [
3146#include <sys/types.h>
3147#include <shadow.h>
3148 struct spwd sp;
3149 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
3150 [ sp_expire_available=yes ], []
3151 )
3152
3153 if test "x$sp_expire_available" = "xyes" ; then
3154 AC_MSG_RESULT(yes)
3466e002 3155 AC_DEFINE(HAS_SHADOW_EXPIRE, 1,
3156 [Define if you want to use shadow password expire field])
4cb5ffa0 3157 else
3158 AC_MSG_RESULT(no)
3159 fi
3160fi
3161
a0391976 3162# Use ip address instead of hostname in $DISPLAY
44839801 3163if test ! -z "$IPADDR_IN_DISPLAY" ; then
3164 DISPLAY_HACK_MSG="yes"
3466e002 3165 AC_DEFINE(IPADDR_IN_DISPLAY, 1,
3166 [Define if you need to use IP address
3167 instead of hostname in $DISPLAY])
44839801 3168else
aff51935 3169 DISPLAY_HACK_MSG="no"
44839801 3170 AC_ARG_WITH(ipaddr-display,
3171 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
3172 [
82f4e93d 3173 if test "x$withval" != "xno" ; then
44839801 3174 AC_DEFINE(IPADDR_IN_DISPLAY)
aff51935 3175 DISPLAY_HACK_MSG="yes"
44839801 3176 fi
3177 ]
3178 )
3179fi
a7effaac 3180
95b99395 3181# check for /etc/default/login and use it if present.
daa41e62 3182AC_ARG_ENABLE(etc-default-login,
6ff3d0dc 3183 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
694d0cef 3184 [ if test "x$enableval" = "xno"; then
3185 AC_MSG_NOTICE([/etc/default/login handling disabled])
3186 etc_default_login=no
3187 else
3188 etc_default_login=yes
3189 fi ],
b0e7249f 3190 [ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
3191 then
3192 AC_MSG_WARN([cross compiling: not checking /etc/default/login])
3193 etc_default_login=no
3194 else
3195 etc_default_login=yes
3196 fi ]
694d0cef 3197)
95b99395 3198
694d0cef 3199if test "x$etc_default_login" != "xno"; then
3200 AC_CHECK_FILE("/etc/default/login",
3201 [ external_path_file=/etc/default/login ])
b0e7249f 3202 if test "x$external_path_file" = "x/etc/default/login"; then
3466e002 3203 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN, 1,
3204 [Define if your system has /etc/default/login])
1a01a50c 3205 fi
694d0cef 3206fi
95b99395 3207
8d184c09 3208dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
4b492aab 3209if test $ac_cv_func_login_getcapbool = "yes" && \
3210 test $ac_cv_header_login_cap_h = "yes" ; then
95b99395 3211 external_path_file=/etc/login.conf
8d184c09 3212fi
95b99395 3213
a0391976 3214# Whether to mess with the default path
aff51935 3215SERVER_PATH_MSG="(default)"
c43d69a9 3216AC_ARG_WITH(default-path,
75817f90 3217 [ --with-default-path= Specify default \$PATH environment for server],
cb807f40 3218 [
95b99395 3219 if test "x$external_path_file" = "x/etc/login.conf" ; then
8d184c09 3220 AC_MSG_WARN([
3221--with-default-path=PATH has no effect on this system.
3222Edit /etc/login.conf instead.])
82f4e93d 3223 elif test "x$withval" != "xno" ; then
89bbd457 3224 if test ! -z "$external_path_file" ; then
95b99395 3225 AC_MSG_WARN([
3226--with-default-path=PATH will only be used if PATH is not defined in
3227$external_path_file .])
3228 fi
b2d818e6 3229 user_path="$withval"
aff51935 3230 SERVER_PATH_MSG="$withval"
cb807f40 3231 fi
b2d818e6 3232 ],
95b99395 3233 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
3234 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
8d184c09 3235 else
89bbd457 3236 if test ! -z "$external_path_file" ; then
95b99395 3237 AC_MSG_WARN([
3238If PATH is defined in $external_path_file, ensure the path to scp is included,
3239otherwise scp will not work.])
3240 fi
b0e7249f 3241 AC_RUN_IFELSE(
3242 [AC_LANG_SOURCE([[
b2d818e6 3243/* find out what STDPATH is */
3244#include <stdio.h>
b2d818e6 3245#ifdef HAVE_PATHS_H
3246# include <paths.h>
3247#endif
3248#ifndef _PATH_STDPATH
d9a4e55b 3249# ifdef _PATH_USERPATH /* Irix */
3250# define _PATH_STDPATH _PATH_USERPATH
3251# else
3252# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
3253# endif
b2d818e6 3254#endif
3255#include <sys/types.h>
3256#include <sys/stat.h>
3257#include <fcntl.h>
3258#define DATA "conftest.stdpath"
3259
3260main()
3261{
3262 FILE *fd;
3263 int rc;
82f4e93d 3264
b2d818e6 3265 fd = fopen(DATA,"w");
3266 if(fd == NULL)
3267 exit(1);
82f4e93d 3268
b2d818e6 3269 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
3270 exit(1);
3271
3272 exit(0);
3273}
b0e7249f 3274 ]])],
3275 [ user_path=`cat conftest.stdpath` ],
b2d818e6 3276 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
3277 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
3278 )
3279# make sure $bindir is in USER_PATH so scp will work
3280 t_bindir=`eval echo ${bindir}`
3281 case $t_bindir in
3282 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
3283 esac
3284 case $t_bindir in
3285 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
3286 esac
3287 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
3288 if test $? -ne 0 ; then
3289 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
3290 if test $? -ne 0 ; then
3291 user_path=$user_path:$t_bindir
3292 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
3293 fi
3294 fi
8d184c09 3295 fi ]
cb807f40 3296)
95b99395 3297if test "x$external_path_file" != "x/etc/login.conf" ; then
3466e002 3298 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path", [Specify default $PATH])
8d184c09 3299 AC_SUBST(user_path)
3300fi
cb807f40 3301
06617857 3302# Set superuser path separately to user path
06617857 3303AC_ARG_WITH(superuser-path,
3304 [ --with-superuser-path= Specify different path for super-user],
3305 [
6cf0200f 3306 if test -n "$withval" && test "x$withval" != "xno" && \
3307 test "x${withval}" != "xyes"; then
3466e002 3308 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval",
3309 [Define if you want a different $PATH
3310 for the superuser])
06617857 3311 superuser_path=$withval
3312 fi
3313 ]
3314)
3315
3316
58d100bf 3317AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
aff51935 3318IPV4_IN6_HACK_MSG="no"
80faa19f 3319AC_ARG_WITH(4in6,
3320 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
3321 [
3322 if test "x$withval" != "xno" ; then
3323 AC_MSG_RESULT(yes)
3466e002 3324 AC_DEFINE(IPV4_IN_IPV6, 1,
3325 [Detect IPv4 in IPv6 mapped addresses
3326 and treat as IPv4])
aff51935 3327 IPV4_IN6_HACK_MSG="yes"
80faa19f 3328 else
3329 AC_MSG_RESULT(no)
3330 fi
3331 ],[
3332 if test "x$inet6_default_4in6" = "xyes"; then
3333 AC_MSG_RESULT([yes (default)])
3334 AC_DEFINE(IPV4_IN_IPV6)
aff51935 3335 IPV4_IN6_HACK_MSG="yes"
80faa19f 3336 else
3337 AC_MSG_RESULT([no (default)])
3338 fi
3339 ]
3340)
3341
af774732 3342# Whether to enable BSD auth support
f1b0ecc3 3343BSD_AUTH_MSG=no
af774732 3344AC_ARG_WITH(bsd-auth,
3345 [ --with-bsd-auth Enable BSD auth support],
3346 [
82f4e93d 3347 if test "x$withval" != "xno" ; then
3466e002 3348 AC_DEFINE(BSD_AUTH, 1,
3349 [Define if you have BSD auth support])
f1b0ecc3 3350 BSD_AUTH_MSG=yes
af774732 3351 fi
3352 ]
3353)
3354
a0391976 3355# Where to place sshd.pid
19d9ac2a 3356piddir=/var/run
81dadca3 3357# make sure the directory exists
82f4e93d 3358if test ! -d $piddir ; then
81dadca3 3359 piddir=`eval echo ${sysconfdir}`
3360 case $piddir in
aff51935 3361 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
81dadca3 3362 esac
3363fi
3364
47e45e44 3365AC_ARG_WITH(pid-dir,
3366 [ --with-pid-dir=PATH Specify location of ssh.pid file],
3367 [
6cf0200f 3368 if test -n "$withval" && test "x$withval" != "xno" && \
3369 test "x${withval}" != "xyes"; then
19d9ac2a 3370 piddir=$withval
82f4e93d 3371 if test ! -d $piddir ; then
81dadca3 3372 AC_MSG_WARN([** no $piddir directory on this system **])
3373 fi
47e45e44 3374 fi
3375 ]
3376)
b7a87eea 3377
3466e002 3378AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir", [Specify location of ssh.pid])
19d9ac2a 3379AC_SUBST(piddir)
47e45e44 3380
1d7b9b20 3381dnl allow user to disable some login recording features
3382AC_ARG_ENABLE(lastlog,
bfd550a2 3383 [ --disable-lastlog disable use of lastlog even if detected [no]],
ddb154b3 3384 [
3385 if test "x$enableval" = "xno" ; then
3386 AC_DEFINE(DISABLE_LASTLOG)
3387 fi
3388 ]
1d7b9b20 3389)
3390AC_ARG_ENABLE(utmp,
bfd550a2 3391 [ --disable-utmp disable use of utmp even if detected [no]],
ddb154b3 3392 [
3393 if test "x$enableval" = "xno" ; then
3394 AC_DEFINE(DISABLE_UTMP)
3395 fi
3396 ]
1d7b9b20 3397)
3398AC_ARG_ENABLE(utmpx,
bfd550a2 3399 [ --disable-utmpx disable use of utmpx even if detected [no]],
ddb154b3 3400 [
3401 if test "x$enableval" = "xno" ; then
3466e002 3402 AC_DEFINE(DISABLE_UTMPX, 1,
3403 [Define if you don't want to use utmpx])
ddb154b3 3404 fi
3405 ]
1d7b9b20 3406)
3407AC_ARG_ENABLE(wtmp,
bfd550a2 3408 [ --disable-wtmp disable use of wtmp even if detected [no]],
ddb154b3 3409 [
3410 if test "x$enableval" = "xno" ; then
3411 AC_DEFINE(DISABLE_WTMP)
3412 fi
3413 ]
1d7b9b20 3414)
3415AC_ARG_ENABLE(wtmpx,
bfd550a2 3416 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
ddb154b3 3417 [
3418 if test "x$enableval" = "xno" ; then
3466e002 3419 AC_DEFINE(DISABLE_WTMPX, 1,
3420 [Define if you don't want to use wtmpx])
ddb154b3 3421 fi
3422 ]
1d7b9b20 3423)
3424AC_ARG_ENABLE(libutil,
bfd550a2 3425 [ --disable-libutil disable use of libutil (login() etc.) [no]],
ddb154b3 3426 [
3427 if test "x$enableval" = "xno" ; then
3428 AC_DEFINE(DISABLE_LOGIN)
3429 fi
3430 ]
1d7b9b20 3431)
3432AC_ARG_ENABLE(pututline,
bfd550a2 3433 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
ddb154b3 3434 [
3435 if test "x$enableval" = "xno" ; then
3466e002 3436 AC_DEFINE(DISABLE_PUTUTLINE, 1,
3437 [Define if you don't want to use pututline()
3438 etc. to write [uw]tmp])
ddb154b3 3439 fi
3440 ]
1d7b9b20 3441)
3442AC_ARG_ENABLE(pututxline,
bfd550a2 3443 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
ddb154b3 3444 [
3445 if test "x$enableval" = "xno" ; then
3466e002 3446 AC_DEFINE(DISABLE_PUTUTXLINE, 1,
3447 [Define if you don't want to use pututxline()
3448 etc. to write [uw]tmpx])
ddb154b3 3449 fi
3450 ]
1d7b9b20 3451)
3452AC_ARG_WITH(lastlog,
bfd550a2 3453 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
8c89dd2b 3454 [
82f4e93d 3455 if test "x$withval" = "xno" ; then
8c89dd2b 3456 AC_DEFINE(DISABLE_LASTLOG)
6cf0200f 3457 elif test -n "$withval" && test "x${withval}" != "xyes"; then
8c89dd2b 3458 conf_lastlog_location=$withval
3459 fi
3460 ]
3461)
1d7b9b20 3462
3463dnl lastlog, [uw]tmpx? detection
3464dnl NOTE: set the paths in the platform section to avoid the
3465dnl need for command-line parameters
3466dnl lastlog and [uw]tmp are subject to a file search if all else fails
3467
3468dnl lastlog detection
3469dnl NOTE: the code itself will detect if lastlog is a directory
3470AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
3471AC_TRY_COMPILE([
3472#include <sys/types.h>
3473#include <utmp.h>
3474#ifdef HAVE_LASTLOG_H
3475# include <lastlog.h>
3476#endif
d7c0f3d5 3477#ifdef HAVE_PATHS_H
1d7b9b20 3478# include <paths.h>
41cb4569 3479#endif
3480#ifdef HAVE_LOGIN_H
3481# include <login.h>
1d7b9b20 3482#endif
3483 ],
3484 [ char *lastlog = LASTLOG_FILE; ],
3485 [ AC_MSG_RESULT(yes) ],
d7c0f3d5 3486 [
3487 AC_MSG_RESULT(no)
3488 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
3489 AC_TRY_COMPILE([
3490#include <sys/types.h>
3491#include <utmp.h>
3492#ifdef HAVE_LASTLOG_H
3493# include <lastlog.h>
3494#endif
3495#ifdef HAVE_PATHS_H
3496# include <paths.h>
3497#endif
3498 ],
3499 [ char *lastlog = _PATH_LASTLOG; ],
3500 [ AC_MSG_RESULT(yes) ],
3501 [
f282b668 3502 AC_MSG_RESULT(no)
d7c0f3d5 3503 system_lastlog_path=no
3504 ])
3505 ]
1d7b9b20 3506)
d7c0f3d5 3507
1d7b9b20 3508if test -z "$conf_lastlog_location"; then
3509 if test x"$system_lastlog_path" = x"no" ; then
3510 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
e5fe9a1f 3511 if (test -d "$f" || test -f "$f") ; then
1d7b9b20 3512 conf_lastlog_location=$f
3513 fi
3514 done
3515 if test -z "$conf_lastlog_location"; then
f8119cef 3516 AC_MSG_WARN([** Cannot find lastlog **])
3517 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1d7b9b20 3518 fi
3519 fi
3520fi
3521
3522if test -n "$conf_lastlog_location"; then
3466e002 3523 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location",
3524 [Define if you want to specify the path to your lastlog file])
82f4e93d 3525fi
1d7b9b20 3526
3527dnl utmp detection
3528AC_MSG_CHECKING([if your system defines UTMP_FILE])
3529AC_TRY_COMPILE([
3530#include <sys/types.h>
3531#include <utmp.h>
d7c0f3d5 3532#ifdef HAVE_PATHS_H
1d7b9b20 3533# include <paths.h>
3534#endif
3535 ],
3536 [ char *utmp = UTMP_FILE; ],
3537 [ AC_MSG_RESULT(yes) ],
3538 [ AC_MSG_RESULT(no)
3539 system_utmp_path=no ]
3540)
3541if test -z "$conf_utmp_location"; then
3542 if test x"$system_utmp_path" = x"no" ; then
3543 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
3544 if test -f $f ; then
3545 conf_utmp_location=$f
3546 fi
3547 done
3548 if test -z "$conf_utmp_location"; then
3549 AC_DEFINE(DISABLE_UTMP)
3550 fi
3551 fi
3552fi
3553if test -n "$conf_utmp_location"; then
3466e002 3554 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location",
3555 [Define if you want to specify the path to your utmp file])
82f4e93d 3556fi
1d7b9b20 3557
3558dnl wtmp detection
3559AC_MSG_CHECKING([if your system defines WTMP_FILE])
3560AC_TRY_COMPILE([
3561#include <sys/types.h>
3562#include <utmp.h>
d7c0f3d5 3563#ifdef HAVE_PATHS_H
1d7b9b20 3564# include <paths.h>
3565#endif
3566 ],
3567 [ char *wtmp = WTMP_FILE; ],
3568 [ AC_MSG_RESULT(yes) ],
3569 [ AC_MSG_RESULT(no)
3570 system_wtmp_path=no ]
3571)
3572if test -z "$conf_wtmp_location"; then
3573 if test x"$system_wtmp_path" = x"no" ; then
3574 for f in /usr/adm/wtmp /var/log/wtmp; do
3575 if test -f $f ; then
3576 conf_wtmp_location=$f
3577 fi
3578 done
3579 if test -z "$conf_wtmp_location"; then
3580 AC_DEFINE(DISABLE_WTMP)
3581 fi
3582 fi
3583fi
3584if test -n "$conf_wtmp_location"; then
3466e002 3585 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location",
3586 [Define if you want to specify the path to your wtmp file])
82f4e93d 3587fi
1d7b9b20 3588
3589
3590dnl utmpx detection - I don't know any system so perverse as to require
3591dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
3592dnl there, though.
3593AC_MSG_CHECKING([if your system defines UTMPX_FILE])
3594AC_TRY_COMPILE([
3595#include <sys/types.h>
3596#include <utmp.h>
3597#ifdef HAVE_UTMPX_H
3598#include <utmpx.h>
3599#endif
d7c0f3d5 3600#ifdef HAVE_PATHS_H
1d7b9b20 3601# include <paths.h>
3602#endif
3603 ],
3604 [ char *utmpx = UTMPX_FILE; ],
3605 [ AC_MSG_RESULT(yes) ],
3606 [ AC_MSG_RESULT(no)
3607 system_utmpx_path=no ]
3608)
3609if test -z "$conf_utmpx_location"; then
3610 if test x"$system_utmpx_path" = x"no" ; then
3611 AC_DEFINE(DISABLE_UTMPX)
3612 fi
3613else
3466e002 3614 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location",
3615 [Define if you want to specify the path to your utmpx file])
82f4e93d 3616fi
1d7b9b20 3617
3618dnl wtmpx detection
3619AC_MSG_CHECKING([if your system defines WTMPX_FILE])
3620AC_TRY_COMPILE([
3621#include <sys/types.h>
3622#include <utmp.h>
3623#ifdef HAVE_UTMPX_H
3624#include <utmpx.h>
3625#endif
d7c0f3d5 3626#ifdef HAVE_PATHS_H
1d7b9b20 3627# include <paths.h>
3628#endif
3629 ],
3630 [ char *wtmpx = WTMPX_FILE; ],
3631 [ AC_MSG_RESULT(yes) ],
3632 [ AC_MSG_RESULT(no)
3633 system_wtmpx_path=no ]
3634)
3635if test -z "$conf_wtmpx_location"; then
3636 if test x"$system_wtmpx_path" = x"no" ; then
3637 AC_DEFINE(DISABLE_WTMPX)
3638 fi
3639else
3466e002 3640 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location",
3641 [Define if you want to specify the path to your wtmpx file])
82f4e93d 3642fi
1d7b9b20 3643
b7a87eea 3644
bd499f9e 3645if test ! -z "$blibpath" ; then
68ece370 3646 LDFLAGS="$LDFLAGS $blibflags$blibpath"
3647 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
bd499f9e 3648fi
3649
ddceb1c8 3650dnl remove pam and dl because they are in $LIBPAM
3651if test "$PAM_MSG" = yes ; then
98f2d9d5 3652 LIBS=`echo $LIBS | sed 's/-lpam //'`
3653fi
3654if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3655 LIBS=`echo $LIBS | sed 's/-ldl //'`
ddceb1c8 3656fi
3657
ed89c848 3658dnl Adding -Werror to CFLAGS early prevents configure tests from running.
3659dnl Add now.
3660CFLAGS="$CFLAGS $werror_flags"
3661
3c62e7eb 3662AC_EXEEXT
d7cfdd7c 3663AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3664 scard/Makefile ssh_prng_cmds survey.sh])
98a7c37b 3665AC_OUTPUT
d3083fbd 3666
cbd7492e 3667# Print summary of options
3668
cbd7492e 3669# Someone please show me a better way :)
3670A=`eval echo ${prefix}` ; A=`eval echo ${A}`
3671B=`eval echo ${bindir}` ; B=`eval echo ${B}`
3672C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
3673D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
f5665f6f 3674E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
e0c4d3ac 3675F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
cbd7492e 3676G=`eval echo ${piddir}` ; G=`eval echo ${G}`
ecac8ee5 3677H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
3678I=`eval echo ${user_path}` ; I=`eval echo ${I}`
3679J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
cbd7492e 3680
3681echo ""
26de7942 3682echo "OpenSSH has been configured with the following options:"
ecac8ee5 3683echo " User binaries: $B"
3684echo " System binaries: $C"
3685echo " Configuration files: $D"
3686echo " Askpass program: $E"
3687echo " Manual pages: $F"
3688echo " PID file: $G"
3689echo " Privilege separation chroot path: $H"
95b99395 3690if test "x$external_path_file" = "x/etc/login.conf" ; then
3691echo " At runtime, sshd will use the path defined in $external_path_file"
3692echo " Make sure the path to scp is present, otherwise scp will not work"
8d184c09 3693else
ecac8ee5 3694echo " sshd default user PATH: $I"
89bbd457 3695 if test ! -z "$external_path_file"; then
95b99395 3696echo " (If PATH is set in $external_path_file it will be used instead. If"
3697echo " used, ensure the path to scp is present, otherwise scp will not work.)"
3698 fi
8d184c09 3699fi
06617857 3700if test ! -z "$superuser_path" ; then
ecac8ee5 3701echo " sshd superuser user PATH: $J"
3702fi
3703echo " Manpage format: $MANTYPE"
3e05e934 3704echo " PAM support: $PAM_MSG"
ecac8ee5 3705echo " KerberosV support: $KRB5_MSG"
3706echo " Smartcard support: $SCARD_MSG"
ecac8ee5 3707echo " S/KEY support: $SKEY_MSG"
3708echo " TCP Wrappers support: $TCPW_MSG"
3709echo " MD5 password support: $MD5_MSG"
59031773 3710echo " libedit support: $LIBEDIT_MSG"
3deb1408 3711echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
ecac8ee5 3712echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
3713echo " BSD Auth support: $BSD_AUTH_MSG"
3714echo " Random number source: $RAND_MSG"
f1b0ecc3 3715if test ! -z "$USE_RAND_HELPER" ; then
ecac8ee5 3716echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
af774732 3717fi
3718
cbd7492e 3719echo ""
3720
0c2fb82f 3721echo " Host: ${host}"
3722echo " Compiler: ${CC}"
3723echo " Compiler flags: ${CFLAGS}"
3724echo "Preprocessor flags: ${CPPFLAGS}"
3725echo " Linker flags: ${LDFLAGS}"
ddceb1c8 3726echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
cbd7492e 3727
3728echo ""
3729
9cefe228 3730if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
b3146b5f 3731 echo "SVR4 style packages are supported with \"make package\""
3732 echo ""
9cefe228 3733fi
3734
adeebd37 3735if test "x$PAM_MSG" = "xyes" ; then
f1b0ecc3 3736 echo "PAM is enabled. You may need to install a PAM control file "
3737 echo "for sshd, otherwise password authentication may fail. "
aff51935 3738 echo "Example PAM control files can be found in the contrib/ "
f1b0ecc3 3739 echo "subdirectory"
adeebd37 3740 echo ""
3741fi
3742
f1b0ecc3 3743if test ! -z "$RAND_HELPER_CMDHASH" ; then
3744 echo "WARNING: you are using the builtin random number collection "
3745 echo "service. Please read WARNING.RNG and request that your OS "
3746 echo "vendor includes kernel-based random number collection in "
3747 echo "future versions of your OS."
2c523de9 3748 echo ""
3749fi
af774732 3750
2f6f9cff 3751if test ! -z "$NO_PEERCHECK" ; then
3752 echo "WARNING: the operating system that you are using does not "
3753 echo "appear to support either the getpeereid() API nor the "
3754 echo "SO_PEERCRED getsockopt() option. These facilities are used to "
3755 echo "enforce security checks to prevent unauthorised connections to "
3756 echo "ssh-agent. Their absence increases the risk that a malicious "
3757 echo "user can connect to your agent. "
3758 echo ""
3759fi
3760
7b578f7d 3761if test "$AUDIT_MODULE" = "bsm" ; then
3762 echo "WARNING: BSM audit support is currently considered EXPERIMENTAL."
3763 echo "See the Solaris section in README.platform for details."
3764fi
This page took 1.029811 seconds and 5 git commands to generate.