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