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