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