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