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