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