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