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