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