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