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