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