1 K5_AC_INIT([aclocal.m4])
4 KRB5_VERSION=K5_VERSION
10 AC_CACHE_CHECK(if va_copy is available, krb5_cv_va_copy,
11 [AC_LINK_IFELSE([AC_LANG_SOURCE([
23 }])], krb5_cv_va_copy=yes, krb5_cv_va_copy=no)])
24 if test "$krb5_cv_va_copy" = yes; then
25 AC_DEFINE(HAS_VA_COPY,1,[Define if va_copy macro or function is available.])
28 # Note that this isn't checking if the copied value *works*, just
29 # whether the C language constraints permit the copying. If
30 # va_list is defined as an array type, it can't be assigned.
31 AC_CACHE_CHECK(if va_list objects can be copied by assignment,
32 krb5_cv_va_simple_copy,
34 AC_LANG_SOURCE([#include <stdarg.h>
38 }])], krb5_cv_va_simple_copy=yes, krb5_cv_va_simple_copy=no)])
39 if test "$krb5_cv_va_simple_copy" = yes; then
40 AC_DEFINE(CAN_COPY_VA_LIST,1,[Define if va_list objects can be simply copied by assignment.])
43 # The following lines are so that configure --help gives some global
44 # configuration options.
48 AC_ARG_ENABLE([athena],
49 [ --enable-athena build with MIT Project Athena configuration],,)
51 # Begin autoconf tests for the Makefiles generated out of the top-level
64 AC_CHECK_LIB(util,main,[AC_DEFINE(HAVE_LIBUTIL,1,[Define if the util library is available])
69 AC_CHECK_HEADER(libintl.h, [
70 AC_SEARCH_LIBS(dgettext, intl, [
71 AC_DEFINE(ENABLE_NLS, 1,
72 [Define if translation functions should be used.])])])
74 AC_CHECK_PROG(MSGFMT,msgfmt,msgfmt)
76 if test x"$MSGFMT" != x; then
82 AC_CHECK_HEADERS(syslog.h sys/sockio.h ifaddrs.h unistd.h fnmatch.h)
83 AC_CHECK_FUNCS(openlog syslog closelog strftime vsprintf vasprintf vsnprintf)
84 AC_CHECK_FUNCS(strlcpy fnmatch)
87 AC_CHECK_FUNC(strlcpy,
90 [STRLCPY_ST_OBJ=strlcpy.o
91 STRLCPY_OBJ='$(OUTPRE)strlcpy.$(OBJEXT)'
92 EXTRA_SUPPORT_SYMS="$EXTRA_SUPPORT_SYMS krb5int_strlcpy krb5int_strlcat"])
94 AC_SUBST(STRLCPY_ST_OBJ)
96 AC_CHECK_FUNC(fnmatch,
99 [FNMATCH_ST_OBJ=fnmatch.o
100 FNMATCH_OBJ='$(OUTPRE)fnmatch.$(OBJEXT)'
101 EXTRA_SUPPORT_SYMS="$EXTRA_SUPPORT_SYMS k5_fnmatch"])
102 AC_SUBST(FNMATCH_OBJ)
103 AC_SUBST(FNMATCH_ST_OBJ)
105 AC_CHECK_FUNC(vasprintf,
108 [PRINTF_ST_OBJ=printf.o
109 PRINTF_OBJ='$(OUTPRE)printf.$(OBJEXT)'
110 EXTRA_SUPPORT_SYMS="$EXTRA_SUPPORT_SYMS krb5int_asprintf krb5int_vasprintf"])
112 AC_SUBST(PRINTF_ST_OBJ)
113 KRB5_NEED_PROTO([#include <stdarg.h>
116 KRB5_NEED_PROTO([#include <string.h>
120 /* Solaris 8 declares swab in stdlib.h. */
123 KRB5_NEED_PROTO([#include <ctype.h>],isblank,1)
130 # --with-vague-errors disables useful error messages.
132 AC_ARG_WITH([vague-errors],
133 AC_HELP_STRING([--with-vague-errors],[Do not @<:@do@:>@ send helpful errors to client]), , withval=no)
134 if test "$withval" = yes; then
135 AC_MSG_RESULT(Supplying vague error messages to KDC clients)
136 AC_DEFINE(KRBCONF_VAGUE_ERRORS,1,[Define if the KDC should return only vague error codes to clients])
141 CRYPTO_IMPL="builtin"
142 AC_ARG_WITH([crypto-impl],
143 AC_HELP_STRING([--with-crypto-impl=IMPL], [use specified crypto implementation @<:@builtin@:>@]),
144 [CRYPTO_IMPL=$withval
145 AC_MSG_RESULT("k5crypto will use \'$withval\'")
151 AC_CHECK_LIB(crypto, PKCS7_get_signer_info)
154 if test "${CRYPTO_IMPL_CFLAGS+set}" != set; then
155 CRYPTO_IMPL_CFLAGS=`pkg-config --cflags nss`
157 if test "${CRYPTO_IMPL_LIBS+set}" != set; then
158 CRYPTO_IMPL_LIBS="-lnss3 $(pkg-config --libs nss-util)"
160 AC_DEFINE(CRYPTO_IMPL_NSS,1,[Define if crypto implementation is NSS])
162 CFLAGS="$CFLAGS $CRYPTO_IMPL_CFLAGS"
163 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
165 #if NSS_VMAJOR < 3 || (NSS_VMAJOR == 3 && NSS_VMINOR < 13)
168 ])], [], [AC_MSG_ERROR([NSS version 3.13 or later required.])])
172 AC_MSG_ERROR([Unknown crypto implementation $withval])
175 AC_CONFIG_COMMANDS(CRYPTO_IMPL, , CRYPTO_IMPL=$CRYPTO_IMPL)
176 AC_SUBST(CRYPTO_IMPL)
177 AC_SUBST(CRYPTO_IMPL_CFLAGS)
178 AC_SUBST(CRYPTO_IMPL_LIBS)
180 if test "$CRYPTO_IMPL" = nss; then
183 AC_ARG_WITH([prng-alg],
184 AC_HELP_STRING([--with-prng-alg=ALG], [use specified PRNG algorithm. Ignored for nss. @<:@fortuna@:>@]),
186 AC_MSG_RESULT("k5crypto will use \'$withval\'")
189 AC_CONFIG_COMMANDS(PRNG_ALG, , PRNG_ALG=$PRNG_ALG)
191 if test "$PRNG_ALG" = fortuna; then
192 AC_DEFINE(FORTUNA,1,[Define if Fortuna PRNG is selected])
195 # WITH_PKINIT_CRYPTO_IMPL
197 PKINIT_CRYPTO_IMPL="$CRYPTO_IMPL"
198 AC_ARG_WITH([pkinit-crypto-impl],
199 AC_HELP_STRING([--with-pkinit-crypto-impl=IMPL], [use specified pkinit crypto implementation @<:@openssl@:>@]),
200 [PKINIT_CRYPTO_IMPL=$withval
201 AC_MSG_RESULT("pkinit will use \'$withval\'")
202 ], withval=$PKINIT_CRYPTO_IMPL)
205 AC_CHECK_LIB(crypto, PKCS7_get_signer_info, PKINIT_CRYPTO_IMPL_LIBS=-lcrypto)
206 PKINIT_CRYPTO_IMPL=openssl
209 if test "${PKINIT_CRYPTO_IMPL_CFLAGS+set}" != set; then
210 PKINIT_CRYPTO_IMPL_CFLAGS=`pkg-config --cflags nss`
212 if test "${PKINIT_CRYPTO_IMPL_LIBS+set}" != set; then
213 PKINIT_CRYPTO_IMPL_LIBS=`pkg-config --libs nss`
215 AC_DEFINE(PKINIT_CRYPTO_IMPL_NSS,1,[Define if pkinit crypto implementation is NSS])
217 CFLAGS="$CFLAGS $PKINIT_CRYPTO_IMPL_CFLAGS"
218 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
220 #if NSS_VMAJOR < 3 || (NSS_VMAJOR == 3 && NSS_VMINOR < 12)
222 #elif NSS_VMAJOR == 3 && NSS_VMINOR == 12 && NSS_VPATCH < 11
225 ])], [], [AC_MSG_ERROR([NSS version 3.12.11 or later required.])])
229 AC_MSG_ERROR([Unknown crypto implementation $withval])
232 AC_CONFIG_COMMANDS(PKINIT_CRYPTO_IMPL,,PKINIT_CRYPTO_IMPL=$PKINIT_CRYPTO_IMPL)
233 AC_SUBST(PKINIT_CRYPTO_IMPL)
234 AC_SUBST(PKINIT_CRYPTO_IMPL_CFLAGS)
235 AC_SUBST(PKINIT_CRYPTO_IMPL_LIBS)
237 # --with-kdc-kdb-update makes the KDC update the database with last request
238 # information and failure information.
240 AC_ARG_WITH([kdc-kdb-update],
241 AC_HELP_STRING([--with-kdc-kdb-update],[Update the database @<:@don't update@:>@]), , withval=no)
242 if test "$withval" = yes; then
243 AC_MSG_RESULT(Updating KDC database with each request)
244 AC_DEFINE(KRBCONF_KDC_MODIFIES_KDB,1,[Define if KDC should update database with each request])
247 AC_ARG_ENABLE([kdc-lookaside-cache],
248 AC_HELP_STRING([--disable-kdc-lookaside-cache],
249 [Disable the cache which detects client retransmits]), ,
251 if test "$enableval" = no ; then
252 AC_DEFINE(NOCACHE,1,[Define if the KDC should use no lookaside cache])
258 # from old include/configure.in
259 AH_TEMPLATE([HAVE_STRUCT_SOCKADDR_STORAGE],
260 [Define if "struct sockaddr_storage" is available.])
262 AC_CONFIG_HEADERS(include/autoconf.h, [echo timestamp > include/autoconf.stamp])
266 AC_CHECK_FUNCS(strdup setvbuf seteuid setresuid setreuid setegid setresgid setregid setsid flock fchmod chmod strftime strptime geteuid setenv unsetenv getenv gmtime_r localtime_r bswap16 bswap64 mkstemp getusershell access getcwd srand48 srand srandom stat strchr strerror strerror_r timegm isblank)
268 AC_CHECK_FUNC(mkstemp,
271 [MKSTEMP_ST_OBJ='mkstemp.o'
272 MKSTEMP_OBJ='$(OUTPRE)mkstemp.$(OBJEXT)'
273 EXTRA_SUPPORT_SYMS="$EXTRA_SUPPORT_SYMS krb5int_mkstemp"])
274 AC_SUBST(MKSTEMP_OBJ)
275 AC_SUBST(MKSTEMP_ST_OBJ)
277 AC_CHECK_FUNC(gettimeofday,
278 [GETTIMEOFDAY_ST_OBJ=
280 AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Have the gettimeofday function])
282 [GETTIMEOFDAY_ST_OBJ='gettimeofday.o'
283 GETTIMEOFDAY_OBJ='$(OUTPRE)gettimeofday.$(OBJEXT)'
284 EXTRA_SUPPORT_SYMS="$EXTRA_SUPPORT_SYMS krb5int_gettimeofday"])
285 AC_SUBST(GETTIMEOFDAY_OBJ)
286 AC_SUBST(GETTIMEOFDAY_ST_OBJ)
287 AC_SUBST(EXTRA_SUPPORT_SYMS)
290 AC_CHECK_HEADERS(unistd.h paths.h regex.h regexpr.h fcntl.h memory.h ifaddrs.h sys/filio.h byteswap.h machine/endian.h machine/byte_order.h sys/bswap.h endian.h pwd.h arpa/inet.h alloca.h dlfcn.h limits.h)
291 AC_CHECK_HEADER(regexp.h, [], [],
292 [#define INIT char *sp = instring;
293 #define GETC() (*sp++)
294 #define PEEKC() (*sp)
295 #define UNGETC(c) (--sp)
296 #define RETURN(c) return(c)
299 AC_CHECK_MEMBERS([struct sockaddr_in.sin_len, struct sockaddr.sa_len], , ,
300 [#include <sys/types.h>
301 #include <netinet/in.h>])
302 AC_CHECK_MEMBERS([struct stat.st_mtimensec,struct stat.st_mtimespec.tv_nsec,struct stat.st_mtim.tv_nsec],,,[#include <sys/types.h>
303 #include <sys/stat.h>])
307 # Fancy caching of perror result...
308 AC_MSG_CHECKING(for perror declaration)
309 AC_CACHE_VAL(krb5_cv_decl_perror,
310 [AC_EGREP_HEADER(perror, errno.h,
311 krb5_cv_decl_perror=yes, krb5_cv_decl_perror=no)])
312 AC_MSG_RESULT($krb5_cv_decl_perror)
313 if test $krb5_cv_decl_perror = yes; then
314 AC_DEFINE(HDR_HAS_PERROR,1,[Define if errno.h declares perror])
317 KRB5_NEED_PROTO([#include <time.h>],strptime)
323 # *rpcent return types needed for lib/rpc
325 AC_MSG_CHECKING([return type of setrpcent])
326 AC_CACHE_VAL(k5_cv_type_setrpcent,
327 [AC_TRY_COMPILE([#include <netdb.h>
331 extern void setrpcent();],
332 [int i;], k5_cv_type_setrpcent=void, k5_cv_type_setrpcent=int)])
333 AC_MSG_RESULT($k5_cv_type_setrpcent)
334 AC_DEFINE_UNQUOTED(SETRPCENT_TYPE, $k5_cv_type_setrpcent, [Define as return type of setrpcent])
336 AC_MSG_CHECKING([return type of endrpcent])
337 AC_CACHE_VAL(k5_cv_type_endrpcent,
338 [AC_TRY_COMPILE([#include <netdb.h>
342 extern void endrpcent();],
343 [int i;], k5_cv_type_endrpcent=void, k5_cv_type_endrpcent=int)])
344 AC_MSG_RESULT($k5_cv_type_endrpcent)
345 AC_DEFINE_UNQUOTED(ENDRPCENT_TYPE, $k5_cv_type_endrpcent, [Define as return type of endrpcent])
348 # bswap_16 is a macro in byteswap.h under GNU libc
349 AC_MSG_CHECKING(for bswap_16)
350 AC_CACHE_VAL(krb5_cv_bswap_16,[
351 AC_TRY_LINK([#if HAVE_BYTESWAP_H
352 #include <byteswap.h>
353 #endif],[bswap_16(37);],krb5_cv_bswap_16=yes,krb5_cv_bswap_16=no)])
354 AC_MSG_RESULT($krb5_cv_bswap_16)
355 if test "$krb5_cv_bswap_16" = yes; then
356 AC_DEFINE(HAVE_BSWAP_16,1,[Define to 1 if bswap_16 is available via byteswap.h])
358 AC_MSG_CHECKING(for bswap_64)
359 AC_CACHE_VAL(krb5_cv_bswap_64,[
360 AC_TRY_LINK([#if HAVE_BYTESWAP_H
361 #include <byteswap.h>
362 #endif],[bswap_64(37);],krb5_cv_bswap_64=yes,krb5_cv_bswap_64=no)])
363 AC_MSG_RESULT($krb5_cv_bswap_64)
364 if test "$krb5_cv_bswap_64" = yes; then
365 AC_DEFINE(HAVE_BSWAP_64,1,[Define to 1 if bswap_64 is available via byteswap.h])
368 # Needed for ksu and some appl stuff.
370 case $krb5_cv_host in
372 AC_CHECK_LIB(security,setluid,
373 AC_DEFINE(HAVE_SETLUID,1,[Define if setluid provided in OSF/1 security library])
374 KSU_LIBS="-lsecurity"
380 if test $ac_cv_func_setenv = no || test $ac_cv_func_unsetenv = no \
381 || test $ac_cv_func_getenv = no; then
388 # Check what the return types for gethostbyname_r and getservbyname_r are.
390 AC_CHECK_FUNC(gethostbyname_r,[
391 ac_cv_func_gethostbyname_r=yes
392 if test "$ac_cv_func_gethostbyname_r" = yes; then
393 AC_MSG_CHECKING([if gethostbyname_r returns an int])
394 AC_CACHE_VAL(krb5_cv_gethostbyname_r_returns_int,
395 [AC_TRY_COMPILE([#include <netdb.h>
396 extern int gethostbyname_r ();], [1;],
397 krb5_cv_gethostbyname_r_returns_int=yes,
398 krb5_cv_gethostbyname_r_returns_int=no)])
399 AC_MSG_RESULT($krb5_cv_gethostbyname_r_returns_int)
401 AC_MSG_CHECKING([if gethostbyname_r returns a pointer])
402 AC_CACHE_VAL(krb5_cv_gethostbyname_r_returns_ptr,
403 [AC_TRY_COMPILE([#include <netdb.h>
404 extern struct hostent *gethostbyname_r ();], [1;],
405 krb5_cv_gethostbyname_r_returns_ptr=yes,
406 krb5_cv_gethostbyname_r_returns_ptr=no)])
407 AC_MSG_RESULT($krb5_cv_gethostbyname_r_returns_ptr)
409 if test "$krb5_cv_gethostbyname_r_returns_int" = "$krb5_cv_gethostbyname_r_returns_ptr"; then
410 AC_MSG_WARN(cannot determine return type of gethostbyname_r -- disabling)
411 ac_cv_func_gethostbyname_r=no
413 if test "$krb5_cv_gethostbyname_r_returns_int" = yes; then
414 AC_DEFINE(GETHOSTBYNAME_R_RETURNS_INT, 1, [Define if gethostbyname_r returns int rather than struct hostent * ])
417 if test "$ac_cv_func_gethostbyname_r" = yes; then
418 AC_DEFINE(HAVE_GETHOSTBYNAME_R, 1, [Define if gethostbyname_r exists and its return type is known])
419 AC_CHECK_FUNC(gethostbyaddr_r)
424 AC_CHECK_FUNC(getpwnam_r,ac_cv_func_getpwnam_r=yes,ac_cv_func_getpwnam_r=no)
425 AC_CHECK_FUNC(getpwuid_r,ac_cv_func_getpwuid_r=yes,ac_cv_func_getpwuid_r=no)
426 if test "$ac_cv_func_getpwnam_r" = yes; then
427 AC_MSG_CHECKING([return type of getpwnam_r])
428 AC_CACHE_VAL(krb5_cv_getpwnam_r_return_type,
429 [AC_TRY_COMPILE([#include <pwd.h>
430 extern int getpwnam_r();], [1;],
431 getpwnam_r_returns_int=yes,getpwnam_r_returns_int=no)
432 AC_TRY_COMPILE([#include <pwd.h>
433 extern struct passwd *getpwnam_r();], [1;],
434 getpwnam_r_returns_ptr=yes,getpwnam_r_returns_ptr=no)
435 case "$getpwnam_r_returns_int/$getpwnam_r_returns_ptr" in
436 yes/no) krb5_cv_getpwnam_r_return_type=int ;;
437 no/yes) krb5_cv_getpwnam_r_return_type=ptr ;;
438 *) krb5_cv_getpwnam_r_return_type=unknown ;;
440 AC_MSG_RESULT($krb5_cv_getpwnam_r_return_type)
441 if test $krb5_cv_getpwnam_r_return_type = int; then
442 AC_DEFINE(GETPWNAM_R_RETURNS_INT, 1, [Define if getpwnam_r returns an int])
443 elif test $krb5_cv_getpwnam_r_return_type = unknown; then
444 AC_MSG_WARN([Cannot determine getpwnam_r return type, disabling getpwnam_r])
445 ac_cv_func_getpwnam_r=no
448 if test "$ac_cv_func_getpwnam_r" = yes; then
449 AC_MSG_CHECKING([number of arguments to getpwnam_r])
450 AC_CACHE_VAL(krb5_cv_getpwnam_r_args,
451 [AC_TRY_COMPILE([#include <pwd.h>
452 struct passwd pwx; char buf[1024];],
453 [getpwnam_r("", &pwx, buf, sizeof(buf));], args4=yes, args4=no)
454 AC_TRY_COMPILE([#include <pwd.h>
455 struct passwd pwx, *p; char buf[1024];],
456 [getpwnam_r("", &pwx, buf, sizeof(buf), &p);], args5=yes, args5=no)
457 case $args4/$args5 in
458 yes/no) krb5_cv_getpwnam_r_args=4 ;;
459 no/yes) krb5_cv_getpwnam_r_args=5 ;;
460 *) krb5_cv_getpwnam_r_args=unknown ;;
462 AC_MSG_RESULT($krb5_cv_getpwnam_r_args)
463 if test "$krb5_cv_getpwnam_r_args" = unknown; then
464 AC_MSG_WARN([Cannot determine number of arguments to getpwnam_r, disabling its use.])
465 ac_cv_func_getpwnam_r=no
467 AC_DEFINE(HAVE_GETPWNAM_R,1,[Define if getpwnam_r is available and useful.])
468 if test "$krb5_cv_getpwnam_r_args" = 4; then
469 AC_DEFINE(GETPWNAM_R_4_ARGS,1,[Define if getpwnam_r exists but takes only 4 arguments (e.g., POSIX draft 6 implementations like some Solaris releases).])
474 if test "$ac_cv_func_getpwnam_r" = no && test "$ac_cv_func_getpwuid_r" = yes; then
475 # Actually, we could do this check, and the corresponding checks
476 # for return type and number of arguments, but I doubt we'll run
477 # into a system where we'd get to use getpwuid_r but not getpwnam_r.
478 AC_MSG_NOTICE([getpwnam_r not useful, so disabling getpwuid_r too])
479 ac_cv_func_getpwuid_r=no
481 if test "$ac_cv_func_getpwuid_r" = yes; then
482 AC_DEFINE(HAVE_GETPWUID_R,1,[Define if getpwuid_r is available and useful.])
483 # Hack: Assume getpwuid_r is the shorter form if getpwnam_r is.
484 if test "$krb5_cv_getpwnam_r_args" = 4; then
485 AC_DEFINE(GETPWUID_R_4_ARGS,1,[Define if getpwuid_r exists but takes only 4 arguments (e.g., POSIX draft 6 implementations like some Solaris releases).])
489 if test "$ac_cv_func_gmtime_r" = yes; then
490 AC_MSG_CHECKING([whether gmtime_r returns int])
491 AC_CACHE_VAL(krb5_cv_gmtime_r_returns_int,
492 [AC_TRY_COMPILE([#include <time.h>
493 extern int gmtime_r ();], [1;], return_int=yes, return_int=no)
494 AC_TRY_COMPILE([#include <time.h>
495 extern struct tm *gmtime_r ();], [1;], return_ptr=yes, return_ptr=no)
496 case $return_int/$return_ptr in
497 yes/no) krb5_cv_gmtime_r_returns_int=yes ;;
498 no/yes) krb5_cv_gmtime_r_returns_int=no ;;
499 *) # Can't figure it out, punt the function.
500 ac_cv_func_gmtime_r=no ;;
502 if test "$ac_cv_func_gmtime_r" = no; then
503 AC_MSG_RESULT(unknown -- ignoring gmtime_r)
505 AC_MSG_RESULT($krb5_cv_gmtime_r_returns_int)
506 if test "$krb5_cv_gmtime_r_returns_int" = yes; then
507 AC_DEFINE(GMTIME_R_RETURNS_INT,1,[Define if gmtime_r returns int instead of struct tm pointer, as on old HP-UX systems.])
512 AC_CHECK_FUNC(getservbyname_r,[
513 ac_cv_func_getservbyname_r=yes
514 if test "$ac_cv_func_getservbyname_r" = yes; then
515 AC_MSG_CHECKING([if getservbyname_r returns an int])
516 AC_CACHE_VAL(krb5_cv_getservbyname_r_returns_int,
517 [AC_TRY_COMPILE([#include <netdb.h>
518 extern int getservbyname_r ();], [1;],
519 krb5_cv_getservbyname_r_returns_int=yes,
520 krb5_cv_getservbyname_r_returns_int=no)])
521 AC_MSG_RESULT($krb5_cv_getservbyname_r_returns_int)
523 AC_MSG_CHECKING([if getservbyname_r returns a pointer])
524 AC_CACHE_VAL(krb5_cv_getservbyname_r_returns_ptr,
525 [AC_TRY_COMPILE([#include <netdb.h>
526 extern struct servent *getservbyname_r ();], [1;],
527 krb5_cv_getservbyname_r_returns_ptr=yes,
528 krb5_cv_getservbyname_r_returns_ptr=no)])
529 AC_MSG_RESULT($krb5_cv_getservbyname_r_returns_ptr)
531 if test "$krb5_cv_getservbyname_r_returns_int" = "$krb5_cv_getservbyname_r_returns_ptr"; then
532 AC_MSG_WARN(cannot determine return type of getservbyname_r -- disabling)
533 ac_cv_func_getservbyname_r=no
535 if test "$krb5_cv_getservbyname_r_returns_int" = yes; then
536 AC_DEFINE(GETSERVBYNAME_R_RETURNS_INT, 1, [Define if getservbyname_r returns int rather than struct servent * ])
539 if test "$ac_cv_func_getservbyname_r" = yes; then
540 AC_DEFINE(HAVE_GETSERVBYNAME_R, 1, [Define if getservbyname_r exists and its return type is known])
541 AC_CHECK_FUNC(getservbyport_r)
549 AC_CHECK_HEADER(termios.h,
550 [AC_CHECK_FUNC([tcsetattr],
551 AC_DEFINE(POSIX_TERMIOS,1,[Define if termios.h exists and tcsetattr exists]))])
554 AC_CHECK_HEADERS(poll.h stdlib.h string.h stddef.h sys/types.h sys/file.h sys/param.h sys/stat.h sys/time.h netinet/in.h sys/uio.h sys/filio.h sys/select.h time.h paths.h errno.h)
556 # If compiling with IPv6 support, test if in6addr_any functions.
557 # Irix 6.5.16 defines it, but lacks support in the C library.
558 if test $krb5_cv_inet6 = yes || test "$krb5_cv_inet6_with_dinet6" = yes ; then
559 AC_CACHE_CHECK([for in6addr_any definition in library],
560 krb5_cv_var_in6addr_any,
562 #ifdef HAVE_SYS_TYPES_H
563 #include <sys/types.h>
565 #include <sys/socket.h>
566 #include <netinet/in.h>
569 struct sockaddr_in6 in;
570 in.sin6_addr = in6addr_any;
572 ],krb5_cv_var_in6addr_any=yes, krb5_cv_var_in6addr_any=no)])
573 if test $krb5_cv_var_in6addr_any = no; then
574 AC_DEFINE(NEED_INSIXADDR_ANY,1,[Define if in6addr_any is not defined in libc])
580 # check for ANSI stdio, esp "b" option to fopen(). This (unfortunately)
581 # requires a run check...
583 AC_MSG_CHECKING([for ANSI stdio])
584 AC_CACHE_VAL(krb5_cv_has_ansi_stdio,
590 if ((conftest = fopen("conftest.dat", "w")) == NULL) exit(1);
591 if (fclose(conftest)) exit(1);
592 if ((conftest = fopen("conftest.dat", "rb+")) == NULL) exit(1);
593 if (fputs("testing ANSI for stdio\n", conftest) == EOF) exit(1);
596 krb5_cv_has_ansi_stdio=yes, krb5_cv_has_ansi_stdio=no,
597 krb5_cv_has_ansi_stdio=yes)])# assume ANSI in cross environment
598 AC_MSG_RESULT($krb5_cv_has_ansi_stdio)
599 if test $krb5_cv_has_ansi_stdio = yes; then
600 AC_DEFINE(ANSI_STDIO,1,[Define if ANSI stdio is present (in particular "b" option to fopen)])
603 # then from osconf.h, we have
606 AC_CHECK_TYPE(time_t, long)
608 # Determine where to put the replay cache.
610 AC_MSG_CHECKING([for replay cache directory])
611 AC_CACHE_VAL(krb5_cv_sys_rcdir,
613 for t_dir in /var/tmp /usr/tmp /var/usr/tmp /tmp ; do
614 test -d $t_dir || continue
615 krb5_cv_sys_rcdir=$t_dir
618 AC_MSG_RESULT($krb5_cv_sys_rcdir)
619 KRB5_RCTMPDIR=$krb5_cv_sys_rcdir
620 AC_SUBST(KRB5_RCTMPDIR)
623 AC_MSG_CHECKING(for socklen_t)
624 AC_CACHE_VAL(krb5_cv_has_type_socklen_t,
626 [#include <sys/types.h>
627 #include <sys/socket.h>
628 ],[sizeof (socklen_t);],
629 krb5_cv_has_type_socklen_t=yes,krb5_cv_has_type_socklen_t=no)])
630 AC_MSG_RESULT($krb5_cv_has_type_socklen_t)
631 if test $krb5_cv_has_type_socklen_t = yes; then
632 AC_DEFINE(HAVE_SOCKLEN_T,1,[Define if there is a socklen_t type. If not, probably use size_t])
635 AC_MSG_CHECKING(for struct lifconf)
636 AC_CACHE_VAL(krb5_cv_has_struct_lifconf,
638 [#include <sys/socket.h>
640 ],[sizeof (struct lifconf);],
641 krb5_cv_has_struct_lifconf=yes,krb5_cv_has_struct_lifconf=no)])
642 AC_MSG_RESULT($krb5_cv_has_struct_lifconf)
643 if test $krb5_cv_has_struct_lifconf = yes; then
644 AC_DEFINE(HAVE_STRUCT_LIFCONF,1,[Define if there is a struct lifconf.])
646 # HP-UX 11 uses stuct if_laddrconf
647 AC_MSG_CHECKING(for struct if_laddrconf)
648 AC_CACHE_VAL(krb5_cv_has_struct_if_laddrconf,
650 [#include <sys/socket.h>
653 ],[sizeof (struct if_laddrconf);],
654 krb5_cv_has_struct_if_laddrconf=yes,krb5_cv_has_struct_if_laddrconf=no)])
655 AC_MSG_RESULT($krb5_cv_has_struct_if_laddrconf)
656 if test $krb5_cv_has_struct_if_laddrconf = yes; then
657 AC_DEFINE(HAVE_STRUCT_IF_LADDRCONF,1,[Define if there is a struct if_laddrconf.])
661 AC_MSG_CHECKING([for h_errno in netdb.h])
662 AC_CACHE_VAL(krb5_cv_header_netdb_h_h_errno,
664 [#include <netdb.h>],
665 [int x = h_errno;], krb5_cv_header_netdb_h_h_errno=yes,
666 krb5_cv_header_netdb_h_h_errno=no)])
667 AC_MSG_RESULT($krb5_cv_header_netdb_h_h_errno)
668 if test $krb5_cv_header_netdb_h_h_errno = yes; then
669 AC_DEFINE([HAVE_NETDB_H_H_ERRNO], 1,
670 [Define if netdb.h declares h_errno])
674 AC_ARG_ENABLE([athena],
675 [ --enable-athena build with MIT Project Athena configuration],
676 AC_DEFINE(KRB5_ATHENA_COMPAT,1,[Define if MIT Project Athena default configuration should be used]),)
681 #ifndef KRB5_AUTOCONF_H
682 #define KRB5_AUTOCONF_H
685 #if defined(__GNUC__) && !defined(inline)
686 /* Silence gcc pedantic warnings about ANSI C. */
687 # define inline __inline__
689 #endif /* KRB5_AUTOCONF_H */
692 # Not used yet, but let's find out what we've got on the platforms
693 # we're working with....
694 AC_CHECK_HEADERS(inttypes.h stdint.h)
695 AC_CHECK_TYPES([uint32_t, int32_t, uint64_t, int64_t, uint_least32_t, uintptr_t, uintmax_t, long long], , , [
698 #elif defined(HAVE_INTTYPES_H)
699 # include <inttypes.h>
702 AC_CHECK_TYPES([struct cmsghdr, struct in_pktinfo, struct in6_pktinfo, struct sockaddr_storage], , , [
703 #include <sys/types.h>
704 #include <sys/socket.h>
705 #include <netinet/in.h>
707 AC_CHECK_TYPES([struct rt_msghdr], , , [
708 #include <sys/socket.h>
710 #include <net/route.h>
713 # stuff for util/profile
715 # AC_KRB5_TCL already done
717 test "$TCL_LIBS" != "" && DO_TCL=ok
722 AC_CHECK_TYPES([ssize_t, u_char, u_int, u_long, u_int8_t, u_int16_t, u_int32_t, int8_t, int16_t, int32_t])
724 # Some libdb2 test programs want a shell that supports functions.
726 AC_PATH_PROG(SH,sh,false)
727 AC_PATH_PROG(SH5,sh5,false)
728 AC_PATH_PROG(BASH,bash,false)
729 for prog in $SH $SH5 $BASH; do
730 AC_MSG_CHECKING(if $prog supports functions)
731 if $prog -c 'foo() { true; }; foo' >/dev/null 2>&1; then
741 # Test for POSIX 2001 *printf support (X/Open System Interfaces extension
742 # to ANSI/ISO C 1999 specification). Specifically, positional
743 # specifications; not checking for other features like %zx at present.
744 AC_MSG_CHECKING(for POSIX printf positional specification support)
745 AC_CACHE_VAL(ac_cv_printf_positional,[
749 const char expected[] = "200 100";
752 sprintf(buf, "%2\$x %1\$d", 100, 512);
753 if (strcmp(expected, buf)) {
754 fprintf(stderr,"bad result: <%s> wanted: <%s>\n", buf, expected);
759 ac_cv_printf_positional=yes,
760 ac_cv_printf_positional=no,
761 AC_MSG_ERROR([Cannot test for printf positional argument support when cross compiling]))])
762 # Nothing for autoconf.h for now.
763 AC_MSG_RESULT($ac_cv_printf_positional)
766 # for t_locate_kdc test
768 AC_PATH_PROG(DIG, dig, false)
769 AC_PATH_PROG(NSLOOKUP, nslookup, false)
775 AC_ARG_ENABLE([athena],
776 [ --enable-athena build with MIT Project Athena configuration],
778 # The following are tests for the presence of programs required for
780 AC_CHECK_PROG(have_RUNTEST,runtest,runtest)
781 AC_CHECK_PROG(have_PERL,perl,perl)
782 if test "$have_PERL" = perl -a "$have_RUNTEST" = runtest -a "$TCL_LIBS" != ""; then
787 # The following are substituted into kadmin/testing/scripts/env-setup.sh
792 *) S_TOP=`pwd`/$srcdir ;;
795 AC_PATH_PROG(PERL_PATH,perl)
796 AC_PATH_PROG(EXPECT,expect)
797 # For kadmin/testing/util/Makefile.in
798 if test "$TCL_LIBS" != "" ; then
802 KRB5_AC_PRIOCNTL_HACK
803 K5_GEN_FILE(kadmin/testing/scripts/env-setup.sh:kadmin/testing/scripts/env-setup.shin)
805 AC_CHECK_PROG(RUNTEST,runtest,runtest)
806 AC_CHECK_PROG(PERL,perl,perl)
809 AC_CHECK_HEADER(stdint.h,[
810 include_stdint='awk '\''END{printf("%cinclude <stdint.h>\n", 35);}'\'' < /dev/null'],
811 include_stdint='echo "/* no stdint.h */"')
812 AC_SUBST(include_stdint)
813 AC_CHECK_HEADER(inttypes.h,[
814 include_inttypes='awk '\''END{printf("%cinclude <inttypes.h>\n", 35);}'\'' < /dev/null'],
815 include_inttypes='echo "/* no inttypes.h */"')
816 AC_SUBST(include_inttypes)
817 AC_CHECK_HEADER(xom.h,[
818 include_xom='awk '\''END{printf("%cinclude <xom.h>\n", 35);}'\'' < /dev/null'], [
819 include_xom='echo "/* no xom.h */"'])
820 AC_SUBST(include_xom)
824 ### Check where struct rpcent is declared.
826 # This is necessary to determine:
827 # 1. If /usr/include/netdb.h declares struct rpcent
828 # 2. If /usr/include/rpc/netdb.h declares struct rpcent
830 # We have our own rpc/netdb.h, and if /usr/include/netdb.h includes
831 # rpc/netdb.h, then nastiness could happen.
833 # Logic: If /usr/include/netdb.h declares struct rpcent, then check
834 # rpc/netdb.h. If /usr/include/rpc/netdb.h declares struct rpcent,
835 # then define STRUCT_RPCENT_IN_RPC_NETDB_H, otherwise do not. If
836 # neither netdb.h nor rpc/netdb.h declares struct rpcent, then define
837 # STRUCT_RPCENT_IN_RPC_NETDB_H anyway.
839 AC_MSG_CHECKING([where struct rpcent is declared])
840 AC_TRY_COMPILE([#include <netdb.h>],
842 char c = e.r_name[0];
843 int i = e.r_number;],
844 [AC_TRY_COMPILE([#include <rpc/netdb.h>],
846 char c = e.r_name[0];
847 int i = e.r_number;],
848 [AC_MSG_RESULT([rpc/netdb.h])
849 rpcent_define='#define STRUCT_RPCENT_IN_RPC_NETDB_H'],
850 [AC_MSG_RESULT([netdb.h])])],
851 [AC_MSG_RESULT([nowhere])
852 rpcent_define='#define STRUCT_RPCENT_IN_RPC_NETDB_H'])
853 AC_SUBST(rpcent_define)
855 AC_CHECK_HEADERS(sys/select.h sys/time.h unistd.h)
856 if test $ac_cv_header_sys_select_h = yes; then
857 GSSRPC__SYS_SELECT_H='#include <sys/select.h>'
859 GSSRPC__SYS_SELECT_H='/* #include <sys/select.h> */'
861 AC_SUBST(GSSRPC__SYS_SELECT_H)
862 if test $ac_cv_header_sys_time_h = yes; then
863 GSSRPC__SYS_TIME_H='#include <sys/time.h>'
865 GSSRPC__SYS_TIME_H='/* #include <sys/time.h> */'
867 AC_SUBST(GSSRPC__SYS_TIME_H)
868 if test $ac_cv_header_unistd_h = yes; then
869 GSSRPC__UNISTD_H='#include <unistd.h>'
871 GSSRPC__UNISTD_H='/* #include <unistd.h> */'
873 AC_SUBST(GSSRPC__UNISTD_H)
875 AC_CACHE_CHECK([for MAXHOSTNAMELEN in sys/param.h],
876 [krb5_cv_header_sys_param_h_maxhostnamelen],
877 [AC_TRY_COMPILE([#include <sys/param.h>],
878 [int i = MAXHOSTNAMELEN;],
879 [krb5_cv_header_sys_param_h_maxhostnamelen=yes],
880 [krb5_cv_header_sys_param_h_maxhostnamelen=no])])
881 AC_CACHE_CHECK([for MAXHOSTNAMELEN in netdb.h],
882 [krb5_cv_header_netdb_h_maxhostnamelen],
883 [AC_TRY_COMPILE([#include <netdb.h>],
884 [int i = MAXHOSTNAMELEN;],
885 [krb5_cv_header_netdb_h_maxhostnamelen=yes],
886 [krb5_cv_header_netdb_h_maxhostnamelen=no])])
888 GSSRPC__SYS_PARAM_H='/* #include <sys/param.h> */'
889 GSSRPC__NETDB_H='/* #include <netdb.h> */'
890 if test $krb5_cv_header_sys_param_h_maxhostnamelen = yes; then
891 GSSRPC__SYS_PARAM_H='#include <sys/param.h>'
893 if test $krb5_cv_header_netdb_h_maxhostnamelen = yes; then
894 GSSRPC__NETDB_H='#include <netdb.h>'
896 AC_MSG_WARN([can't find MAXHOSTNAMELEN definition; faking it])
899 AC_SUBST(GSSRPC__SYS_PARAM_H)
900 AC_SUBST(GSSRPC__NETDB_H)
902 AC_CACHE_CHECK([for uint32_t in sys/types.h],
903 [krb5_cv_header_sys_types_h_uint32_t],
904 [AC_TRY_COMPILE([#include <sys/types.h>],
906 [krb5_cv_header_sys_types_h_uint32_t=yes],
907 [krb5_cv_header_sys_types_h_uint32_t=no])])
908 AC_CACHE_CHECK([for uint32_t in stdint.h],
909 [krb5_cv_header_stdint_h_uint32_t],
910 [AC_TRY_COMPILE([#include <stdint.h>],
912 [krb5_cv_header_stdint_h_uint32_t=yes],
913 [krb5_cv_header_stdint_h_uint32_t=no])])
914 AC_CACHE_CHECK([for uint32_t in inttypes.h],
915 [krb5_cv_header_inttypes_h_uint32_t],
916 [AC_TRY_COMPILE([#include <inttypes.h>],
918 [krb5_cv_header_inttypes_h_uint32_t=yes],
919 [krb5_cv_header_inttypes_h_uint32_t=no])])
920 GSSRPC__STDINT_H='/* #include <stdint.h> */'
921 GSSRPC__INTTYPES_H='/* #include <inttypes.h> */'
922 GSSRPC__FAKE_UINT32='/* #undef GSSRPC__FAKE_INT32 */'
923 if test $krb5_cv_header_sys_types_h_uint32_t = yes; then
924 : # already included sys/types.h
926 if test $krb5_cv_header_stdint_h_uint32_t = yes; then
927 GSSRPC__STDINT_H='#include <stdint.h>'
929 if test $krb5_cv_header_inttypes_h_uint32_t = yes; then
930 GSSRPC__INTTYPES_H='#include <inttypes.h>'
932 AC_MSG_WARN([can't find a fixed-width 32-bit type anywhere; faking it])
933 GSSRPC__FAKE_UINT32='#define GSSRPC__FAKE_UINT32 1'
937 AC_SUBST(GSSRPC__STDINT_H)
938 AC_SUBST(GSSRPC__INTTYPES_H)
939 AC_SUBST(GSSRPC__FAKE_UINT32)
941 AC_CACHE_CHECK([for BSD type aliases], [krb5_cv_type_bsdaliases],
943 [#include <sys/types.h>
949 u_long l;], [krb5_cv_type_bsdaliases=yes], [krb5_cv_type_bsdaliases=no])])
950 if test $krb5_cv_type_bsdaliases = yes; then
951 GSSRPC__BSD_TYPEALIASES='/* #undef GSSRPC__BSD_TYPEALIASES */'
953 GSSRPC__BSD_TYPEALIASES='#define GSSRPC__BSD_TYPEALIASES 1'
955 AC_SUBST(GSSRPC__BSD_TYPEALIASES)
957 # sockaddr length field checks
959 AC_CHECK_MEMBERS([struct sockaddr_in.sin_len], , ,
960 [#include <sys/types.h>
961 @%:@include <netinet/in.h>])
962 AC_CHECK_MEMBERS([struct sockaddr.sa_len], , ,
963 [#include <sys/types.h>
964 @%:@include <sys/socket.h>])
966 AC_MSG_CHECKING([return type of setrpcent])
967 AC_CACHE_VAL(k5_cv_type_setrpcent,
968 [AC_TRY_COMPILE([#include <netdb.h>
972 extern void setrpcent();],
973 [int i;], k5_cv_type_setrpcent=void, k5_cv_type_setrpcent=int)])
974 AC_MSG_RESULT($k5_cv_type_setrpcent)
975 AC_DEFINE_UNQUOTED(SETRPCENT_TYPE, $k5_cv_type_setrpcent, [Define as return type of setrpcent])
977 AC_MSG_CHECKING([return type of endrpcent])
978 AC_CACHE_VAL(k5_cv_type_endrpcent,
979 [AC_TRY_COMPILE([#include <netdb.h>
983 extern void endrpcent();],
984 [int i;], k5_cv_type_endrpcent=void, k5_cv_type_endrpcent=int)])
985 AC_MSG_RESULT($k5_cv_type_endrpcent)
986 AC_DEFINE_UNQUOTED(ENDRPCENT_TYPE, $k5_cv_type_endrpcent, [Define as return type of endrpcent])
987 K5_GEN_FILE(include/gssrpc/types.h:include/gssrpc/types.hin)
989 case "$krb5_cv_host" in
990 *-*-solaris2.[012345]*)
1001 AC_ARG_ENABLE([pkinit],
1002 [ --disable-pkinit disable PKINIT plugin support],,
1004 if test "$enable_pkinit" = yes || test "$enable_pkinit" = try; then
1005 AC_CACHE_CHECK(for a recent enough OpenSSL, k5_cv_openssl_version_okay,
1006 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <openssl/opensslv.h>
1007 #if OPENSSL_VERSION_NUMBER < 0x00908000L
1008 # error openssl is too old, need 0.9.8
1011 ])], k5_cv_openssl_version_okay=yes, k5_cv_openssl_version_okay=no)])
1013 AC_CHECK_LIB(crypto, PKCS7_get_signer_info)
1016 if test "$k5_cv_openssl_version_okay" = yes && (test "$enable_pkinit" = yes || test "$enable_pkinit" = try); then
1017 K5_GEN_MAKEFILE(plugins/preauth/pkinit)
1019 elif test "$k5_cv_openssl_version_okay" = no && test "$enable_pkinit" = yes; then
1020 AC_MSG_ERROR([Version of OpenSSL is too old; cannot enable PKINIT.])
1022 AC_DEFINE([DISABLE_PKINIT], 1, [Define to disable PKINIT plugin support])
1023 AC_MSG_NOTICE([Disabling PKINIT support.])
1029 AC_REPLACE_FUNCS(daemon)
1032 if test x"$RUNTEST" != x; then
1037 AC_SUBST(HAVE_RUNTEST)
1040 AC_CHECK_PROG(PYTHON,python,python)
1042 if test x"$PYTHON" != x; then
1043 # k5test.py requires python 2.4 (for the subprocess module).
1044 vercheck="import sys;sys.exit((sys.hexversion < 0x2040000) and 1 or 0)"
1045 if python -c "$vercheck"; then
1049 AC_SUBST(HAVE_PYTHON)
1051 # for plugins/kdb/db2
1053 # AIX is unusual in that it wants all symbols resolved at link time
1054 # Fortunately, it will allow us to link the kdb library now, even if
1055 # it is linked again later.
1056 case $krb5_cv_host in
1064 AC_SUBST(DB_EXTRA_LIBS)
1068 # Check for thread safety issues.
1069 # (Is there a better place for this?)
1070 # tsfuncs="getpwnam_r getpwuid_r gethostbyname_r getservbyname_r gmtime_r localtime_r"
1071 # Removed getpwnam_r and getpwuid_r because include/configure.in has some
1072 # more careful checks, and may decide to pretend that they're not found if
1073 # the function signatures can't be figured out.
1074 tsfuncs="gethostbyname_r getservbyname_r gmtime_r localtime_r"
1075 AC_CHECK_FUNCS($tsfuncs)
1076 if test "$enable_thread_support" = yes; then
1078 for ts in $tsfuncs; do
1079 if eval "test \"\${ac_cv_func_$ts}\" != yes"; then
1080 tsmissing="$tsmissing $ts"
1083 if test "$ac_cv_func_res_nsearch/$ac_cv_lib_resolv_res_nsearch" = "no/no"; then
1084 tsmissing="$tsmissing res_nsearch"
1086 if test "$tsmissing" != ""; then
1087 AC_MSG_WARN([Some functions that are needed for library thread])
1088 AC_MSG_WARN([safety appear to be missing.])
1089 for ts in $tsmissing; do
1090 AC_MSG_WARN([ missing thread-safe function: $ts])
1092 AC_MSG_WARN([Without these functions, the installed libraries])
1093 AC_MSG_WARN([may not be thread-safe.])
1094 fi # tsmissing not empty
1095 fi # enable_thread_support
1097 # Sadly, we seem to have accidentally committed ourselves in 1.4 to
1098 # an ABI that includes the existence of libkrb5support.0 even
1099 # though random apps should never use anything from it. And on
1100 # the Mac, to which that didn't apply, we can't use major version 0.
1102 case $krb5_cv_host in
1103 *-*-darwin* | *-*-rhapsody*) SUPPORTLIB_MAJOR=1 ;;
1104 *) SUPPORTLIB_MAJOR=0 ;;
1106 AC_SUBST(SUPPORTLIB_MAJOR)
1109 if test "$COM_ERR_VERSION" = k5 ; then
1110 K5_GEN_MAKEFILE(util/et)
1112 if test "$SS_VERSION" = k5 ; then
1113 K5_GEN_MAKEFILE(util/ss)
1119 if test -n "$OPENLDAP_PLUGIN"; then
1120 AC_CHECK_HEADERS(ldap.h lber.h, :, [AC_MSG_ERROR($ac_header not found)])
1121 AC_CHECK_LIB(ldap, ldap_init, :, [AC_MSG_ERROR(libldap not found or missing ldap_init)])
1124 AC_CHECK_FUNCS(ldap_initialize ldap_url_parse_nodn ldap_unbind_ext_s ldap_str2dn ldap_explode_dn)
1128 AC_CHECK_LIB(ldap, ber_init, [BER_OKAY=1])
1129 if test "$BER_OKAY" = "1"; then
1132 AC_CHECK_LIB(lber, ber_init, [BER_OKAY=1], [AC_MSG_WARN([libber not found])])
1133 if test "$BER_OKAY" = "1"; then
1134 LDAP_LIBS='-lldap -llber'
1136 AC_ERROR("BER library missing - cannot build LDAP database module")
1139 AC_DEFINE([ENABLE_LDAP], 1, [Define if LDAP KDB support within the Kerberos library (mainly ASN.1 code) should be enabled.])
1142 K5_GEN_MAKEFILE(plugins/kdb/ldap)
1143 K5_GEN_MAKEFILE(plugins/kdb/ldap/ldap_util)
1144 K5_GEN_MAKEFILE(plugins/kdb/ldap/libkdb_ldap)
1145 ldap_plugin_dir='plugins/kdb/ldap plugins/kdb/ldap/ldap_util'
1150 AC_SUBST(ldap_plugin_dir)
1152 # This check is for plugins/preauth/securid_sam2
1155 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
1156 AC_CHECK_LIB(aceclnt, sd_init, [
1157 AC_MSG_NOTICE([Enabling RSA securID support])
1158 sam2_plugin=plugins/preauth/securid_sam2
1160 AC_SUBST(sam2_plugin)
1163 # This checks is for plugins/locate/python, which isn't built by
1164 # default, so it's not a big deal that it isn't very good. We should
1165 # use python-config instead.
1167 AC_CHECK_HEADERS(Python.h python2.3/Python.h python2.5/Python.h)
1168 AC_CHECK_LIB(python2.3,main,[PYTHON_LIB=-lpython2.3],
1169 AC_CHECK_LIB(python2.5,main,[PYTHON_LIB=-lpython2.5]))
1170 AC_SUBST(PYTHON_LIB)
1173 # Kludge for simple server --- FIXME is this the best way to do this?
1175 if test "$ac_cv_lib_socket" = "yes" -a "$ac_cv_lib_nsl" = "yes"; then
1176 AC_DEFINE(BROKEN_STREAMS_SOCKETS,1,[Define if socket can't be bound to 0.0.0.0])
1179 # Compile with libedit support in ss by default if available. Compile
1180 # with readline only if asked, to avoid a default GPL dependency.
1181 # Building with readline also breaks the dejagnu test suite.
1182 AC_ARG_WITH([libedit],
1183 AC_HELP_STRING([--without-libedit], [do not compile with libedit]),
1184 [], [with_libedit=default])
1185 AC_ARG_WITH([readline],
1186 AC_HELP_STRING([--with-readline], [compile with GNU Readline]),
1187 [], [with_readline=no])
1188 AC_MSG_CHECKING([for readline support])
1189 if test "x$with_readline" = xyes; then
1194 if test "x$with_libedit" != xno; then
1195 if rl_cflags=`pkg-config --cflags libedit 2>&1`; then
1196 RL_CFLAGS=$rl_cflags
1197 RL_LIBS=`pkg-config --libs libedit`
1198 AC_DEFINE([HAVE_LIBEDIT], 1, [Define if building with libedit.])
1199 AC_MSG_RESULT([using libedit])
1200 elif test "x$with_libedit" = yes; then
1201 # We were explicitly asked for libedit and couldn't find it.
1202 AC_MSG_ERROR([Could not detect libedit with pkg-config.])
1204 AC_MSG_RESULT([not using any])
1206 elif test "x$with_readline" = xyes; then
1207 AC_MSG_RESULT([using GNU Readline])
1208 AC_CHECK_LIB([readline], [main], :,
1209 AC_MSG_FAILURE([Cannot find readline library.]), [-lncurses])
1210 AC_DEFINE([HAVE_READLINE], 1, [Define if building with GNU Readline.])
1211 RL_LIBS='-lreadline -lhistory -lncurses'
1213 AC_MSG_RESULT([not using any])
1215 AC_SUBST([RL_CFLAGS])
1218 AC_ARG_WITH([system-verto],
1219 [AC_HELP_STRING([--with-system-verto], [always use system verto library])],
1220 [], [with_system_verto=default])
1222 VERTO_LIBS="-lverto-k5ev -lverto"
1224 if test "x$with_system_verto" != xno; then
1225 if verto_cflags=`pkg-config --cflags libverto 2>&1`; then
1226 VERTO_CFLAGS=$verto_cflags
1227 VERTO_LIBS=`pkg-config --libs libverto`
1230 AC_CHECK_LIB([verto], [verto_run], [VERTO_VERSION=sys; VERTO_LIBS=-lverto],
1231 [if test "x$with_system_verto" = xyes; then
1232 AC_MSG_ERROR([cannot detect system libverto])
1236 if test "x$VERTO_VERSION" = xsys; then
1237 AC_MSG_NOTICE([Using system libverto])
1239 AC_MSG_RESULT([Using built-in libverto])
1240 AC_DEFINE([INTERNAL_VERTO],[1],[Define if using bundled libverto])
1242 AC_SUBST([VERTO_CFLAGS])
1243 AC_SUBST([VERTO_LIBS])
1244 AC_SUBST([VERTO_VERSION])
1246 AC_PATH_PROG(GROFF, groff)
1248 # Make localedir work in autoconf 2.5x.
1249 if test "${localedir+set}" != set; then
1250 localedir='$(datadir)/locale'
1254 AC_CONFIG_FILES(krb5-config, [chmod +x krb5-config])
1255 V5_AC_OUTPUT_MAKEFILE(.
1257 util util/support util/profile util/profile/testmod util/send-pr
1258 util/verto util/k5ev
1262 lib/crypto lib/crypto/krb lib/crypto/$CRYPTO_IMPL
1263 lib/crypto/$CRYPTO_IMPL/enc_provider
1264 lib/crypto/$CRYPTO_IMPL/hash_provider
1265 lib/crypto/$CRYPTO_IMPL/des
1266 lib/crypto/$CRYPTO_IMPL/md4 lib/crypto/$CRYPTO_IMPL/md5
1267 lib/crypto/$CRYPTO_IMPL/sha1 lib/crypto/$CRYPTO_IMPL/sha2
1268 lib/crypto/$CRYPTO_IMPL/aes lib/crypto/$CRYPTO_IMPL/camellia
1269 lib/crypto/crypto_tests
1271 lib/krb5 lib/krb5/error_tables lib/krb5/asn.1 lib/krb5/ccache
1272 dnl lib/krb5/ccache/ccapi
1273 lib/krb5/keytab lib/krb5/krb lib/krb5/rcache lib/krb5/os
1276 lib/gssapi lib/gssapi/generic lib/gssapi/krb5 lib/gssapi/spnego
1279 lib/rpc lib/rpc/unit-test
1281 lib/kadm5 lib/kadm5/clnt lib/kadm5/srv lib/kadm5/unit-test
1285 dnl ccapi ccapi/lib ccapi/lib/unix ccapi/server ccapi/server/unix ccapi/test
1287 kdc slave config-files gen-manpages man doc include
1289 plugins/locate/python
1290 plugins/kadm5_hook/test
1292 plugins/kdb/db2/libdb2
1293 plugins/kdb/db2/libdb2/hash
1294 plugins/kdb/db2/libdb2/btree
1295 plugins/kdb/db2/libdb2/db
1296 plugins/kdb/db2/libdb2/mpool
1297 plugins/kdb/db2/libdb2/recno
1298 plugins/kdb/db2/libdb2/test
1300 plugins/preauth/cksum_body
1301 plugins/preauth/securid_sam2
1302 plugins/preauth/wpse
1303 plugins/authdata/greet
1304 plugins/authdata/greet_client
1305 plugins/authdata/greet_server
1307 clients clients/klist clients/kinit clients/kvno
1308 clients/kdestroy clients/kpasswd clients/ksu clients/kswitch
1310 kadmin kadmin/cli kadmin/dbutil kadmin/ktutil kadmin/server
1311 kadmin/testing kadmin/testing/scripts kadmin/testing/util
1314 appl/sample appl/sample/sclient appl/sample/sserver
1315 appl/simple appl/simple/client appl/simple/server
1316 appl/gss-sample appl/user_user
1318 tests tests/resolve tests/asn.1 tests/create tests/hammer
1319 tests/verify tests/gssapi tests/dejagnu tests/threads tests/shlib
1320 tests/gss-threads tests/misc tests/mkeystash_compat
1321 util/gss-kernel-lib util/collected-client-lib