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