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