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