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