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