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