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