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