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