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