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