xref: /freebsd/crypto/krb5/src/configure.ac (revision f1c4c3daccbaf3820f0e2224de53df12fc952fcc)
1K5_AC_INIT([aclocal.m4])
2
3# If $runstatedir isn't set by autoconf (<2.70), set it manually.
4if test x"$runstatedir" = x; then
5  runstatedir='${localstatedir}/run'
6fi
7AC_SUBST(runstatedir)
8
9# Don't make duplicate profile path entries for /etc/krb5.conf if
10# $sysconfdir is /etc
11if test "$sysconfdir" = /etc; then
12  SYSCONFCONF=""
13else
14  SYSCONFCONF=":${sysconfdir}/krb5.conf"
15fi
16AC_SUBST(SYSCONFCONF)
17
18CONFIG_RULES
19KRB5_VERSION=K5_VERSION
20AC_SUBST(KRB5_VERSION)
21
22
23AC_REQUIRE_CPP
24
25PKG_PROG_PKG_CONFIG
26
27AC_CHECK_HEADER([stdint.h], [],
28  [AC_MSG_ERROR([stdint.h is required])])
29
30AC_CACHE_CHECK([whether integers are two's complement],
31  [krb5_cv_ints_twos_compl],
32  [AC_COMPILE_IFELSE(
33    [AC_LANG_BOOL_COMPILE_TRY(
34[#include <limits.h>
35],
36	[/* Basic two's complement check */
37	  ~(-1) == 0 && ~(-1L) == 0L &&
38	  /* Check that values with sign bit 1 and value bits 0 are valid */
39	  -(INT_MIN + 1) == INT_MAX && -(LONG_MIN + 1) == LONG_MAX &&
40	  /* Check that unsigned-to-signed conversions preserve bit patterns */
41	  (int)((unsigned int)INT_MAX + 1) == INT_MIN &&
42	  (long)((unsigned long)LONG_MAX + 1) == LONG_MIN])],
43    [krb5_cv_ints_twos_compl=yes],
44    [krb5_cv_ints_twos_compl=no])])
45
46if test "$krb5_cv_ints_twos_compl" = "no"; then
47  AC_MSG_ERROR([integers are not two's complement])
48fi
49
50AC_CACHE_CHECK([whether CHAR_BIT is 8],
51  [krb5_cv_char_bit_8],
52  [AC_PREPROC_IFELSE([AC_LANG_SOURCE(
53[[#include <limits.h>
54#if CHAR_BIT != 8
55  #error CHAR_BIT != 8
56#endif
57]])],
58    [krb5_cv_char_bit_8=yes], [krb5_cv_char_bit_8=no])])
59
60if test "$krb5_cv_char_bit_8" = "no"; then
61  AC_MSG_ERROR([CHAR_BIT is not 8])
62fi
63
64AC_CACHE_CHECK(if va_copy is available, krb5_cv_va_copy,
65[AC_LINK_IFELSE([AC_LANG_SOURCE([
66#include <stdarg.h>
67void f(va_list ap) {
68  va_list ap2;
69  va_copy(ap2, ap);
70  va_end(ap2);
71}
72va_list x;
73int main()
74{
75  f(x);
76  return 0;
77}])], krb5_cv_va_copy=yes, krb5_cv_va_copy=no)])
78if test "$krb5_cv_va_copy" = yes; then
79  AC_DEFINE(HAS_VA_COPY,1,[Define if va_copy macro or function is available.])
80fi
81
82# Note that this isn't checking if the copied value *works*, just
83# whether the C language constraints permit the copying.  If
84# va_list is defined as an array type, it can't be assigned.
85AC_CACHE_CHECK(if va_list objects can be copied by assignment,
86	       krb5_cv_va_simple_copy,
87[AC_COMPILE_IFELSE([
88AC_LANG_SOURCE([#include <stdarg.h>
89void f(va_list va2) {
90  va_list va1;
91  va1 = va2;
92}])], krb5_cv_va_simple_copy=yes, krb5_cv_va_simple_copy=no)])
93if test "$krb5_cv_va_simple_copy" = yes; then
94  AC_DEFINE(CAN_COPY_VA_LIST,1,[Define if va_list objects can be simply copied by assignment.])
95fi
96
97# The following lines are so that configure --help gives some global
98# configuration options.
99
100KRB5_LIB_AUX
101AC_ARG_ENABLE([athena],
102[  --enable-athena         build with MIT Project Athena configuration],,)
103
104# Begin autoconf tests for the Makefiles generated out of the top-level
105# configure.in...
106
107KRB5_BUILD_LIBOBJS
108KRB5_BUILD_LIBRARY
109KRB5_BUILD_PROGRAM
110# for kprop
111AC_TYPE_MODE_T
112AC_PROG_INSTALL
113KRB5_AC_NEED_DAEMON
114KRB5_GETSOCKNAME_ARGS
115KRB5_GETPEERNAME_ARGS
116LIBUTIL=
117AC_CHECK_LIB(util,main,[AC_DEFINE(HAVE_LIBUTIL,1,[Define if the util library is available])
118LIBUTIL=-lutil
119])
120AC_SUBST(LIBUTIL)
121
122# Determine if NLS is desired and supported.
123po=
124AC_ARG_ENABLE([nls],
125  [AS_HELP_STRING([--disable-nls], [disable native language support])],
126  [], [enable_nls=check])
127if test "$enable_nls" != no; then
128  AC_CHECK_HEADER(libintl.h, [
129    AC_SEARCH_LIBS(dgettext, intl, [
130      AC_DEFINE(ENABLE_NLS, 1,
131                [Define if translation functions should be used.])
132      nls_enabled=yes])])
133
134  AC_CHECK_PROG(MSGFMT,msgfmt,msgfmt)
135  if test x"$MSGFMT" != x; then
136    K5_GEN_MAKEFILE(po)
137    po=po
138  fi
139
140  # Error out if --enable-nls was explicitly requested but can't be enabled.
141  if test "$enable_nls" = yes; then
142    if test "$nls_enabled" != yes -o "x$po" = x; then
143      AC_MSG_ERROR([NLS support requested but cannot be built])
144    fi
145  fi
146fi
147AC_SUBST(po)
148
149# for kdc
150AC_CHECK_HEADERS(sys/sockio.h ifaddrs.h unistd.h fnmatch.h)
151AC_CHECK_FUNCS(vsprintf vasprintf vsnprintf strlcpy fnmatch secure_getenv)
152
153EXTRA_SUPPORT_SYMS=
154AC_CHECK_FUNC(strlcpy,
155[STRLCPY_ST_OBJ=
156STRLCPY_OBJ=],
157[STRLCPY_ST_OBJ=strlcpy.o
158STRLCPY_OBJ='$(OUTPRE)strlcpy.$(OBJEXT)'
159EXTRA_SUPPORT_SYMS="$EXTRA_SUPPORT_SYMS krb5int_strlcpy krb5int_strlcat"])
160AC_SUBST(STRLCPY_OBJ)
161AC_SUBST(STRLCPY_ST_OBJ)
162
163AC_CHECK_FUNC(getopt,
164[GETOPT_ST_OBJ=
165GETOPT_OBJ=
166AC_DEFINE(HAVE_GETOPT, 1, [Define if system getopt should be used.])],
167[GETOPT_ST_OBJ='getopt.o'
168GETOPT_OBJ='$(OUTPRE)getopt.$(OBJEXT)'
169EXTRA_SUPPORT_SYMS="$EXTRA_SUPPORT_SYMS k5_optind k5_optarg k5_opterr k5_optopt k5_getopt"])
170AC_SUBST(GETOPT_OBJ)
171AC_SUBST(GETOPT_ST_OBJ)
172
173AC_CHECK_FUNC(getopt_long,
174[GETOPT_LONG_ST_OBJ=
175GETOPT_LONG_OBJ=
176AC_DEFINE(HAVE_GETOPT_LONG, 1, [Define if system getopt_long should be used.])],
177[GETOPT_LONG_ST_OBJ='getopt_long.o'
178GETOPT_LONG_OBJ='$(OUTPRE)getopt_long.$(OBJEXT)'
179EXTRA_SUPPORT_SYMS="$EXTRA_SUPPORT_SYMS k5_getopt_long"])
180AC_SUBST(GETOPT_LONG_OBJ)
181AC_SUBST(GETOPT_LONG_ST_OBJ)
182
183AC_CHECK_FUNC(fnmatch,
184[FNMATCH_ST_OBJ=
185FNMATCH_OBJ=],
186[FNMATCH_ST_OBJ=fnmatch.o
187FNMATCH_OBJ='$(OUTPRE)fnmatch.$(OBJEXT)'
188EXTRA_SUPPORT_SYMS="$EXTRA_SUPPORT_SYMS k5_fnmatch"])
189AC_SUBST(FNMATCH_OBJ)
190AC_SUBST(FNMATCH_ST_OBJ)
191
192AC_CHECK_FUNC(vasprintf,
193[PRINTF_ST_OBJ=
194PRINTF_OBJ=],
195[PRINTF_ST_OBJ=printf.o
196PRINTF_OBJ='$(OUTPRE)printf.$(OBJEXT)'
197EXTRA_SUPPORT_SYMS="$EXTRA_SUPPORT_SYMS krb5int_asprintf krb5int_vasprintf"])
198AC_SUBST(PRINTF_OBJ)
199AC_SUBST(PRINTF_ST_OBJ)
200KRB5_NEED_PROTO([#include <stdarg.h>
201#include <stdio.h>
202],vasprintf)
203KRB5_NEED_PROTO([#include <string.h>
204#ifdef HAVE_UNISTD_H
205#include <unistd.h>
206#endif
207/* Solaris 8 declares swab in stdlib.h.  */
208#include <stdlib.h>
209],swab,1)
210
211AC_CHECK_FUNC(secure_getenv,
212[SECURE_GETENV_ST_OBJ=
213SECURE_GETENV_OBJ=
214SECURE_GETENV_INIT=],
215[SECURE_GETENV_ST_OBJ=secure_getenv.o
216SECURE_GETENV_OBJ='$(OUTPRE)secure_getenv.$(OBJEXT)'
217SECURE_GETENV_INIT=k5_secure_getenv_init
218EXTRA_SUPPORT_SYMS="$EXTRA_SUPPORT_SYMS k5_secure_getenv"])
219AC_SUBST(SECURE_GETENV_OBJ)
220AC_SUBST(SECURE_GETENV_ST_OBJ)
221AC_SUBST(SECURE_GETENV_INIT)
222
223AC_PROG_AWK
224KRB5_AC_INET6
225KRB5_SOCKADDR_SA_LEN
226CHECK_SIGNALS
227
228# --with-vague-errors disables useful error messages.
229
230AC_ARG_WITH([vague-errors],
231  [AS_HELP_STRING([--with-vague-errors],
232    [Do not @<:@do@:>@ send helpful errors to client])],
233  [], [withval=no])
234if test "$withval" = yes; then
235	AC_MSG_NOTICE(Supplying vague error messages to KDC clients)
236	AC_DEFINE(KRBCONF_VAGUE_ERRORS,1,[Define if the KDC should return only vague error codes to clients])
237fi
238
239# Check which (if any) audit plugin to build
240audit_plugin=""
241AC_ARG_ENABLE([audit-plugin],
242  [AS_HELP_STRING([--enable-audit-plugin=IMPL],
243    [use audit plugin @<:@ do not use audit @:>@])],
244  [], enableval=no)
245if test "$enableval" != no; then
246    case "$enableval" in
247    simple)
248        # if audit_log_user_message is found, we assume
249        # that audit_open and audit_close are also defined.
250        AC_CHECK_LIB(audit, audit_log_user_message,
251                     [AUDIT_IMPL_LIBS=-laudit
252                     K5_GEN_MAKEFILE(plugins/audit/simple)
253                     audit_plugin=plugins/audit/simple ],
254                     AC_MSG_ERROR([libaudit not found or undefined symbol audit_log_user_message]))
255        ;;
256    *)
257        AC_MSG_ERROR([Unknown audit plugin implementation $enableval.])
258        ;;
259    esac
260fi
261AC_SUBST(AUDIT_IMPL_LIBS)
262AC_SUBST(audit_plugin)
263
264# WITH_CRYPTO_IMPL
265
266CRYPTO_IMPL=builtin
267AC_ARG_WITH([crypto-impl],
268  [AS_HELP_STRING([--with-crypto-impl=IMPL],
269    [use specified crypto implementation @<:@builtin@:>@])],
270  [CRYPTO_IMPL=$withval
271   AC_MSG_NOTICE(k5crypto will use '$withval')])
272
273CRYPTO_BUILTIN_TESTS=no
274case $CRYPTO_IMPL in
275builtin)
276  CRYPTO_BUILTIN_TESTS=yes
277  ;;
278openssl)
279  AC_CHECK_LIB(crypto, PKCS7_get_signer_info)
280  AC_DEFINE([CRYPTO_OPENSSL], 1, [Define to use OpenSSL crypto library])
281  ;;
282*)
283  AC_MSG_ERROR([Unknown crypto implementation $withval])
284  ;;
285esac
286AC_SUBST([CRYPTO_IMPL_CFLAGS])
287AC_SUBST([CRYPTO_IMPL_LIBS])
288AC_SUBST([CRYPTO_BUILTIN_TESTS])
289
290# WITH_TLS_IMPL
291
292AC_ARG_WITH([tls-impl],
293  [AS_HELP_STRING([--with-tls-impl=IMPL],
294    [use specified TLS implementation @<:@auto@:>@])],
295  [TLS_IMPL=$withval], [TLS_IMPL=auto])
296case "$TLS_IMPL" in
297openssl|auto)
298  AC_CHECK_LIB(ssl,SSL_CTX_new,[have_lib_ssl=true],[have_lib_ssl=false],
299               -lcrypto)
300  AC_MSG_CHECKING([for OpenSSL])
301  if test x$have_lib_ssl = xtrue ; then
302    AC_DEFINE(TLS_IMPL_OPENSSL,1,[Define if TLS implementation is OpenSSL])
303    AC_MSG_RESULT([yes])
304    TLS_IMPL_LIBS="-lssl -lcrypto"
305    TLS_IMPL=openssl
306    AC_MSG_NOTICE([TLS module will use OpenSSL])
307  else
308    if test "$TLS_IMPL" = openssl ; then
309      AC_MSG_ERROR([OpenSSL not found!])
310    else
311      AC_MSG_WARN([OpenSSL not found!])
312    fi
313    TLS_IMPL=no
314    AC_MSG_NOTICE(building without TLS support)
315  fi
316  ;;
317no)
318  AC_MSG_NOTICE(building without TLS support)
319  ;;
320*)
321  AC_MSG_ERROR([Unsupported TLS implementation $withval])
322  ;;
323esac
324
325if test "$TLS_IMPL" = no; then
326   AC_DEFINE(TLS_IMPL_NONE,1,[Define if no TLS implementation is selected])
327fi
328
329AC_SUBST(TLS_IMPL)
330AC_SUBST(TLS_IMPL_CFLAGS)
331AC_SUBST(TLS_IMPL_LIBS)
332
333AC_ARG_WITH([keyutils],
334  [AS_HELP_STRING([--without-keyutils], [do not link with libkeyutils])],
335  [], [with_keyutils=check])
336if test "$with_keyutils" != no; then
337  have_keyutils=false
338  AC_CHECK_HEADERS([keyutils.h],
339    AC_CHECK_LIB(keyutils, add_key, [have_keyutils=true]))
340  if test "$have_keyutils" = true; then
341    AC_DEFINE(USE_KEYRING_CCACHE, 1,
342              [Define if the keyring ccache should be enabled])
343    LIBS="-lkeyutils $LIBS"
344    # If libkeyutils supports persistent keyrings, use them.
345    AC_CHECK_LIB(keyutils, keyctl_get_persistent,
346      [AC_DEFINE(HAVE_PERSISTENT_KEYRING, 1,
347                 [Define if persistent keyrings are supported])
348      ])
349  elif test "$with_keyutils" = yes; then
350    AC_MSG_ERROR([libkeyutils not found])
351  fi
352fi
353
354# The SPAKE preauth plugin currently supports edwards25519 natively,
355# and can support three NIST groups using OpenSSL.
356HAVE_SPAKE_OPENSSL=no
357AC_ARG_WITH([spake-openssl],
358  [AS_HELP_STRING([--with-spake-openssl],
359    [use OpenSSL for SPAKE preauth @<:@auto@:>@])],
360  [], [withval=auto])
361if test "$withval" = auto -o "$withval" = yes; then
362  AC_CHECK_LIB([crypto],[EC_POINT_new],[have_crypto=true],[have_crypto=false])
363  if test "$have_crypto" = true; then
364    AC_DEFINE(SPAKE_OPENSSL,1,[Define to use OpenSSL for SPAKE preauth])
365    SPAKE_OPENSSL_LIBS=-lcrypto
366    HAVE_SPAKE_OPENSSL=yes
367  elif test "$withval" = yes; then
368    AC_MSG_ERROR([OpenSSL libcrypto not found])
369  fi
370fi
371AC_SUBST(HAVE_SPAKE_OPENSSL)
372AC_SUBST(SPAKE_OPENSSL_LIBS)
373
374AC_ARG_ENABLE([aesni],
375  [AS_HELP_STRING([--disable-aesni], [Do not build with AES-NI support])],
376  [], [enable_aesni=check])
377if test "$CRYPTO_IMPL" = builtin -a "x$enable_aesni" != xno; then
378    case "$host" in
379    i686-*)
380	aesni_obj=iaesx86.o
381	aesni_machine=x86
382	;;
383    x86_64-*)
384	aesni_obj=iaesx64.o
385	aesni_machine=amd64
386	;;
387    esac
388    case "$host" in
389    *-*-linux* | *-*-gnu* | *-*-*bsd* | *-*-solaris*)
390	# All Unix-like platforms need -D__linux__ for iaesx64.s to
391	# use the System V x86-64 calling convention.
392	aesni_flags="-D__linux__ -f elf -m $aesni_machine"
393	;;
394    esac
395    if test "x$aesni_obj" != x && test "x$aesni_flags" != x; then
396	AC_CHECK_PROG(YASM,yasm,yasm)
397	AC_CHECK_HEADERS(cpuid.h)
398	if test x"$YASM" != x -a "x$ac_cv_header_cpuid_h" = xyes; then
399	    AESNI_OBJ=$aesni_obj
400	    AESNI_FLAGS=$aesni_flags
401	    AC_DEFINE(AESNI,1,[Define if AES-NI support is enabled])
402	    AC_MSG_NOTICE([Building with AES-NI support])
403	fi
404    fi
405    if test "x$enable_aesni" = xyes -a "x$AESNI_OBJ" = x; then
406	AC_MSG_ERROR([AES-NI support requested but cannot be built])
407    fi
408fi
409AC_SUBST(AESNI_OBJ)
410AC_SUBST(AESNI_FLAGS)
411
412AC_ARG_ENABLE([kdc-lookaside-cache],
413  AS_HELP_STRING([--disable-kdc-lookaside-cache],
414    [Disable the cache which detects client retransmits]),
415  [], [enableval=yes])
416if test "$enableval" = no ; then
417	AC_DEFINE(NOCACHE,1,[Define if the KDC should use no lookaside cache])
418fi
419KRB5_RUN_FLAGS
420
421# asan is a gcc and clang facility to instrument the code with memory
422# error checking.  To use it, we compile C and C++ source files with
423# -fsanitize=address, and set ASAN=yes to suppress the undefined
424# symbols check when building shared libraries.
425AC_ARG_ENABLE([asan],
426  [AS_HELP_STRING([--enable-asan], [Build with asan memory checking])],
427  [], [enable_asan=no])
428if test "$enable_asan" != no; then
429    if test "$enable_asan" = yes; then
430        enable_asan=address
431    fi
432    ASAN_FLAGS="$DEFS -fsanitize=$enable_asan"
433    ASAN=yes
434    UNDEF_CHECK=
435else
436    ASAN_FLAGS=
437    ASAN=no
438fi
439AC_SUBST(ASAN_FLAGS)
440AC_SUBST(ASAN)
441
442# Build using OSS-Fuzz build processes for compiling fuzzing targets.
443# LIB_FUZZING_ENGINE is used for supporting various types of fuzzers.
444fuzz_dir=""
445FUZZ_LDFLAGS=
446AC_ARG_ENABLE([ossfuzz],
447  [AS_HELP_STRING([--enable-ossfuzz], [Build with fuzzing targets])],
448  [], [enable_ossfuzz=no])
449if test "$enable_ossfuzz" != no; then
450    # Check if LIB_FUZZING_ENGINE environment is not empty.
451    if test -z "$LIB_FUZZING_ENGINE"; then
452        AC_MSG_ERROR([LIB_FUZZING_ENGINE environment variable is not set])
453    fi
454    fuzz_dir="fuzzing"
455    FUZZ_LDFLAGS="$LIB_FUZZING_ENGINE"
456    K5_GEN_MAKEFILE(tests/fuzzing)
457fi
458AC_SUBST(fuzz_dir)
459AC_SUBST(FUZZ_LDFLAGS)
460
461# from old include/configure.in
462AH_TEMPLATE([HAVE_STRUCT_SOCKADDR_STORAGE],
463[Define if "struct sockaddr_storage" is available.])
464
465AC_CONFIG_HEADERS(include/autoconf.h, [echo timestamp > include/autoconf.stamp])
466AC_C_CONST
467AC_HEADER_DIRENT
468AC_FUNC_STRERROR_R
469AC_CHECK_FUNCS(strdup setvbuf seteuid setresuid setreuid setegid setresgid setregid setsid flock fchmod chmod strptime geteuid setenv unsetenv getenv gmtime_r localtime_r bswap16 bswap64 mkstemp getusershell access getcwd srand48 srand srandom stat strchr strerror timegm explicit_bzero explicit_memset getresuid getresgid getentropy)
470
471AC_CHECK_FUNC(mkstemp,
472[MKSTEMP_ST_OBJ=
473MKSTEMP_OBJ=],
474[MKSTEMP_ST_OBJ='mkstemp.o'
475MKSTEMP_OBJ='$(OUTPRE)mkstemp.$(OBJEXT)'
476EXTRA_SUPPORT_SYMS="$EXTRA_SUPPORT_SYMS krb5int_mkstemp"])
477AC_SUBST(MKSTEMP_OBJ)
478AC_SUBST(MKSTEMP_ST_OBJ)
479
480AC_CHECK_FUNC(gettimeofday,
481	[GETTIMEOFDAY_ST_OBJ=
482	GETTIMEOFDAY_OBJ=
483	AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Have the gettimeofday function])
484],
485	[GETTIMEOFDAY_ST_OBJ='gettimeofday.o'
486	GETTIMEOFDAY_OBJ='$(OUTPRE)gettimeofday.$(OBJEXT)'
487	EXTRA_SUPPORT_SYMS="$EXTRA_SUPPORT_SYMS krb5int_gettimeofday"])
488AC_SUBST(GETTIMEOFDAY_OBJ)
489AC_SUBST(GETTIMEOFDAY_ST_OBJ)
490AC_SUBST(EXTRA_SUPPORT_SYMS)
491
492DECLARE_SYS_ERRLIST
493AC_CHECK_HEADERS(unistd.h paths.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 sys/random.h)
494AC_CHECK_MEMBERS([struct stat.st_mtimensec,struct stat.st_mtimespec.tv_nsec,struct stat.st_mtim.tv_nsec],,,[#include <sys/types.h>
495#include <sys/stat.h>])
496AC_TYPE_OFF_T
497
498# Fancy caching of perror result...
499AC_MSG_CHECKING(for perror declaration)
500AC_CACHE_VAL(krb5_cv_decl_perror,
501[AC_EGREP_HEADER(perror, errno.h,
502  krb5_cv_decl_perror=yes, krb5_cv_decl_perror=no)])
503AC_MSG_RESULT($krb5_cv_decl_perror)
504if test $krb5_cv_decl_perror = yes; then
505	AC_DEFINE(HDR_HAS_PERROR,1,[Define if errno.h declares perror])
506fi
507
508KRB5_NEED_PROTO([#include <time.h>],strptime)
509CHECK_WAIT_TYPE
510CHECK_SIGPROCMASK
511AC_TYPE_GETGROUPS
512CHECK_SETJMP
513
514# *rpcent return types needed for lib/rpc
515
516AC_MSG_CHECKING([return type of setrpcent])
517AC_CACHE_VAL(k5_cv_type_setrpcent,
518[AC_COMPILE_IFELSE(
519  [AC_LANG_SOURCE([[#include <netdb.h>
520                    extern void setrpcent();]])],
521  [k5_cv_type_setrpcent=void],
522  [k5_cv_type_setrpcent=int])])
523AC_MSG_RESULT($k5_cv_type_setrpcent)
524AC_DEFINE_UNQUOTED(SETRPCENT_TYPE, $k5_cv_type_setrpcent, [Define as return type of setrpcent])
525
526AC_MSG_CHECKING([return type of endrpcent])
527AC_CACHE_VAL(k5_cv_type_endrpcent,
528[AC_COMPILE_IFELSE(
529  [AC_LANG_SOURCE(
530    [[#include <netdb.h>
531      extern void endrpcent();]])],
532  [k5_cv_type_endrpcent=void], [k5_cv_type_endrpcent=int])])
533AC_MSG_RESULT($k5_cv_type_endrpcent)
534AC_DEFINE_UNQUOTED(ENDRPCENT_TYPE, $k5_cv_type_endrpcent, [Define as return type of endrpcent])
535
536
537# bswap_16 is a macro in byteswap.h under GNU libc
538AC_MSG_CHECKING(for bswap_16)
539AC_CACHE_VAL(krb5_cv_bswap_16,
540[AC_LINK_IFELSE(
541  [AC_LANG_PROGRAM(
542    [[#if HAVE_BYTESWAP_H
543      #include <byteswap.h>
544      #endif
545    ]],
546    [[bswap_16(37);]])],
547  [krb5_cv_bswap_16=yes], [krb5_cv_bswap_16=no])])
548AC_MSG_RESULT($krb5_cv_bswap_16)
549if test "$krb5_cv_bswap_16" = yes; then
550  AC_DEFINE(HAVE_BSWAP_16,1,[Define to 1 if bswap_16 is available via byteswap.h])
551fi
552AC_MSG_CHECKING(for bswap_64)
553AC_CACHE_VAL(krb5_cv_bswap_64,
554[AC_LINK_IFELSE(
555  [AC_LANG_PROGRAM(
556    [[#if HAVE_BYTESWAP_H
557      #include <byteswap.h>
558      #endif
559    ]],
560    [[bswap_64(37);]])],
561  [krb5_cv_bswap_64=yes], [krb5_cv_bswap_64=no])])
562AC_MSG_RESULT($krb5_cv_bswap_64)
563if test "$krb5_cv_bswap_64" = yes; then
564  AC_DEFINE(HAVE_BSWAP_64,1,[Define to 1 if bswap_64 is available via byteswap.h])
565fi
566
567# Needed for ksu and some appl stuff.
568
569case $krb5_cv_host in
570alpha*-dec-osf*)
571	AC_CHECK_LIB(security,setluid,
572		AC_DEFINE(HAVE_SETLUID,1,[Define if setluid provided in OSF/1 security library])
573		KSU_LIBS="-lsecurity"
574	)
575	;;
576esac
577AC_SUBST(KSU_LIBS)
578
579if test $ac_cv_func_setenv = no || test $ac_cv_func_unsetenv = no \
580  || test $ac_cv_func_getenv = no; then
581  SETENVOBJ=setenv.o
582else
583  SETENVOBJ=
584fi
585AC_SUBST(SETENVOBJ)
586
587# Check what the return types for gethostbyname_r and getservbyname_r are.
588
589AC_CHECK_FUNC(gethostbyname_r,[
590ac_cv_func_gethostbyname_r=yes
591if test "$ac_cv_func_gethostbyname_r" = yes; then
592  AC_MSG_CHECKING([if gethostbyname_r returns an int])
593  AC_CACHE_VAL(krb5_cv_gethostbyname_r_returns_int,
594  [AC_COMPILE_IFELSE(
595    [AC_LANG_SOURCE(
596      [[#include <netdb.h>
597        extern int gethostbyname_r();]])],
598    [krb5_cv_gethostbyname_r_returns_int=yes],
599    [krb5_cv_gethostbyname_r_returns_int=no])])
600  AC_MSG_RESULT($krb5_cv_gethostbyname_r_returns_int)
601
602  AC_MSG_CHECKING([if gethostbyname_r returns a pointer])
603  AC_CACHE_VAL(krb5_cv_gethostbyname_r_returns_ptr,
604  [AC_COMPILE_IFELSE(
605    [AC_LANG_SOURCE(
606      [[#include <netdb.h>
607        extern struct hostent *gethostbyname_r();]])],
608    [krb5_cv_gethostbyname_r_returns_ptr=yes],
609    [krb5_cv_gethostbyname_r_returns_ptr=no])])
610  AC_MSG_RESULT($krb5_cv_gethostbyname_r_returns_ptr)
611
612  if test "$krb5_cv_gethostbyname_r_returns_int" = "$krb5_cv_gethostbyname_r_returns_ptr"; then
613    AC_MSG_WARN(cannot determine return type of gethostbyname_r -- disabling)
614    ac_cv_func_gethostbyname_r=no
615  fi
616  if test "$krb5_cv_gethostbyname_r_returns_int" = yes; then
617    AC_DEFINE(GETHOSTBYNAME_R_RETURNS_INT, 1, [Define if gethostbyname_r returns int rather than struct hostent * ])
618  fi
619fi
620if test "$ac_cv_func_gethostbyname_r" = yes; then
621  AC_DEFINE(HAVE_GETHOSTBYNAME_R, 1, [Define if gethostbyname_r exists and its return type is known])
622  AC_CHECK_FUNC(gethostbyaddr_r)
623fi
624])
625
626
627# PTHREAD_CFLAGS changes which variant of these functions is declared
628# on Solaris 11, so use it for these tests.
629old_CFLAGS=$CFLAGS
630CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
631AC_CHECK_FUNC(getpwnam_r,ac_cv_func_getpwnam_r=yes,ac_cv_func_getpwnam_r=no)
632AC_CHECK_FUNC(getpwuid_r,ac_cv_func_getpwuid_r=yes,ac_cv_func_getpwuid_r=no)
633if test "$ac_cv_func_getpwnam_r" = yes; then
634  AC_MSG_CHECKING([return type of getpwnam_r])
635  AC_CACHE_VAL(krb5_cv_getpwnam_r_return_type,
636  [AC_COMPILE_IFELSE(
637    [AC_LANG_SOURCE(
638      [[#include <pwd.h>
639        extern int getpwnam_r();]])],
640    [getpwnam_r_returns_int=yes], [getpwnam_r_returns_int=no])
641   AC_COMPILE_IFELSE(
642    [AC_LANG_SOURCE(
643      [[#include <pwd.h>
644        extern struct passwd *getpwnam_r();]])],
645    [getpwnam_r_returns_ptr=yes], [getpwnam_r_returns_ptr=no])
646   case "$getpwnam_r_returns_int/$getpwnam_r_returns_ptr" in
647     yes/no) krb5_cv_getpwnam_r_return_type=int ;;
648     no/yes) krb5_cv_getpwnam_r_return_type=ptr ;;
649     *) krb5_cv_getpwnam_r_return_type=unknown ;;
650   esac])
651  AC_MSG_RESULT($krb5_cv_getpwnam_r_return_type)
652  if test $krb5_cv_getpwnam_r_return_type = int; then
653    AC_DEFINE(GETPWNAM_R_RETURNS_INT, 1, [Define if getpwnam_r returns an int])
654  elif test $krb5_cv_getpwnam_r_return_type = unknown; then
655    AC_MSG_WARN([Cannot determine getpwnam_r return type, disabling getpwnam_r])
656    ac_cv_func_getpwnam_r=no
657  fi
658fi
659if test "$ac_cv_func_getpwnam_r" = yes; then
660  AC_MSG_CHECKING([number of arguments to getpwnam_r])
661  AC_CACHE_VAL(krb5_cv_getpwnam_r_args,
662  [AC_COMPILE_IFELSE(
663    [AC_LANG_PROGRAM(
664      [[#include <pwd.h>
665        struct passwd pwx; char buf[1024];]],
666      [[getpwnam_r("", &pwx, buf, sizeof(buf));]])],
667    [args4=yes], [args4=no])
668   AC_COMPILE_IFELSE(
669     [AC_LANG_PROGRAM(
670       [[#include <pwd.h>
671         struct passwd pwx, *p;
672         char buf[1024];]],
673       [[getpwnam_r("", &pwx, buf, sizeof(buf), &p);]])],
674     [args5=yes], [args5=no])
675   case $args4/$args5 in
676     yes/no) krb5_cv_getpwnam_r_args=4 ;;
677     no/yes) krb5_cv_getpwnam_r_args=5 ;;
678     *) krb5_cv_getpwnam_r_args=unknown ;;
679   esac])
680  AC_MSG_RESULT($krb5_cv_getpwnam_r_args)
681  if test "$krb5_cv_getpwnam_r_args" = unknown; then
682    AC_MSG_WARN([Cannot determine number of arguments to getpwnam_r, disabling its use.])
683    ac_cv_func_getpwnam_r=no
684  else
685    AC_DEFINE(HAVE_GETPWNAM_R,1,[Define if getpwnam_r is available and useful.])
686    if test "$krb5_cv_getpwnam_r_args" = 4; then
687      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).])
688    fi
689  fi
690fi
691CFLAGS=$old_CFLAGS
692
693if test "$ac_cv_func_getpwnam_r" = no && test "$ac_cv_func_getpwuid_r" = yes; then
694  # Actually, we could do this check, and the corresponding checks
695  # for return type and number of arguments, but I doubt we'll run
696  # into a system where we'd get to use getpwuid_r but not getpwnam_r.
697  AC_MSG_NOTICE([getpwnam_r not useful, so disabling getpwuid_r too])
698  ac_cv_func_getpwuid_r=no
699fi
700if test "$ac_cv_func_getpwuid_r" = yes; then
701  AC_DEFINE(HAVE_GETPWUID_R,1,[Define if getpwuid_r is available and useful.])
702  # Hack: Assume getpwuid_r is the shorter form if getpwnam_r is.
703  if test "$krb5_cv_getpwnam_r_args" = 4; then
704    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).])
705  fi
706fi
707
708if test "$ac_cv_func_gmtime_r" = yes; then
709  AC_MSG_CHECKING([whether gmtime_r returns int])
710  AC_CACHE_VAL(krb5_cv_gmtime_r_returns_int,
711  [AC_COMPILE_IFELSE(
712    [AC_LANG_SOURCE(
713      [[#include <time.h>
714        extern int gmtime_r();]])],
715    [return_int=yes], [return_int=no])
716   AC_COMPILE_IFELSE([
717     AC_LANG_SOURCE(
718       [[#include <time.h>
719         extern struct tm *gmtime_r();]])],
720     [return_ptr=yes], [return_ptr=no])
721   case $return_int/$return_ptr in
722     yes/no) krb5_cv_gmtime_r_returns_int=yes ;;
723     no/yes) krb5_cv_gmtime_r_returns_int=no ;;
724     *)      # Can't figure it out, punt the function.
725             ac_cv_func_gmtime_r=no ;;
726   esac])
727  if test "$ac_cv_func_gmtime_r" = no; then
728    AC_MSG_RESULT(unknown -- ignoring gmtime_r)
729  else
730    AC_MSG_RESULT($krb5_cv_gmtime_r_returns_int)
731    if test "$krb5_cv_gmtime_r_returns_int" = yes; then
732      AC_DEFINE(GMTIME_R_RETURNS_INT,1,[Define if gmtime_r returns int instead of struct tm pointer, as on old HP-UX systems.])
733    fi
734  fi
735fi
736
737AC_CHECK_FUNC(getservbyname_r,[
738ac_cv_func_getservbyname_r=yes
739if test "$ac_cv_func_getservbyname_r" = yes; then
740  AC_MSG_CHECKING([if getservbyname_r returns an int])
741  AC_CACHE_VAL(krb5_cv_getservbyname_r_returns_int,
742  [AC_COMPILE_IFELSE(
743    [AC_LANG_SOURCE(
744      [[#include <netdb.h>
745        extern int getservbyname_r();]])],
746    [krb5_cv_getservbyname_r_returns_int=yes],
747    [krb5_cv_getservbyname_r_returns_int=no])])
748  AC_MSG_RESULT($krb5_cv_getservbyname_r_returns_int)
749
750  AC_MSG_CHECKING([if getservbyname_r returns a pointer])
751  AC_CACHE_VAL(krb5_cv_getservbyname_r_returns_ptr,
752  [AC_COMPILE_IFELSE(
753    [AC_LANG_SOURCE(
754      [[#include <netdb.h>
755        extern struct servent *getservbyname_r();]])],
756    [krb5_cv_getservbyname_r_returns_ptr=yes],
757    [krb5_cv_getservbyname_r_returns_ptr=no])])
758  AC_MSG_RESULT($krb5_cv_getservbyname_r_returns_ptr)
759
760  if test "$krb5_cv_getservbyname_r_returns_int" = "$krb5_cv_getservbyname_r_returns_ptr"; then
761    AC_MSG_WARN(cannot determine return type of getservbyname_r -- disabling)
762    ac_cv_func_getservbyname_r=no
763  fi
764  if test "$krb5_cv_getservbyname_r_returns_int" = yes; then
765    AC_DEFINE(GETSERVBYNAME_R_RETURNS_INT, 1, [Define if getservbyname_r returns int rather than struct servent * ])
766  fi
767fi
768if test "$ac_cv_func_getservbyname_r" = yes; then
769  AC_DEFINE(HAVE_GETSERVBYNAME_R, 1, [Define if getservbyname_r exists and its return type is known])
770  AC_CHECK_FUNC(getservbyport_r)
771fi
772])
773
774CHECK_DIRENT
775AC_TYPE_UID_T
776
777AC_CHECK_HEADER(termios.h,
778[AC_CHECK_FUNC([tcsetattr],
779  AC_DEFINE(POSIX_TERMIOS,1,[Define if termios.h exists and tcsetattr exists]))])
780
781AC_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)
782
783# If compiling with IPv6 support, test if in6addr_any functions.
784# Irix 6.5.16 defines it, but lacks support in the C library.
785if test $krb5_cv_inet6 = yes || test "$krb5_cv_inet6_with_dinet6" = yes ; then
786  AC_CACHE_CHECK([for in6addr_any definition in library],
787  [krb5_cv_var_in6addr_any],
788  [AC_LINK_IFELSE(
789    [AC_LANG_PROGRAM(
790      [[#ifdef HAVE_SYS_TYPES_H
791        #include <sys/types.h>
792        #endif
793        #include <sys/socket.h>
794        #include <netinet/in.h>
795        #include <netdb.h>
796        #include <stdio.h>
797      ]],
798      [[struct sockaddr_in6 in;
799        in.sin6_addr = in6addr_any;
800        printf("%x", &in);]])],
801    [krb5_cv_var_in6addr_any=yes], [krb5_cv_var_in6addr_any=no])])
802  if test $krb5_cv_var_in6addr_any = no; then
803    AC_DEFINE(NEED_INSIXADDR_ANY,1,[Define if in6addr_any is not defined in libc])
804  fi
805fi
806
807# then from osconf.h, we have
808
809AC_CHECK_TYPE(time_t, long)
810AC_CHECK_SIZEOF(time_t)
811SIZEOF_TIME_T=$ac_cv_sizeof_time_t
812AC_SUBST(SIZEOF_TIME_T)
813
814# Determine where to put the replay cache.
815
816AC_MSG_CHECKING([for replay cache directory])
817AC_CACHE_VAL(krb5_cv_sys_rcdir,
818[
819if test $cross_compiling = yes; then
820	krb5_cv_sys_rcdir=/var/tmp
821else
822	for t_dir in /var/tmp /usr/tmp /var/usr/tmp /tmp ; do
823		test -d $t_dir || continue
824		krb5_cv_sys_rcdir=$t_dir
825		break
826	done
827fi])
828AC_MSG_RESULT($krb5_cv_sys_rcdir)
829KRB5_RCTMPDIR=$krb5_cv_sys_rcdir
830AC_SUBST(KRB5_RCTMPDIR)
831
832
833AC_MSG_CHECKING(for socklen_t)
834AC_CACHE_VAL(krb5_cv_has_type_socklen_t,
835[AC_COMPILE_IFELSE(
836  [AC_LANG_PROGRAM(
837    [[#include <sys/types.h>
838      #include <sys/socket.h>
839    ]],
840    [[sizeof(socklen_t);]])],
841  [krb5_cv_has_type_socklen_t=yes], [krb5_cv_has_type_socklen_t=no])])
842AC_MSG_RESULT($krb5_cv_has_type_socklen_t)
843if test $krb5_cv_has_type_socklen_t = yes; then
844    AC_DEFINE(HAVE_SOCKLEN_T,1,[Define if there is a socklen_t type. If not, probably use size_t])
845fi
846
847AC_MSG_CHECKING(for struct lifconf)
848AC_CACHE_VAL(krb5_cv_has_struct_lifconf,
849[AC_COMPILE_IFELSE(
850  [AC_LANG_PROGRAM(
851    [[#include <sys/socket.h>
852      #include <net/if.h>
853    ]],
854    [[sizeof (struct lifconf);]])],
855  [krb5_cv_has_struct_lifconf=yes], [krb5_cv_has_struct_lifconf=no])])
856AC_MSG_RESULT($krb5_cv_has_struct_lifconf)
857if test $krb5_cv_has_struct_lifconf = yes; then
858    AC_DEFINE(HAVE_STRUCT_LIFCONF,1,[Define if there is a struct lifconf.])
859fi
860# HP-UX 11 uses stuct if_laddrconf
861AC_MSG_CHECKING(for struct if_laddrconf)
862AC_CACHE_VAL(krb5_cv_has_struct_if_laddrconf,
863[AC_COMPILE_IFELSE(
864  [AC_LANG_PROGRAM(
865    [[#include <sys/socket.h>
866      #include <net/if.h>
867      #include <net/if6.h>
868    ]],
869    [[sizeof(struct if_laddrconf);]])],
870  [krb5_cv_has_struct_if_laddrconf=yes],
871  [krb5_cv_has_struct_if_laddrconf=no])])
872AC_MSG_RESULT($krb5_cv_has_struct_if_laddrconf)
873if test $krb5_cv_has_struct_if_laddrconf = yes; then
874    AC_DEFINE(HAVE_STRUCT_IF_LADDRCONF,1,[Define if there is a struct if_laddrconf.])
875fi
876
877
878AC_MSG_CHECKING([for h_errno in netdb.h])
879AC_CACHE_VAL(krb5_cv_header_netdb_h_h_errno,
880[AC_COMPILE_IFELSE(
881  [AC_LANG_PROGRAM(
882    [[#include <netdb.h>]],
883    [[int x = h_errno;]])],
884    [krb5_cv_header_netdb_h_h_errno=yes],
885    [krb5_cv_header_netdb_h_h_errno=no])])
886AC_MSG_RESULT($krb5_cv_header_netdb_h_h_errno)
887if test $krb5_cv_header_netdb_h_h_errno = yes; then
888    AC_DEFINE([HAVE_NETDB_H_H_ERRNO], 1,
889	[Define if netdb.h declares h_errno])
890fi
891
892
893AC_ARG_ENABLE([athena],
894[  --enable-athena         build with MIT Project Athena configuration],
895AC_DEFINE(KRB5_ATHENA_COMPAT,1,[Define if MIT Project Athena default configuration should be used]),)
896
897
898AC_C_INLINE
899AH_TOP([
900#ifndef KRB5_AUTOCONF_H
901#define KRB5_AUTOCONF_H
902])
903AH_BOTTOM([
904#if defined(__GNUC__) && !defined(inline)
905/* Silence gcc pedantic warnings about ANSI C.  */
906# define inline __inline__
907#endif
908#endif /* KRB5_AUTOCONF_H */
909])
910
911AC_CHECK_TYPES([struct cmsghdr, struct in_pktinfo, struct in6_pktinfo, struct sockaddr_storage], , , [
912#include <sys/types.h>
913#include <sys/socket.h>
914#include <netinet/in.h>
915])
916AC_CHECK_TYPES([struct rt_msghdr], , , [
917#include <sys/socket.h>
918#include <net/if.h>
919#include <net/route.h>
920])
921
922# Tests for 64-bit edwards25519 code.
923AC_CHECK_SIZEOF([size_t])
924AC_CHECK_TYPES([__int128_t, __uint128_t])
925
926# types libdb2 wants
927
928AC_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])
929
930# Some libdb2 test programs want a shell that supports functions.
931FCTSH=false
932AC_PATH_PROG(SH,sh,false)
933AC_PATH_PROG(SH5,sh5,false)
934AC_PATH_PROG(BASH,bash,false)
935for prog in $SH $SH5 $BASH; do
936  AC_MSG_CHECKING(if $prog supports functions)
937  if $prog -c 'foo() { true; }; foo' >/dev/null 2>&1; then
938    AC_MSG_RESULT(yes)
939    FCTSH=$prog
940    break
941  else
942    AC_MSG_RESULT(no)
943  fi
944done
945AC_SUBST(FCTSH)
946
947# Test for POSIX 2001 *printf support (X/Open System Interfaces extension
948# to ANSI/ISO C 1999 specification).  Specifically, positional
949# specifications; not checking for other features like %zx at present.
950AC_MSG_CHECKING(for POSIX printf positional specification support)
951AC_CACHE_VAL(ac_cv_printf_positional,
952[AC_RUN_IFELSE(
953  [AC_LANG_SOURCE(
954    [[#include <stdio.h>
955      #include <string.h>
956      const char expected[] = "200 100";
957      int main()
958      {
959          char buf[30];
960          sprintf(buf, "%2\$x %1\$d", 100, 512);
961          if (strcmp(expected, buf)) {
962              fprintf(stderr, "bad result: <%s> wanted: <%s>\n",
963                      buf, expected);
964              return 1;
965          }
966          return 0;
967      }]])],
968  [ac_cv_printf_positional=yes], [ac_cv_printf_positional=no],
969  [AC_MSG_ERROR(Cannot test for printf positional argument support when cross compiling)])])
970# Nothing for autoconf.h for now.
971AC_MSG_RESULT($ac_cv_printf_positional)
972
973
974# for t_locate_kdc test
975
976AC_PATH_PROG(DIG, dig, false)
977AC_PATH_PROG(NSLOOKUP, nslookup, false)
978
979# for kadmin
980
981AC_PROG_YACC
982ath_compat=
983AC_ARG_ENABLE([athena],
984[  --enable-athena         build with MIT Project Athena configuration],
985ath_compat=compat,)
986
987KRB5_AC_PRIOCNTL_HACK
988
989AC_CHECK_PROG(PERL,perl,perl)
990
991# lib/gssapi
992AC_CHECK_HEADER(xom.h,[
993	include_xom='awk '\''END{printf("%cinclude <xom.h>\n", 35);}'\'' < /dev/null'], [
994	include_xom='echo "/* no xom.h */"'])
995AC_SUBST(include_xom)
996
997
998# lib/rpc
999### Check where struct rpcent is declared.
1000
1001# This is necessary to determine:
1002# 1. If /usr/include/netdb.h declares struct rpcent
1003# 2. If /usr/include/rpc/netdb.h declares struct rpcent
1004
1005# We have our own rpc/netdb.h, and if /usr/include/netdb.h includes
1006# rpc/netdb.h, then nastiness could happen.
1007
1008# Logic: If /usr/include/netdb.h declares struct rpcent, then check
1009# rpc/netdb.h.  If /usr/include/rpc/netdb.h declares struct rpcent,
1010# then define STRUCT_RPCENT_IN_RPC_NETDB_H, otherwise do not.  If
1011# neither netdb.h nor rpc/netdb.h declares struct rpcent, then define
1012# STRUCT_RPCENT_IN_RPC_NETDB_H anyway.
1013
1014AC_MSG_CHECKING([where struct rpcent is declared])
1015AC_COMPILE_IFELSE(
1016  [AC_LANG_PROGRAM(
1017    [[#include <netdb.h>
1018    ]],
1019    [[struct rpcent e;
1020      char c = e.r_name[0];
1021      int i = e.r_number;]])],
1022    [netdb_rpcent=yes], [netdb_rpcent=no])
1023if test "$netdb_rpcent" = yes; then
1024  AC_COMPILE_IFELSE(
1025    [AC_LANG_PROGRAM(
1026      [[#include <rpc/netdb.h>
1027      ]],
1028      [[struct rpcent e;
1029        char c = e.r_name[0];
1030        int i = e.r_number;]])],
1031    [rpc_netdb_rpcent=yes], [rpc_netdb_rpcent=no])
1032  if test "$rpc_netdb_rpcent" = yes; then
1033    AC_MSG_RESULT([rpc/netdb.h])
1034    rpcent_define='#define STRUCT_RPCENT_IN_RPC_NETDB_H'
1035  else
1036    AC_MSG_RESULT([netdb.h])
1037  fi
1038else
1039  AC_MSG_RESULT([nowhere])
1040  rpcent_define='#define STRUCT_RPCENT_IN_RPC_NETDB_H'
1041fi
1042AC_SUBST(rpcent_define)
1043
1044AC_CHECK_HEADERS(sys/select.h sys/time.h unistd.h)
1045if test $ac_cv_header_sys_select_h = yes; then
1046  GSSRPC__SYS_SELECT_H='#include <sys/select.h>'
1047else
1048  GSSRPC__SYS_SELECT_H='/* #include <sys/select.h> */'
1049fi
1050AC_SUBST(GSSRPC__SYS_SELECT_H)
1051if test $ac_cv_header_sys_time_h = yes; then
1052  GSSRPC__SYS_TIME_H='#include <sys/time.h>'
1053else
1054  GSSRPC__SYS_TIME_H='/* #include <sys/time.h> */'
1055fi
1056AC_SUBST(GSSRPC__SYS_TIME_H)
1057if test $ac_cv_header_unistd_h = yes; then
1058  GSSRPC__UNISTD_H='#include <unistd.h>'
1059else
1060  GSSRPC__UNISTD_H='/* #include <unistd.h> */'
1061fi
1062AC_SUBST(GSSRPC__UNISTD_H)
1063
1064AC_CACHE_CHECK([for MAXHOSTNAMELEN in sys/param.h],
1065[krb5_cv_header_sys_param_h_maxhostnamelen],
1066[AC_COMPILE_IFELSE(
1067  [AC_LANG_PROGRAM(
1068    [[#include <sys/param.h>
1069    ]],
1070    [[int i = MAXHOSTNAMELEN;]])],
1071    [krb5_cv_header_sys_param_h_maxhostnamelen=yes],
1072    [krb5_cv_header_sys_param_h_maxhostnamelen=no])])
1073AC_CACHE_CHECK([for MAXHOSTNAMELEN in netdb.h],
1074[krb5_cv_header_netdb_h_maxhostnamelen],
1075[AC_COMPILE_IFELSE(
1076  [AC_LANG_PROGRAM(
1077    [[#include <netdb.h>
1078    ]],
1079    [[int i = MAXHOSTNAMELEN;]])],
1080    [krb5_cv_header_netdb_h_maxhostnamelen=yes],
1081    [krb5_cv_header_netdb_h_maxhostnamelen=no])])
1082
1083GSSRPC__SYS_PARAM_H='/* #include <sys/param.h> */'
1084GSSRPC__NETDB_H='/* #include <netdb.h> */'
1085if test $krb5_cv_header_sys_param_h_maxhostnamelen = yes; then
1086  GSSRPC__SYS_PARAM_H='#include <sys/param.h>'
1087else
1088  if test $krb5_cv_header_netdb_h_maxhostnamelen = yes; then
1089    GSSRPC__NETDB_H='#include <netdb.h>'
1090  else
1091    AC_MSG_WARN([can't find MAXHOSTNAMELEN definition; faking it])
1092  fi
1093fi
1094AC_SUBST(GSSRPC__SYS_PARAM_H)
1095AC_SUBST(GSSRPC__NETDB_H)
1096
1097AC_CACHE_CHECK([for BSD type aliases], [krb5_cv_type_bsdaliases],
1098[AC_COMPILE_IFELSE(
1099  [AC_LANG_PROGRAM(
1100    [[#include <sys/types.h>
1101      #if HAVE_UNISTD_H
1102      #include <unistd.h>
1103      #endif
1104    ]],
1105    [[u_char c;
1106      u_int i;
1107      u_long l;]])],
1108  [krb5_cv_type_bsdaliases=yes], [krb5_cv_type_bsdaliases=no])])
1109if test $krb5_cv_type_bsdaliases = yes; then
1110  GSSRPC__BSD_TYPEALIASES='/* #undef GSSRPC__BSD_TYPEALIASES */'
1111else
1112  GSSRPC__BSD_TYPEALIASES='#define GSSRPC__BSD_TYPEALIASES 1'
1113fi
1114AC_SUBST(GSSRPC__BSD_TYPEALIASES)
1115
1116AC_MSG_CHECKING([return type of setrpcent])
1117AC_CACHE_VAL(k5_cv_type_setrpcent,
1118[AC_COMPILE_IFELSE(
1119  [AC_LANG_SOURCE(
1120    [[#include <netdb.h>
1121      extern void setrpcent();]])],
1122  [k5_cv_type_setrpcent=void], [k5_cv_type_setrpcent=int])])
1123AC_MSG_RESULT($k5_cv_type_setrpcent)
1124AC_DEFINE_UNQUOTED(SETRPCENT_TYPE, $k5_cv_type_setrpcent, [Define as return type of setrpcent])
1125
1126AC_MSG_CHECKING([return type of endrpcent])
1127AC_CACHE_VAL(k5_cv_type_endrpcent,
1128[AC_COMPILE_IFELSE(
1129  [AC_LANG_SOURCE(
1130    [[#include <netdb.h>
1131      extern void endrpcent();]])],
1132  [k5_cv_type_endrpcent=void], [k5_cv_type_endrpcent=int])])
1133AC_MSG_RESULT($k5_cv_type_endrpcent)
1134AC_DEFINE_UNQUOTED(ENDRPCENT_TYPE, $k5_cv_type_endrpcent, [Define as return type of endrpcent])
1135K5_GEN_FILE(include/gssrpc/types.h:include/gssrpc/types.hin)
1136
1137# for pkinit
1138AC_ARG_ENABLE([pkinit],
1139[  --disable-pkinit        disable PKINIT plugin support],,
1140enable_pkinit=try)
1141if test "$enable_pkinit" = yes || test "$enable_pkinit" = try; then
1142  AC_CACHE_CHECK(for a recent enough OpenSSL, k5_cv_openssl_version_okay,
1143[AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <openssl/opensslv.h>
1144#if OPENSSL_VERSION_NUMBER < 0x10000000L
1145# error openssl is too old, need 1.0.0
1146#endif
1147int i = 1;
1148])], k5_cv_openssl_version_okay=yes, k5_cv_openssl_version_okay=no)])
1149  old_LIBS="$LIBS"
1150  AC_CHECK_LIB(crypto, PKCS7_get_signer_info)
1151  AC_CHECK_FUNCS(EVP_PKEY_get_bn_param)
1152  LIBS="$old_LIBS"
1153fi
1154if test "$k5_cv_openssl_version_okay" = yes && (test "$enable_pkinit" = yes || test "$enable_pkinit" = try); then
1155  K5_GEN_MAKEFILE(plugins/preauth/pkinit)
1156  PKINIT=yes
1157elif test "$k5_cv_openssl_version_okay" = no && test "$enable_pkinit" = yes; then
1158  AC_MSG_ERROR([Version of OpenSSL is too old; cannot enable PKINIT.])
1159else
1160  AC_DEFINE([DISABLE_PKINIT], 1, [Define to disable PKINIT plugin support])
1161  AC_MSG_NOTICE([Disabling PKINIT support.])
1162  PKINIT=no
1163fi
1164AC_SUBST(PKINIT)
1165
1166# for lib/apputils
1167AC_REPLACE_FUNCS(daemon)
1168
1169# For Python tests.  Python version 3.4 is required for
1170# ssl.create_default_context().
1171PYTHON_MINVERSION=3.4
1172AC_SUBST(PYTHON_MINVERSION)
1173AC_CHECK_PROG(PYTHON,python3,python3)
1174if test x"$PYTHON" = x; then
1175	AC_CHECK_PROG(PYTHON,python,python)
1176fi
1177HAVE_PYTHON=no
1178if test x"$PYTHON" != x; then
1179	wantver="(sys.hexversion >= 0x30400F0)"
1180	if "$PYTHON" -c "import sys; sys.exit(not $wantver and 1 or 0)"; then
1181		HAVE_PYTHON=yes
1182	fi
1183fi
1184AC_SUBST(HAVE_PYTHON)
1185
1186# For cmocka tests.
1187CMOCKA_LIBS=
1188HAVE_CMOCKA=no
1189HAVE_CMOCKA_H=no
1190HAVE_CMOCKA_LIB=no
1191AC_CHECK_HEADER(cmocka.h, [HAVE_CMOCKA_H=yes], :, [
1192#include <stdarg.h>
1193#include <stddef.h>
1194#include <setjmp.h> ])
1195AC_CHECK_LIB(cmocka, _cmocka_run_group_tests, [HAVE_CMOCKA_LIB=yes])
1196if test "$HAVE_CMOCKA_LIB" = yes && test "$HAVE_CMOCKA_H" = yes; then
1197    HAVE_CMOCKA=yes
1198    CMOCKA_LIBS='-lcmocka'
1199    AC_DEFINE([HAVE_CMOCKA],1,[Define if cmocka library is available.])
1200fi
1201AC_SUBST(HAVE_CMOCKA)
1202AC_SUBST(CMOCKA_LIBS)
1203
1204# For URI lookup tests. Requires resolv_wrapper >= 1.1.5 for URI
1205# support.
1206HAVE_RESOLV_WRAPPER=0
1207PKG_CHECK_EXISTS([resolv_wrapper >= 1.1.5], [HAVE_RESOLV_WRAPPER=1])
1208AC_SUBST(HAVE_RESOLV_WRAPPER)
1209
1210# for plugins/kdb/db2
1211
1212# AIX is unusual in that it wants all symbols resolved at link time
1213#  Fortunately, it will allow us to link the kdb library now, even if
1214# it is linked again later.
1215case $krb5_cv_host in
1216*-*-aix*)
1217	DB_EXTRA_LIBS=-ldb
1218	;;
1219*)
1220	DB_EXTRA_LIBS=
1221	;;
1222esac
1223AC_SUBST(DB_EXTRA_LIBS)
1224
1225
1226
1227# Warn about possible thread safety issues.  These functions have all
1228# been checked for previously.
1229tsfuncs="getpwnam_r getpwuid_r gethostbyname_r getservbyname_r gmtime_r localtime_r"
1230if test "$enable_thread_support" = yes; then
1231  tsmissing=""
1232  for ts in $tsfuncs; do
1233    if eval "test \"\${ac_cv_func_$ts}\" != yes"; then
1234      tsmissing="$tsmissing $ts"
1235    fi
1236  done
1237  if test "$ac_cv_func_res_nsearch/$ac_cv_lib_resolv_res_nsearch" = "no/no"; then
1238    tsmissing="$tsmissing res_nsearch"
1239  fi
1240  if test "$tsmissing" != ""; then
1241    AC_MSG_WARN([Some functions that are needed for library thread])
1242    AC_MSG_WARN([safety appear to be missing.])
1243    for ts in $tsmissing; do
1244      AC_MSG_WARN([  missing thread-safe function: $ts])
1245    done
1246    AC_MSG_WARN([Without these functions, the installed libraries])
1247    AC_MSG_WARN([may not be thread-safe.])
1248  fi # tsmissing not empty
1249fi # enable_thread_support
1250
1251# Sadly, we seem to have accidentally committed ourselves in 1.4 to
1252# an ABI that includes the existence of libkrb5support.0 even
1253# though random apps should never use anything from it.  And on
1254# the Mac, to which that didn't apply, we can't use major version 0.
1255
1256case $krb5_cv_host in
1257*-*-darwin* | *-*-rhapsody*) SUPPORTLIB_MAJOR=1 ;;
1258*)			     SUPPORTLIB_MAJOR=0 ;;
1259esac
1260AC_SUBST(SUPPORTLIB_MAJOR)
1261
1262
1263if test "$COM_ERR_VERSION" = k5 ; then
1264  K5_GEN_MAKEFILE(util/et)
1265fi
1266if test "$SS_VERSION" = k5 ; then
1267  K5_GEN_MAKEFILE(util/ss)
1268fi
1269
1270
1271ldap_plugin_dir=""
1272ldap_lib=""
1273if test -n "$OPENLDAP_PLUGIN"; then
1274  AC_CHECK_HEADERS(ldap.h lber.h, :, [AC_MSG_ERROR($ac_header not found)])
1275  AC_CHECK_LIB(ldap, ldap_str2dn, :, [AC_MSG_ERROR(libldap not found or missing ldap_str2dn)])
1276
1277  BER_OKAY=0
1278  AC_CHECK_LIB(ldap, ber_init, [BER_OKAY=1])
1279  if test "$BER_OKAY" = "1"; then
1280    LDAP_LIBS='-lldap'
1281  else
1282    AC_CHECK_LIB(lber, ber_init, [BER_OKAY=1], [AC_MSG_WARN([libber not found])])
1283    if test "$BER_OKAY" = "1"; then
1284      LDAP_LIBS='-lldap -llber'
1285    else
1286      AC_MSG_ERROR("BER library missing - cannot build LDAP database module")
1287    fi
1288  fi
1289  AC_DEFINE([ENABLE_LDAP], 1, [Define if LDAP KDB support within the Kerberos library (mainly ASN.1 code) should be enabled.])
1290  AC_SUBST(LDAP_LIBS)
1291
1292  AC_CHECK_HEADERS([sasl/sasl.h], [HAVE_SASL=yes], [HAVE_SASL=no])
1293  AC_SUBST(HAVE_SASL)
1294  if test "$HAVE_SASL" = no; then
1295    AC_MSG_WARN([not building LDAP SASL support])
1296  fi
1297
1298  K5_GEN_MAKEFILE(plugins/kdb/ldap)
1299  K5_GEN_MAKEFILE(plugins/kdb/ldap/ldap_util)
1300  K5_GEN_MAKEFILE(plugins/kdb/ldap/libkdb_ldap)
1301  ldap_plugin_dir='plugins/kdb/ldap plugins/kdb/ldap/ldap_util'
1302  LDAP=yes
1303else
1304  LDAP=no
1305fi
1306AC_SUBST(ldap_plugin_dir)
1307AC_SUBST(LDAP)
1308# This check is for plugins/preauth/securid_sam2
1309sam2_plugin=""
1310old_CFLAGS=$CFLAGS
1311CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
1312AC_CHECK_LIB(aceclnt, SD_Init, [
1313	     AC_MSG_NOTICE([Enabling RSA securID support])
1314	     K5_GEN_MAKEFILE(plugins/preauth/securid_sam2)
1315	     sam2_plugin=plugins/preauth/securid_sam2
1316	     ])
1317AC_SUBST(sam2_plugin)
1318CFLAGS=$old_CFLAGS
1319
1320lmdb_plugin_dir=""
1321HAVE_LMDB=no
1322AC_ARG_WITH([lmdb],
1323  [AS_HELP_STRING([--with-lmdb],
1324    [compile LMDB database backend module @<:@auto@:>@])],
1325  [], [withval=auto])
1326if test "$withval" = auto -o "$withval" = yes; then
1327  AC_CHECK_LIB([lmdb],[mdb_env_create],[have_lmdb=true],[have_lmdb=false])
1328  if test "$have_lmdb" = true; then
1329    LMDB_LIBS=-llmdb
1330    HAVE_LMDB=yes
1331    lmdb_plugin_dir='plugins/kdb/lmdb'
1332    K5_GEN_MAKEFILE(plugins/kdb/lmdb)
1333  elif test "$withval" = yes; then
1334    AC_MSG_ERROR([liblmdb not found])
1335  fi
1336fi
1337AC_SUBST(HAVE_LMDB)
1338AC_SUBST(LMDB_LIBS)
1339AC_SUBST(lmdb_plugin_dir)
1340
1341# Kludge for simple server --- FIXME is this the best way to do this?
1342
1343if test "$ac_cv_lib_socket" = "yes" -a "$ac_cv_lib_nsl" = "yes"; then
1344	AC_DEFINE(BROKEN_STREAMS_SOCKETS,1,[Define if socket can't be bound to 0.0.0.0])
1345fi
1346
1347# Compile with libedit support in ss by default if available.  Compile
1348# with readline only if asked, to avoid a default GPL dependency.
1349AC_ARG_WITH([libedit],
1350  [AS_HELP_STRING([--without-libedit], [do not compile with libedit])],
1351  [], [with_libedit=default])
1352AC_ARG_WITH([readline],
1353  [AS_HELP_STRING([--with-readline], [compile with GNU Readline])],
1354  [], [with_readline=no])
1355if test "x$with_readline" = xyes; then
1356  with_libedit=no
1357fi
1358RL_CFLAGS=
1359RL_LIBS=
1360if test "x$with_libedit" != xno; then
1361  PKG_CHECK_MODULES(LIBEDIT, libedit, [have_libedit=yes], [have_libedit=no])
1362  if test "x$have_libedit" = xyes; then
1363    RL_CFLAGS=$LIBEDIT_CFLAGS
1364    RL_LIBS=$LIBEDIT_LIBS
1365    AC_DEFINE([HAVE_LIBEDIT], 1, [Define if building with libedit.])
1366    AC_MSG_NOTICE([Using libedit for readline support])
1367  elif test "x$with_libedit" = xyes; then
1368    # We were explicitly asked for libedit and couldn't find it.
1369    AC_MSG_ERROR([Could not detect libedit with pkg-config])
1370  else
1371    AC_MSG_NOTICE([Not using any readline support])
1372  fi
1373elif test "x$with_readline" = xyes; then
1374  AC_MSG_NOTICE([Using GNU Readline])
1375  AC_CHECK_LIB([readline], [main], :,
1376	       AC_MSG_FAILURE([Cannot find readline library.]))
1377  AC_DEFINE([HAVE_READLINE], 1, [Define if building with GNU Readline.])
1378  RL_LIBS='-lreadline'
1379else
1380  AC_MSG_RESULT([Not using any readline support])
1381fi
1382AC_SUBST([RL_CFLAGS])
1383AC_SUBST([RL_LIBS])
1384
1385AC_ARG_WITH([system-verto],
1386  [AS_HELP_STRING([--with-system-verto], [always use system verto library])],
1387  [], [with_system_verto=default])
1388VERTO_VERSION=k5
1389if test "x$with_system_verto" != xno; then
1390  PKG_CHECK_MODULES(VERTO, libverto, [have_sysverto=yes], [have_sysverto=no])
1391  if test "x$have_sysverto" = xyes; then
1392    VERTO_VERSION=sys
1393  elif test "x$with_system_verto" = xyes; then
1394    AC_MSG_ERROR([cannot detect system libverto])
1395  fi
1396fi
1397if test "x$VERTO_VERSION" = xsys; then
1398  AC_MSG_NOTICE([Using system libverto])
1399else
1400  VERTO_CFLAGS=
1401  VERTO_LIBS="-lverto"
1402  AC_MSG_NOTICE([Using built-in libverto])
1403fi
1404AC_SUBST([VERTO_CFLAGS])
1405AC_SUBST([VERTO_LIBS])
1406AC_SUBST([VERTO_VERSION])
1407
1408AC_PATH_PROG(GROFF, groff)
1409
1410# Make localedir work in autoconf 2.5x.
1411if test "${localedir+set}" != set; then
1412    localedir='$(datadir)/locale'
1413fi
1414AC_SUBST(localedir)
1415
1416# Determine the default macOS ccache type and whether to build the KCM
1417# Mach RPC support.
1418MACOS_FRAMEWORK=
1419dnl The outer brackets around the case statement prevent m4 from
1420dnl eating the brackets in the glob patterns, but also prevent us from
1421dnl using AC_DEFINE within the body.
1422[case $host in
1423*-*-darwin[0-9].* | *-*-darwin10.*)
1424  # Use the normal default cache type for macOS 10.6 (Darwin 10) and
1425  # prior.  Build the KCM Mach RPC support.
1426  OSX=osx
1427  ;;
1428*-*-darwin*)
1429  # macOS 10.6 (Darwin 11) uses the KCM type by default.  macOS 11
1430  # (Darwin 20) uses an xpc-based cache type called XCACHE by default.
1431  # We can access either of these collections via a macos-specific
1432  # implementation of the API cache type.  Build the KCM Mach RPC
1433  # support.
1434  OSX=osx
1435  macos_defccname=API:
1436  MACOS_FRAMEWORK="-framework Kerberos"
1437  ;;
1438*)
1439  # This is not macOS; do not build the Mach RPC support and use the
1440  # normal default cache type.
1441  OSX=no
1442  ;;
1443esac]
1444if test "$macos_defccname" = API:; then
1445  AC_DEFINE(USE_CCAPI_MACOS, 1, [Define to build macOS CCAPI client])
1446fi
1447AC_SUBST(OSX)
1448AC_SUBST(MACOS_FRAMEWORK)
1449
1450# Build-time default ccache, keytab, and client keytab names.  These
1451# can be given as variable arguments DEFCCNAME, DEFKTNAME, and
1452# DEFCKTNAME.  Otherwise, we try to get the OS defaults from
1453# krb5-config if we can, or fall back to hardcoded defaults.
1454AC_ARG_VAR(DEFCCNAME, [Default ccache name])
1455AC_ARG_VAR(DEFKTNAME, [Default keytab name])
1456AC_ARG_VAR(DEFCKTNAME, [Default client keytab name])
1457AC_ARG_WITH([krb5-config],
1458  [AS_HELP_STRING([--with-krb5-config=PATH],
1459    [path to existing krb5-config program for defaults])],
1460  [], [with_krb5_config=krb5-config])
1461if test "x$with_krb5_config" != xno; then
1462	if test "x$with_krb5_config" = xyes; then
1463		with_krb5_config=krb5-config
1464	fi
1465	if $with_krb5_config --help 2>&1 | grep defccname >/dev/null; then
1466		AC_MSG_NOTICE([Using $with_krb5_config for build defaults])
1467		: "${DEFCCNAME=`$with_krb5_config --defccname`}"
1468		: "${DEFKTNAME=`$with_krb5_config --defktname`}"
1469		: "${DEFCKTNAME=`$with_krb5_config --defcktname`}"
1470	fi
1471fi
1472if test "${DEFCCNAME+set}" != set; then
1473	if test "${macos_defccname+set}" = set; then
1474		DEFCCNAME=$macos_defccname
1475	else
1476		DEFCCNAME=FILE:/tmp/krb5cc_%{uid}
1477	fi
1478fi
1479if test "${DEFKTNAME+set}" != set; then
1480	DEFKTNAME=FILE:/etc/krb5.keytab
1481fi
1482if test "${DEFCKTNAME+set}" != set; then
1483	AX_RECURSIVE_EVAL($localstatedir, exp_localstatedir)
1484	DEFCKTNAME=FILE:$exp_localstatedir/krb5/user/%{euid}/client.keytab
1485fi
1486AC_MSG_NOTICE([Default ccache name: $DEFCCNAME])
1487AC_MSG_NOTICE([Default keytab name: $DEFKTNAME])
1488AC_MSG_NOTICE([Default client keytab name: $DEFCKTNAME])
1489AC_DEFINE_UNQUOTED(DEFCCNAME, ["$DEFCCNAME"], [Define to default ccache name])
1490AC_DEFINE_UNQUOTED(DEFKTNAME, ["$DEFKTNAME"], [Define to default keytab name])
1491AC_DEFINE_UNQUOTED(DEFCKTNAME, ["$DEFCKTNAME"],
1492                   [Define to default client keytab name])
1493
1494AC_ARG_VAR(PKCS11_MODNAME, [Default PKCS11 module name])
1495if test "${PKCS11_MODNAME+set}" != set; then
1496	PKCS11_MODNAME=opensc-pkcs11.so
1497fi
1498AC_MSG_NOTICE([Default PKCS11 module name: $PKCS11_MODNAME])
1499AC_DEFINE_UNQUOTED(PKCS11_MODNAME, ["$PKCS11_MODNAME"],
1500                   [Default PKCS11 module name])
1501
1502AC_CONFIG_FILES([build-tools/krb5-config], [chmod +x build-tools/krb5-config])
1503AC_CONFIG_FILES([build-tools/kadm-server.pc
1504	build-tools/kadm-client.pc
1505	build-tools/kdb.pc
1506	build-tools/krb5.pc
1507	build-tools/krb5-gssapi.pc
1508	build-tools/mit-krb5.pc
1509	build-tools/mit-krb5-gssapi.pc
1510	build-tools/gssrpc.pc
1511])
1512V5_AC_OUTPUT_MAKEFILE(.
1513
1514	util util/support util/profile util/profile/testmod
1515	util/verto
1516
1517	lib lib/kdb
1518
1519	lib/crypto lib/crypto/krb lib/crypto/crypto_tests
1520	lib/crypto/builtin lib/crypto/builtin/des
1521	lib/crypto/builtin/aes lib/crypto/builtin/camellia
1522	lib/crypto/builtin/md4 lib/crypto/builtin/md5
1523	lib/crypto/builtin/sha1 lib/crypto/builtin/sha2
1524	lib/crypto/builtin/enc_provider lib/crypto/builtin/hash_provider
1525	lib/crypto/openssl lib/crypto/openssl/des
1526	lib/crypto/openssl/enc_provider lib/crypto/openssl/hash_provider
1527
1528	lib/krb5 lib/krb5/error_tables lib/krb5/asn.1 lib/krb5/ccache
1529	lib/krb5/keytab lib/krb5/krb lib/krb5/rcache lib/krb5/os
1530	lib/krb5/unicode
1531
1532	lib/gssapi lib/gssapi/generic lib/gssapi/krb5 lib/gssapi/spnego
1533	lib/gssapi/mechglue
1534
1535	lib/rpc lib/rpc/unit-test
1536
1537	lib/kadm5 lib/kadm5/clnt lib/kadm5/srv
1538	lib/krad
1539	lib/apputils
1540
1541	kdc kprop config-files build-tools man doc include
1542
1543	plugins/certauth/test
1544	plugins/gssapi/negoextest
1545	plugins/hostrealm/test
1546	plugins/localauth/test
1547	plugins/kadm5_hook/test
1548	plugins/kadm5_auth/test
1549	plugins/pwqual/test
1550	plugins/audit
1551	plugins/audit/test
1552	plugins/kdb/db2
1553	plugins/kdb/db2/libdb2
1554	plugins/kdb/db2/libdb2/hash
1555	plugins/kdb/db2/libdb2/btree
1556	plugins/kdb/db2/libdb2/db
1557	plugins/kdb/db2/libdb2/mpool
1558	plugins/kdb/db2/libdb2/recno
1559	plugins/kdb/db2/libdb2/test
1560	plugins/kdb/test
1561	plugins/kdcpolicy/test
1562	plugins/preauth/otp
1563	plugins/preauth/spake
1564	plugins/preauth/test
1565	plugins/authdata/greet_client
1566	plugins/authdata/greet_server
1567	plugins/tls/k5tls
1568
1569	clients clients/klist clients/kinit clients/kvno
1570	clients/kdestroy clients/kpasswd clients/ksu clients/kswitch
1571
1572	kadmin kadmin/cli kadmin/dbutil kadmin/ktutil kadmin/server
1573
1574	appl
1575	appl/sample appl/sample/sclient appl/sample/sserver
1576	appl/simple appl/simple/client appl/simple/server
1577	appl/gss-sample appl/user_user
1578
1579	tests tests/asn.1 tests/create tests/hammer tests/verify tests/gssapi
1580	tests/threads tests/shlib tests/gss-threads tests/misc
1581)
1582