1 K5_AC_INIT([aclocal.m4])
3 dnl autoconf 2.49 defaults to a /dev/null cache file, which is what we
4 dnl do not want for performance reasons.
5 if test "x$cache_file" = "x/dev/null"; then
6 cache_file=./config.cache
11 KRB5_VERSION=K5_VERSION
12 AC_SUBST(KRB5_VERSION)
17 AC_CACHE_CHECK(if va_copy is available, krb5_cv_va_copy,
24 }], krb5_cv_va_copy=yes, krb5_cv_va_copy=no)])
25 if test "$krb5_cv_va_copy" = yes; then
26 AC_DEFINE(HAS_VA_COPY,1,[Define if va_copy macro or function is available.])
29 dnl Note that this isn't checking if the copied value *works*, just
30 dnl whether the C language constraints permit the copying. If
31 dnl va_list is defined as an array type, it can't be assigned.
32 AC_CACHE_CHECK(if va_list objects can be copied by assignment,
33 krb5_cv_va_simple_copy,
39 }], krb5_cv_va_simple_copy=yes, krb5_cv_va_simple_copy=no)])
40 if test "$krb5_cv_va_simple_copy" = yes; then
41 AC_DEFINE(CAN_COPY_VA_LIST,1,[Define if va_list objects can be simply copied by assignment.])
44 dnl The following lines are so that configure --help gives some global
45 dnl configuration options.
49 AC_ARG_ENABLE([athena],
50 [ --enable-athena build with MIT Project Athena configuration],,)
52 if test -z "$KRB4_LIB"; then
66 dnl Begin autoconf tests for the Makefiles generated out of the top-level
69 AC_CHECK_FUNCS(memmove)
80 AC_CHECK_LIB(util,main,[AC_DEFINE(HAVE_LIBUTIL,1,[Define if the util library is available])
85 AC_CHECK_HEADERS(syslog.h stdarg.h sys/select.h sys/sockio.h ifaddrs.h unistd.h)
86 AC_CHECK_FUNCS(openlog syslog closelog strftime vsprintf vasprintf vsnprintf)
87 KRB5_NEED_PROTO([#include <string.h>
91 /* Solaris 8 declares swab in stdlib.h. */
100 dnl --with-vague-errors disables useful error messages.
102 AC_ARG_WITH([vague-errors],
103 AC_HELP_STRING([--with-vague-errors],[Do not @<:@do@:>@ send helpful errors to client]), , withval=no)dnl
104 if test "$withval" = yes; then
105 AC_MSG_RESULT(Supplying vague error messages to KDC clients)
106 AC_DEFINE(KRBCONF_VAGUE_ERRORS,1,[Define if the KDC should return only vague error codes to clients])
109 dnl --with-kdc-kdb-update makes the KDC update the database with last request
110 dnl information and failure information.
112 AC_ARG_WITH([kdc-kdb-update],
113 AC_HELP_STRING([--with-kdc-kdb-update],[Update the database @<:@don't update@:>@]), , withval=no)dnl
114 if test "$withval" = yes; then
115 AC_MSG_RESULT(Updating KDC database with each request)
116 AC_DEFINE(KRBCONF_KDC_MODIFIES_KDB,1,[Define if KDC should update database with each request])
119 dnl Needed for hw-preauth replay detection on KDC.
121 dnl USE_RCACHE enables the replay cache
122 dnl NOCACHE disables the lookaside cache
124 dnl The lookaside cache is checked first; if *exactly* the same message
125 dnl comes in twice, e.g., because the (legitimate) client resent it,
126 dnl the previous response will be resent. Otherwise, the replay cache
127 dnl is used to check for attempts to fake out the KDC. Some hardware
128 dnl preauth methods are weak enough that we *really* want to have this
129 dnl checking turned on.
131 AC_ARG_ENABLE([kdc-replay-cache],
132 AC_HELP_STRING([--enable-kdc-replay-cache],[check for replayed/retransmitted KDC requests (recommended when hardware preauthentication is in use) @<:@disabled@:>@]), , enableval=yes)dnl
133 if test "$enableval" = yes ; then
134 AC_DEFINE(USE_RCACHE,1,[Define if the KDC should use a replay cache])
136 AC_DEFINE(NOCACHE,1,[Define if the KDC should use no replay cache])
138 AC_ARG_ENABLE([fakeka],
139 AC_HELP_STRING([--enable-fakeka],[build the Fake KA server (emulates an AFS kaserver) @<:@default: don't build@:>@]), , enableval=no)dnl
140 if test "$enableval" = yes; then
151 dnl from old include/configure.in
152 AH_TEMPLATE([HAVE_STRUCT_SOCKADDR_STORAGE],
153 [Define if "struct sockaddr_storage" is available.])
155 AC_CONFIG_HEADER(include/autoconf.h, [: autoconf.h cmds], [: autoconf.h init cmds])
161 AC_CHECK_FUNCS(strdup setvbuf inet_ntoa inet_aton seteuid setresuid setreuid setegid setresgid setregid setsid flock fchmod chmod strftime strptime geteuid setenv unsetenv getenv gethostbyname2 getifaddrs gmtime_r localtime_r pthread_mutex_lock sched_yield bswap16 bswap64 mkstemp getusershell lstat access ftime getcwd srand48 srand srandom stat strchr strerror strerror_r strstr timezone umask waitpid sem_init sem_trywait daemon)
164 AC_CHECK_FUNC(mkstemp,
167 [MKSTEMP_ST_OBJ='mkstemp.o'
168 MKSTEMP_OBJ='$(OUTPRE)mkstemp.$(OBJEXT)'
169 EXTRA_SUPPORT_SYMS="$EXTRA_SUPPORT_SYMS krb5int_mkstemp"
170 AC_DEFINE(mkstemp,krb5int_mkstemp,[Define to krb5int_mkstemp if the OS does not provide it.])])
171 AC_SUBST(MKSTEMP_OBJ)
172 AC_SUBST(MKSTEMP_ST_OBJ)
173 AC_SUBST(EXTRA_SUPPORT_SYMS)
177 AC_CHECK_HEADERS(unistd.h paths.h regex.h regexpr.h fcntl.h memory.h ifaddrs.h sys/filio.h sched.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 pthread.h semaphore.h krb_db.h kdc.h)
178 AC_CHECK_HEADER(regexp.h, [], [],
179 [#define INIT char *sp = instring;
180 #define GETC() (*sp++)
181 #define PEEKC() (*sp)
182 #define UNGETC(c) (--sp)
183 #define RETURN(c) return(c)
186 AC_CHECK_MEMBERS([struct sockaddr_in.sin_len, struct sockaddr.sa_len], , ,
187 [#include <sys/types.h>
188 #include <netinet/in.h>])
189 AC_CHECK_MEMBERS([struct stat.st_mtimensec,struct stat.st_mtimespec.tv_nsec,struct stat.st_mtim.tv_nsec],,,[#include <sys/types.h>
190 #include <sys/stat.h>])
194 dnl Fancy caching of perror result...
195 AC_MSG_CHECKING(for perror declaration)
196 AC_CACHE_VAL(krb5_cv_decl_perror,
197 [AC_EGREP_HEADER(perror, errno.h,
198 krb5_cv_decl_perror=yes, krb5_cv_decl_perror=no)])dnl
199 AC_MSG_RESULT($krb5_cv_decl_perror)
200 if test $krb5_cv_decl_perror = yes; then
201 AC_DEFINE(HDR_HAS_PERROR,1,[Define if errno.h declares perror])
204 KRB5_NEED_PROTO([#include <time.h>],strptime)
210 dnl *rpcent return types needed for lib/rpc
212 AC_MSG_CHECKING([return type of setrpcent])
213 AC_CACHE_VAL(k5_cv_type_setrpcent,
214 [AC_TRY_COMPILE([#include <netdb.h>
218 extern void setrpcent();],
219 [int i;], k5_cv_type_setrpcent=void, k5_cv_type_setrpcent=int)])dnl
220 AC_MSG_RESULT($k5_cv_type_setrpcent)
221 AC_DEFINE_UNQUOTED(SETRPCENT_TYPE, $k5_cv_type_setrpcent, [Define as return type of setrpcent])
223 AC_MSG_CHECKING([return type of endrpcent])
224 AC_CACHE_VAL(k5_cv_type_endrpcent,
225 [AC_TRY_COMPILE([#include <netdb.h>
229 extern void endrpcent();],
230 [int i;], k5_cv_type_endrpcent=void, k5_cv_type_endrpcent=int)])dnl
231 AC_MSG_RESULT($k5_cv_type_endrpcent)
232 AC_DEFINE_UNQUOTED(ENDRPCENT_TYPE, $k5_cv_type_endrpcent, [Define as return type of endrpcent])
235 dnl bswap_16 is a macro in byteswap.h under GNU libc
236 AC_MSG_CHECKING(for bswap_16)
237 AC_CACHE_VAL(krb5_cv_bswap_16,[
238 AC_TRY_LINK([#if HAVE_BYTESWAP_H
239 #include <byteswap.h>
240 #endif],[bswap_16(37);],krb5_cv_bswap_16=yes,krb5_cv_bswap_16=no)])
241 AC_MSG_RESULT($krb5_cv_bswap_16)
242 if test "$krb5_cv_bswap_16" = yes; then
243 AC_DEFINE(HAVE_BSWAP_16,1,[Define to 1 if bswap_16 is available via byteswap.h])
245 AC_MSG_CHECKING(for bswap_64)
246 AC_CACHE_VAL(krb5_cv_bswap_64,[
247 AC_TRY_LINK([#if HAVE_BYTESWAP_H
248 #include <byteswap.h>
249 #endif],[bswap_64(37);],krb5_cv_bswap_64=yes,krb5_cv_bswap_64=no)])
250 AC_MSG_RESULT($krb5_cv_bswap_64)
251 if test "$krb5_cv_bswap_64" = yes; then
252 AC_DEFINE(HAVE_BSWAP_64,1,[Define to 1 if bswap_64 is available via byteswap.h])
255 dnl Needed for ksu and some appl stuff.
257 case $krb5_cv_host in
259 AC_CHECK_LIB(security,setluid,
260 AC_DEFINE(HAVE_SETLUID,1,[Define if setluid provided in OSF/1 security library])
261 KSU_LIBS="-lsecurity"
267 if test $ac_cv_func_setenv = no || test $ac_cv_func_unsetenv = no \
268 || test $ac_cv_func_getenv = no; then
275 dnl Check what the return types for gethostbyname_r and getservbyname_r are.
277 AC_CHECK_FUNC(gethostbyname_r,[
278 ac_cv_func_gethostbyname_r=yes
279 if test "$ac_cv_func_gethostbyname_r" = yes; then
280 AC_MSG_CHECKING([if gethostbyname_r returns an int])
281 AC_CACHE_VAL(krb5_cv_gethostbyname_r_returns_int,
282 [AC_TRY_COMPILE([#include <netdb.h>
283 extern int gethostbyname_r ();], [1;],
284 krb5_cv_gethostbyname_r_returns_int=yes,
285 krb5_cv_gethostbyname_r_returns_int=no)])
286 AC_MSG_RESULT($krb5_cv_gethostbyname_r_returns_int)
288 AC_MSG_CHECKING([if gethostbyname_r returns a pointer])
289 AC_CACHE_VAL(krb5_cv_gethostbyname_r_returns_ptr,
290 [AC_TRY_COMPILE([#include <netdb.h>
291 extern struct hostent *gethostbyname_r ();], [1;],
292 krb5_cv_gethostbyname_r_returns_ptr=yes,
293 krb5_cv_gethostbyname_r_returns_ptr=no)])
294 AC_MSG_RESULT($krb5_cv_gethostbyname_r_returns_ptr)
296 if test "$krb5_cv_gethostbyname_r_returns_int" = "$krb5_cv_gethostbyname_r_returns_ptr"; then
297 AC_MSG_WARN(cannot determine return type of gethostbyname_r -- disabling)
298 ac_cv_func_gethostbyname_r=no
300 if test "$krb5_cv_gethostbyname_r_returns_int" = yes; then
301 AC_DEFINE(GETHOSTBYNAME_R_RETURNS_INT, 1, [Define if gethostbyname_r returns int rather than struct hostent * ])
304 if test "$ac_cv_func_gethostbyname_r" = yes; then
305 AC_DEFINE(HAVE_GETHOSTBYNAME_R, 1, [Define if gethostbyname_r exists and its return type is known])
306 AC_CHECK_FUNC(gethostbyaddr_r)
311 AC_CHECK_FUNC(getpwnam_r,ac_cv_func_getpwnam_r=yes,ac_cv_func_getpwnam_r=no)
312 AC_CHECK_FUNC(getpwuid_r,ac_cv_func_getpwuid_r=yes,ac_cv_func_getpwuid_r=no)
313 if test "$ac_cv_func_getpwnam_r" = yes; then
314 AC_MSG_CHECKING([return type of getpwnam_r])
315 AC_CACHE_VAL(krb5_cv_getpwnam_r_return_type,
316 [AC_TRY_COMPILE([#include <pwd.h>
317 extern int getpwnam_r();], [1;],
318 getpwnam_r_returns_int=yes,getpwnam_r_returns_int=no)
319 AC_TRY_COMPILE([#include <pwd.h>
320 extern struct passwd *getpwnam_r();], [1;],
321 getpwnam_r_returns_ptr=yes,getpwnam_r_returns_ptr=no)
322 case "$getpwnam_r_returns_int/$getpwnam_r_returns_ptr" in
323 yes/no) krb5_cv_getpwnam_r_return_type=int ;;
324 no/yes) krb5_cv_getpwnam_r_return_type=ptr ;;
325 *) krb5_cv_getpwnam_r_return_type=unknown ;;
327 AC_MSG_RESULT($krb5_cv_getpwnam_r_return_type)
328 if test $krb5_cv_getpwnam_r_return_type = int; then
329 AC_DEFINE(GETPWNAM_R_RETURNS_INT, 1, [Define if getpwnam_r returns an int])
330 elif test $krb5_cv_getpwnam_r_return_type = unknown; then
331 AC_MSG_WARN([Cannot determine getpwnam_r return type, disabling getpwnam_r])
332 ac_cv_func_getpwnam_r=no
335 if test "$ac_cv_func_getpwnam_r" = yes; then
336 AC_MSG_CHECKING([number of arguments to getpwnam_r])
337 AC_CACHE_VAL(krb5_cv_getpwnam_r_args,
338 [AC_TRY_COMPILE([#include <pwd.h>
339 struct passwd pwx; char buf[1024];],
340 [getpwnam_r("", &pwx, buf, sizeof(buf));], args4=yes, args4=no)
341 AC_TRY_COMPILE([#include <pwd.h>
342 struct passwd pwx, *p; char buf[1024];],
343 [getpwnam_r("", &pwx, buf, sizeof(buf), &p);], args5=yes, args5=no)
344 case $args4/$args5 in
345 yes/no) krb5_cv_getpwnam_r_args=4 ;;
346 no/yes) krb5_cv_getpwnam_r_args=5 ;;
347 *) krb5_cv_getpwnam_r_args=unknown ;;
349 AC_MSG_RESULT($krb5_cv_getpwnam_r_args)
350 if test "$krb5_cv_getpwnam_r_args" = unknown; then
351 AC_MSG_WARN([Cannot determine number of arguments to getpwnam_r, disabling its use.])
352 ac_cv_func_getpwnam_r=no
354 AC_DEFINE(HAVE_GETPWNAM_R,1,[Define if getpwnam_r is available and useful.])
355 if test "$krb5_cv_getpwnam_r_args" = 4; then
356 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).])
361 if test "$ac_cv_func_getpwnam_r" = no && test "$ac_cv_func_getpwuid_r" = yes; then
362 # Actually, we could do this check, and the corresponding checks
363 # for return type and number of arguments, but I doubt we'll run
364 # into a system where we'd get to use getpwuid_r but not getpwnam_r.
365 AC_MSG_NOTICE([getpwnam_r not useful, so disabling getpwuid_r too])
366 ac_cv_func_getpwuid_r=no
368 if test "$ac_cv_func_getpwuid_r" = yes; then
369 AC_DEFINE(HAVE_GETPWUID_R,1,[Define if getpwuid_r is available and useful.])
370 # Hack: Assume getpwuid_r is the shorter form if getpwnam_r is.
371 if test "$krb5_cv_getpwnam_r_args" = 4; then
372 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).])
376 if test "$ac_cv_func_gmtime_r" = yes; then
377 AC_MSG_CHECKING([whether gmtime_r returns int])
378 AC_CACHE_VAL(krb5_cv_gmtime_r_returns_int,
379 [AC_TRY_COMPILE([#include <time.h>
380 extern int gmtime_r ();], [1;], return_int=yes, return_int=no)
381 AC_TRY_COMPILE([#include <time.h>
382 extern struct tm *gmtime_r ();], [1;], return_ptr=yes, return_ptr=no)
383 case $return_int/$return_ptr in
384 yes/no) krb5_cv_gmtime_r_returns_int=yes ;;
385 no/yes) krb5_cv_gmtime_r_returns_int=no ;;
386 *) # Can't figure it out, punt the function.
387 ac_cv_func_gmtime_r=no ;;
389 if test "$ac_cv_func_gmtime_r" = no; then
390 AC_MSG_RESULT(unknown -- ignoring gmtime_r)
392 AC_MSG_RESULT($krb5_cv_gmtime_r_returns_int)
393 if test "$krb5_cv_gmtime_r_returns_int" = yes; then
394 AC_DEFINE(GMTIME_R_RETURNS_INT,1,[Define if gmtime_r returns int instead of struct tm pointer, as on old HP-UX systems.])
399 AC_CHECK_FUNC(getservbyname_r,[
400 ac_cv_func_getservbyname_r=yes
401 if test "$ac_cv_func_getservbyname_r" = yes; then
402 AC_MSG_CHECKING([if getservbyname_r returns an int])
403 AC_CACHE_VAL(krb5_cv_getservbyname_r_returns_int,
404 [AC_TRY_COMPILE([#include <netdb.h>
405 extern int getservbyname_r ();], [1;],
406 krb5_cv_getservbyname_r_returns_int=yes,
407 krb5_cv_getservbyname_r_returns_int=no)])
408 AC_MSG_RESULT($krb5_cv_getservbyname_r_returns_int)
410 AC_MSG_CHECKING([if getservbyname_r returns a pointer])
411 AC_CACHE_VAL(krb5_cv_getservbyname_r_returns_ptr,
412 [AC_TRY_COMPILE([#include <netdb.h>
413 extern struct servent *getservbyname_r ();], [1;],
414 krb5_cv_getservbyname_r_returns_ptr=yes,
415 krb5_cv_getservbyname_r_returns_ptr=no)])
416 AC_MSG_RESULT($krb5_cv_getservbyname_r_returns_ptr)
418 if test "$krb5_cv_getservbyname_r_returns_int" = "$krb5_cv_getservbyname_r_returns_ptr"; then
419 AC_MSG_WARN(cannot determine return type of getservbyname_r -- disabling)
420 ac_cv_func_getservbyname_r=no
422 if test "$krb5_cv_getservbyname_r_returns_int" = yes; then
423 AC_DEFINE(GETSERVBYNAME_R_RETURNS_INT, 1, [Define if getservbyname_r returns int rather than struct servent * ])
426 if test "$ac_cv_func_getservbyname_r" = yes; then
427 AC_DEFINE(HAVE_GETSERVBYNAME_R, 1, [Define if getservbyname_r exists and its return type is known])
428 AC_CHECK_FUNC(getservbyport_r)
437 AC_CHECK_HEADER(termios.h,dnl
438 [AC_CHECK_FUNC([tcsetattr],dnl
439 AC_DEFINE(POSIX_TERMIOS,1,[Define if termios.h exists and tcsetattr exists]))])
442 AC_CHECK_HEADERS(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)
446 dnl If compiling with IPv6 support, test if in6addr_any functions.
447 dnl Irix 6.5.16 defines it, but lacks support in the C library.
448 if test $krb5_cv_inet6 = yes || test "$krb5_cv_inet6_with_dinet6" = yes ; then
449 AC_CACHE_CHECK([for in6addr_any definition in library],
450 krb5_cv_var_in6addr_any,
452 #ifdef HAVE_SYS_TYPES_H
453 #include <sys/types.h>
455 #include <sys/socket.h>
456 #include <netinet/in.h>
459 struct sockaddr_in6 in;
460 in.sin6_addr = in6addr_any;
462 ],krb5_cv_var_in6addr_any=yes, krb5_cv_var_in6addr_any=no)])
463 if test $krb5_cv_var_in6addr_any = no; then
464 AC_DEFINE(NEED_INSIXADDR_ANY,1,[Define if in6addr_any is not defined in libc])
470 dnl check for ANSI stdio, esp "b" option to fopen(). This (unfortunately)
471 dnl requires a run check...
473 AC_MSG_CHECKING([for ANSI stdio])
474 AC_CACHE_VAL(krb5_cv_has_ansi_stdio,
480 if ((conftest = fopen("conftest.dat", "w")) == NULL) exit(1);
481 if (fclose(conftest)) exit(1);
482 if ((conftest = fopen("conftest.dat", "rb+")) == NULL) exit(1);
483 if (fputs("testing ANSI for stdio\n", conftest) == EOF) exit(1);
486 krb5_cv_has_ansi_stdio=yes, krb5_cv_has_ansi_stdio=no,
487 krb5_cv_has_ansi_stdio=yes)])dnl assume ANSI in cross environment
488 AC_MSG_RESULT($krb5_cv_has_ansi_stdio)
489 if test $krb5_cv_has_ansi_stdio = yes; then
490 AC_DEFINE(ANSI_STDIO,1,[Define if ANSI stdio is present (in particular "b" option to fopen)])
493 dnl then from osconf.h, we have
496 AC_CHECK_TYPE(time_t, long)
498 dnl Determine where to put the replay cache.
500 AC_MSG_CHECKING([for replay cache directory])
501 AC_CACHE_VAL(krb5_cv_sys_rcdir,
503 for t_dir in /var/tmp /usr/tmp /var/usr/tmp /tmp ; do
504 test -d $t_dir || continue
505 krb5_cv_sys_rcdir=$t_dir
508 AC_MSG_RESULT($krb5_cv_sys_rcdir)
509 KRB5_RCTMPDIR=$krb5_cv_sys_rcdir
510 AC_SUBST(KRB5_RCTMPDIR)
513 AC_MSG_CHECKING(for socklen_t)
514 AC_CACHE_VAL(krb5_cv_has_type_socklen_t,
516 [#include <sys/types.h>
517 #include <sys/socket.h>
518 ],[sizeof (socklen_t);],
519 krb5_cv_has_type_socklen_t=yes,krb5_cv_has_type_socklen_t=no)])
520 AC_MSG_RESULT($krb5_cv_has_type_socklen_t)
521 if test $krb5_cv_has_type_socklen_t = yes; then
522 AC_DEFINE(HAVE_SOCKLEN_T,1,[Define if there is a socklen_t type. If not, probably use size_t])
525 AC_MSG_CHECKING(for struct lifconf)
526 AC_CACHE_VAL(krb5_cv_has_struct_lifconf,
528 [#include <sys/socket.h>
530 ],[sizeof (struct lifconf);],
531 krb5_cv_has_struct_lifconf=yes,krb5_cv_has_struct_lifconf=no)])
532 AC_MSG_RESULT($krb5_cv_has_struct_lifconf)
533 if test $krb5_cv_has_struct_lifconf = yes; then
534 AC_DEFINE(HAVE_STRUCT_LIFCONF,1,[Define if there is a struct lifconf.])
536 dnl HP-UX 11 uses stuct if_laddrconf
537 AC_MSG_CHECKING(for struct if_laddrconf)
538 AC_CACHE_VAL(krb5_cv_has_struct_if_laddrconf,
540 [#include <sys/socket.h>
543 ],[sizeof (struct if_laddrconf);],
544 krb5_cv_has_struct_if_laddrconf=yes,krb5_cv_has_struct_if_laddrconf=no)])
545 AC_MSG_RESULT($krb5_cv_has_struct_if_laddrconf)
546 if test $krb5_cv_has_struct_if_laddrconf = yes; then
547 AC_DEFINE(HAVE_STRUCT_IF_LADDRCONF,1,[Define if there is a struct if_laddrconf.])
551 AC_MSG_CHECKING([for h_errno in netdb.h])
552 AC_CACHE_VAL(krb5_cv_header_netdb_h_h_errno,
554 [#include <netdb.h>],
555 [int x = h_errno;], krb5_cv_header_netdb_h_h_errno=yes,
556 krb5_cv_header_netdb_h_h_errno=no)])
557 AC_MSG_RESULT($krb5_cv_header_netdb_h_h_errno)
558 if test $krb5_cv_header_netdb_h_h_errno = yes; then
559 AC_DEFINE([HAVE_NETDB_H_H_ERRNO], 1,
560 [Define if netdb.h declares h_errno])
564 AC_ARG_ENABLE([athena],
565 [ --enable-athena build with MIT Project Athena configuration],
566 AC_DEFINE(KRB5_ATHENA_COMPAT,1,[Define if MIT Project Athena default configuration should be used]),)
568 if test "$KRB4_LIB" = ''; then
569 AC_MSG_NOTICE(No Kerberos 4 compatibility)
572 AC_MSG_NOTICE(Kerberos 4 compatibility enabled)
573 maybe_kerberosIV=kerberosIV
574 AC_DEFINE(KRB5_KRB4_COMPAT,1,[Define if Kerberos V4 backwards compatibility should be supported])
576 AC_SUBST(maybe_kerberosIV)
580 #ifndef KRB5_AUTOCONF_H
581 #define KRB5_AUTOCONF_H
584 #if defined(__GNUC__) && !defined(inline)
585 /* Silence gcc pedantic warnings about ANSI C. */
586 # define inline __inline__
588 #endif /* KRB5_AUTOCONF_H */
591 dnl Not used yet, but let's find out what we've got on the platforms
592 dnl we're working with....
593 AC_CHECK_HEADERS(inttypes.h stdint.h)
594 AC_CHECK_TYPES([uint32_t, int32_t, uint64_t, int64_t, uint_least32_t, uintptr_t, uintmax_t, long long], , , [
597 #elif defined(HAVE_INTTYPES_H)
598 # include <inttypes.h>
601 AC_CHECK_TYPES([struct cmsghdr, struct in_pktinfo, struct in6_pktinfo], , , [
602 #include <sys/types.h>
603 #include <sys/socket.h>
604 #include <netinet/in.h>
607 dnl stuff for util/profile
609 dnl AC_KRB5_TCL already done
611 test "$TCL_LIBS" != "" && DO_TCL=ok
614 dnl types libdb2 wants
616 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])
618 dnl Test for POSIX 2001 *printf support (X/Open System Interfaces extension
619 dnl to ANSI/ISO C 1999 specification). Specifically, positional
620 dnl specifications; not checking for other features like %zx at present.
621 AC_MSG_CHECKING(for POSIX printf positional specification support)
622 AC_CACHE_VAL(ac_cv_printf_positional,[
626 const char expected[] = "200 100";
629 sprintf(buf, "%2\$x %1\$d", 100, 512);
630 if (strcmp(expected, buf)) {
631 fprintf(stderr,"bad result: <%s> wanted: <%s>\n", buf, expected);
636 ac_cv_printf_positional=yes,
637 ac_cv_printf_positional=no,
638 AC_MSG_ERROR([Cannot test for printf positional argument support when cross compiling]))])
639 dnl Nothing for autoconf.h for now.
640 AC_MSG_RESULT($ac_cv_printf_positional)
647 AC_ARG_ENABLE([athena],
648 [ --enable-athena build with MIT Project Athena configuration],
650 dnl The following are tests for the presence of programs required for
652 AC_CHECK_PROG(have_RUNTEST,runtest,runtest)
653 AC_CHECK_PROG(have_PERL,perl,perl)
655 if test "$have_PERL" = perl -a "$have_RUNTEST" = runtest -a "$TCL_LIBS" != ""; then
661 if test "$have_PERL" = perl -a "$have_RUNTEST" = runtest -a "$TCL_LIBS" != "" -a "$ath_compat" != ""; then
665 dnl The following are substituted into kadmin/testing/scripts/env-setup.sh
670 *) S_TOP=`pwd`/$srcdir ;;
673 AC_PATH_PROG(PERL_PATH,perl)
674 AC_PATH_PROG(EXPECT,expect)
675 dnl For kadmin/testing/util/Makefile.in
676 if test "$TCL_LIBS" != "" ; then
680 KRB5_AC_PRIOCNTL_HACK
681 K5_GEN_FILE(kadmin/testing/scripts/env-setup.sh:kadmin/testing/scripts/env-setup.shin)
683 AC_CHECK_PROG(RUNTEST,runtest,runtest)
684 AC_CHECK_PROG(PERL,perl,perl)
688 case $krb5_cv_host in
695 KRB_ERR='$(OUTPRE)krb_err.$(OBJEXT)'
696 KRB_ERR_TXT=krb_err_txt.c
700 AC_SUBST([KRB_ERR_TXT])
702 AC_SUBST([KRB_ERR_C])
706 AC_CHECK_HEADER(stdint.h,[
707 include_stdint='awk '\''END{printf("%cinclude <stdint.h>\n", 35);}'\'' < /dev/null'],
708 include_stdint='echo "/* no stdint.h */"')
709 AC_SUBST(include_stdint)
710 AC_CHECK_HEADER(inttypes.h,[
711 include_inttypes='awk '\''END{printf("%cinclude <inttypes.h>\n", 35);}'\'' < /dev/null'],
712 include_inttypes='echo "/* no inttypes.h */"')
713 AC_SUBST(include_inttypes)
714 AC_CHECK_HEADER(xom.h,[
715 include_xom='awk '\''END{printf("%cinclude <xom.h>\n", 35);}'\'' < /dev/null'], [
716 include_xom='echo "/* no xom.h */"'])
717 AC_SUBST(include_xom)
721 ### Check where struct rpcent is declared.
723 # This is necessary to determine:
724 # 1. If /usr/include/netdb.h declares struct rpcent
725 # 2. If /usr/include/rpc/netdb.h declares struct rpcent
727 # We have our own rpc/netdb.h, and if /usr/include/netdb.h includes
728 # rpc/netdb.h, then nastiness could happen.
730 # Logic: If /usr/include/netdb.h declares struct rpcent, then check
731 # rpc/netdb.h. If /usr/include/rpc/netdb.h declares struct rpcent,
732 # then define STRUCT_RPCENT_IN_RPC_NETDB_H, otherwise do not. If
733 # neither netdb.h nor rpc/netdb.h declares struct rpcent, then define
734 # STRUCT_RPCENT_IN_RPC_NETDB_H anyway.
736 AC_MSG_CHECKING([where struct rpcent is declared])
737 AC_TRY_COMPILE([#include <netdb.h>],
739 char c = e.r_name[0];
740 int i = e.r_number;],
741 [AC_TRY_COMPILE([#include <rpc/netdb.h>],
743 char c = e.r_name[0];
744 int i = e.r_number;],
745 [AC_MSG_RESULT([rpc/netdb.h])
746 rpcent_define='#define STRUCT_RPCENT_IN_RPC_NETDB_H'],
747 [AC_MSG_RESULT([netdb.h])])],
748 [AC_MSG_RESULT([nowhere])
749 rpcent_define='#define STRUCT_RPCENT_IN_RPC_NETDB_H'])
750 AC_SUBST(rpcent_define)
752 AC_CHECK_HEADERS(sys/select.h sys/time.h unistd.h)
753 if test $ac_cv_header_sys_select_h = yes; then
754 GSSRPC__SYS_SELECT_H='#include <sys/select.h>'
756 GSSRPC__SYS_SELECT_H='/* #include <sys/select.h> */'
758 AC_SUBST(GSSRPC__SYS_SELECT_H)
759 if test $ac_cv_header_sys_time_h = yes; then
760 GSSRPC__SYS_TIME_H='#include <sys/time.h>'
762 GSSRPC__SYS_TIME_H='/* #include <sys/time.h> */'
764 AC_SUBST(GSSRPC__SYS_TIME_H)
765 if test $ac_cv_header_unistd_h = yes; then
766 GSSRPC__UNISTD_H='#include <unistd.h>'
768 GSSRPC__UNISTD_H='/* #include <unistd.h> */'
770 AC_SUBST(GSSRPC__UNISTD_H)
772 AC_CACHE_CHECK([for MAXHOSTNAMELEN in sys/param.h],
773 [krb5_cv_header_sys_param_h_maxhostnamelen],
774 [AC_TRY_COMPILE([#include <sys/param.h>],
775 [int i = MAXHOSTNAMELEN;],
776 [krb5_cv_header_sys_param_h_maxhostnamelen=yes],
777 [krb5_cv_header_sys_param_h_maxhostnamelen=no])])
778 AC_CACHE_CHECK([for MAXHOSTNAMELEN in netdb.h],
779 [krb5_cv_header_netdb_h_maxhostnamelen],
780 [AC_TRY_COMPILE([#include <netdb.h>],
781 [int i = MAXHOSTNAMELEN;],
782 [krb5_cv_header_netdb_h_maxhostnamelen=yes],
783 [krb5_cv_header_netdb_h_maxhostnamelen=no])])
785 GSSRPC__SYS_PARAM_H='/* #include <sys/param.h> */'
786 GSSRPC__NETDB_H='/* #include <netdb.h> */'
787 if test $krb5_cv_header_sys_param_h_maxhostnamelen = yes; then
788 GSSRPC__SYS_PARAM_H='#include <sys/param.h>'
790 if test $krb5_cv_header_netdb_h_maxhostnamelen = yes; then
791 GSSRPC__NETDB_H='#include <netdb.h>'
793 AC_MSG_WARN([can't find MAXHOSTNAMELEN definition; faking it])
796 AC_SUBST(GSSRPC__SYS_PARAM_H)
797 AC_SUBST(GSSRPC__NETDB_H)
799 AC_CACHE_CHECK([for uint32_t in sys/types.h],
800 [krb5_cv_header_sys_types_h_uint32_t],
801 [AC_TRY_COMPILE([#include <sys/types.h>],
803 [krb5_cv_header_sys_types_h_uint32_t=yes],
804 [krb5_cv_header_sys_types_h_uint32_t=no])])
805 AC_CACHE_CHECK([for uint32_t in stdint.h],
806 [krb5_cv_header_stdint_h_uint32_t],
807 [AC_TRY_COMPILE([#include <stdint.h>],
809 [krb5_cv_header_stdint_h_uint32_t=yes],
810 [krb5_cv_header_stdint_h_uint32_t=no])])
811 AC_CACHE_CHECK([for uint32_t in inttypes.h],
812 [krb5_cv_header_inttypes_h_uint32_t],
813 [AC_TRY_COMPILE([#include <inttypes.h>],
815 [krb5_cv_header_inttypes_h_uint32_t=yes],
816 [krb5_cv_header_inttypes_h_uint32_t=no])])
817 GSSRPC__STDINT_H='/* #include <stdint.h> */'
818 GSSRPC__INTTYPES_H='/* #include <inttypes.h> */'
819 GSSRPC__FAKE_UINT32='/* #undef GSSRPC__FAKE_INT32 */'
820 if test $krb5_cv_header_sys_types_h_uint32_t = yes; then
821 : # already included sys/types.h
823 if test $krb5_cv_header_stdint_h_uint32_t = yes; then
824 GSSRPC__STDINT_H='#include <stdint.h>'
826 if test $krb5_cv_header_inttypes_h_uint32_t = yes; then
827 GSSRPC__INTTYPES_H='#include <inttypes.h>'
829 AC_MSG_WARN([can't find a fixed-width 32-bit type anywhere; faking it])
830 GSSRPC__FAKE_UINT32='#define GSSRPC__FAKE_UINT32 1'
834 AC_SUBST(GSSRPC__STDINT_H)
835 AC_SUBST(GSSRPC__INTTYPES_H)
836 AC_SUBST(GSSRPC__FAKE_UINT32)
838 AC_CACHE_CHECK([for BSD type aliases], [krb5_cv_type_bsdaliases],
840 [#include <sys/types.h>
846 u_long l;], [krb5_cv_type_bsdaliases=yes], [krb5_cv_type_bsdaliases=no])])
847 if test $krb5_cv_type_bsdaliases = yes; then
848 GSSRPC__BSD_TYPEALIASES='/* #undef GSSRPC__BSD_TYPEALIASES */'
850 GSSRPC__BSD_TYPEALIASES='#define GSSRPC__BSD_TYPEALIASES 1'
852 AC_SUBST(GSSRPC__BSD_TYPEALIASES)
854 # sockaddr length field checks
856 AC_CHECK_MEMBERS([struct sockaddr_in.sin_len], , ,
857 [#include <sys/types.h>
858 @%:@include <netinet/in.h>])
859 AC_CHECK_MEMBERS([struct sockaddr.sa_len], , ,
860 [#include <sys/types.h>
861 @%:@include <sys/socket.h>])
863 AC_MSG_CHECKING([return type of setrpcent])
864 AC_CACHE_VAL(k5_cv_type_setrpcent,
865 [AC_TRY_COMPILE([#include <netdb.h>
869 extern void setrpcent();],
870 [int i;], k5_cv_type_setrpcent=void, k5_cv_type_setrpcent=int)])dnl
871 AC_MSG_RESULT($k5_cv_type_setrpcent)
872 AC_DEFINE_UNQUOTED(SETRPCENT_TYPE, $k5_cv_type_setrpcent, [Define as return type of setrpcent])
874 AC_MSG_CHECKING([return type of endrpcent])
875 AC_CACHE_VAL(k5_cv_type_endrpcent,
876 [AC_TRY_COMPILE([#include <netdb.h>
880 extern void endrpcent();],
881 [int i;], k5_cv_type_endrpcent=void, k5_cv_type_endrpcent=int)])dnl
882 AC_MSG_RESULT($k5_cv_type_endrpcent)
883 AC_DEFINE_UNQUOTED(ENDRPCENT_TYPE, $k5_cv_type_endrpcent, [Define as return type of endrpcent])
884 K5_GEN_FILE(include/gssrpc/types.h:include/gssrpc/types.hin)
886 case "$krb5_cv_host" in
887 *-*-solaris2.[012345]*)
898 AC_REPLACE_FUNCS(daemon)
901 if test x"$RUNTEST" != x; then
906 AC_SUBST(HAVE_RUNTEST)
907 if test "$KRB4_LIB" = ''; then
908 KRB4_DEJAGNU_TEST="KRBIV=0"
910 AC_MSG_RESULT(Kerberos 4 testing enabled)
911 KRB4_DEJAGNU_TEST="KRBIV=1"
913 AC_SUBST(KRB4_DEJAGNU_TEST)
915 dnl for plugins/kdb/db2
917 dnl AIX is unusual in that it wants all symbols resolved at link time
918 dnl Fortunately, it will allow us to link the kdb library now, even if
919 dnl it is linked again later.
920 case $krb5_cv_host in
928 AC_SUBST(DB_EXTRA_LIBS)
929 if test "$DB_VERSION" = k5; then
930 AC_CONFIG_SUBDIRS(plugins/kdb/db2/libdb2)
935 dnl Check for thread safety issues.
936 dnl (Is there a better place for this?)
937 dnl tsfuncs="getpwnam_r getpwuid_r gethostbyname_r getservbyname_r gmtime_r localtime_r"
938 dnl Removed getpwnam_r and getpwuid_r because include/configure.in has some
939 dnl more careful checks, and may decide to pretend that they're not found if
940 dnl the function signatures can't be figured out.
941 tsfuncs="gethostbyname_r getservbyname_r gmtime_r localtime_r"
942 AC_CHECK_FUNCS($tsfuncs)
943 if test "$enable_thread_support" = yes; then
945 for ts in $tsfuncs; do
946 if eval "test \"\${ac_cv_func_$ts}\" != yes"; then
947 tsmissing="$tsmissing $ts"
950 if test "$ac_cv_func_res_nsearch/$ac_cv_lib_resolv_res_nsearch" = "no/no"; then
951 tsmissing="$tsmissing res_nsearch"
953 if test "$tsmissing" != ""; then
954 AC_MSG_WARN([Some functions that are needed for library thread])
955 AC_MSG_WARN([safety appear to be missing.])
956 for ts in $tsmissing; do
957 AC_MSG_WARN([ missing thread-safe function: $ts])
959 AC_MSG_WARN([Without these functions, the installed libraries])
960 AC_MSG_WARN([may not be thread-safe.])
961 fi # tsmissing not empty
962 fi # enable_thread_support
964 HOST_TYPE=$krb5_cv_host
967 dnl Sadly, we seem to have accidentally committed ourselves in 1.4 to
968 dnl an ABI that includes the existence of libkrb5support.0 even
969 dnl though random apps should never use anything from it. And on
970 dnl the Mac, to which that didn't apply, we can't use major version 0.
972 case $krb5_cv_host in
973 *-*-darwin* | *-*-rhapsody*) SUPPORTLIB_MAJOR=1 ;;
974 *) SUPPORTLIB_MAJOR=0 ;;
976 AC_SUBST(SUPPORTLIB_MAJOR)
979 if test "$COM_ERR_VERSION" = k5 ; then
980 K5_GEN_MAKEFILE(util/et)
982 if test "$SS_VERSION" = k5 ; then
983 K5_GEN_MAKEFILE(util/ss)
985 if test -n "$KRB4_LIB"; then
986 K5_GEN_MAKEFILE(lib/krb4)
992 if test -n "$OPENLDAP_PLUGIN"; then
993 AC_CHECK_HEADERS(ldap.h lber.h, :, [AC_MSG_ERROR($ac_header not found)])
994 AC_CHECK_LIB(ldap, ldap_init, :, [AC_MSG_ERROR(libldap not found or missing ldap_init)])
997 AC_CHECK_FUNCS(ldap_initialize ldap_url_parse_nodn ldap_unbind_ext_s ldap_str2dn ldap_explode_dn)
1001 AC_CHECK_LIB(ldap, ber_init, [BER_OKAY=1])
1002 if test "$BER_OKAY" = "1"; then
1005 AC_CHECK_LIB(lber, ber_init, [BER_OKAY=1], [AC_MSG_WARN([libber not found])])
1006 if test "$BER_OKAY" = "1"; then
1007 LDAP_LIBS='-lldap -llber'
1009 AC_ERROR("BER library missing - cannot build LDAP database module")
1014 K5_GEN_MAKEFILE(plugins/kdb/ldap)
1015 K5_GEN_MAKEFILE(plugins/kdb/ldap/ldap_util)
1016 K5_GEN_MAKEFILE(plugins/kdb/ldap/libkdb_ldap)
1017 ldap_plugin_dir=plugins/kdb/ldap
1019 AC_SUBST(ldap_plugin_dir)
1021 AC_CHECK_HEADERS(Python.h python2.3/Python.h)
1024 dnl Kludge for simple server --- FIXME is this the best way to do this?
1026 if test "$ac_cv_lib_socket" = "yes" -a "$ac_cv_lib_nsl" = "yes"; then
1027 AC_DEFINE(BROKEN_STREAMS_SOCKETS,1,[Define if socket can't be bound to 0.0.0.0])
1030 AC_CONFIG_SUBDIRS(appl/libpty appl/bsd appl/gssftp appl/telnet)
1032 AC_CONFIG_FILES(krb5-config, [chmod +x krb5-config])
1033 V5_AC_OUTPUT_MAKEFILE(.
1035 util util/support util/profile util/send-pr
1037 lib lib/des425 lib/kdb
1039 lib/crypto lib/crypto/crc32 lib/crypto/des lib/crypto/dk
1040 lib/crypto/enc_provider lib/crypto/hash_provider
1041 lib/crypto/keyhash_provider lib/crypto/md4 lib/crypto/md5
1042 lib/crypto/old lib/crypto/raw lib/crypto/sha1
1043 lib/crypto/arcfour lib/crypto/yarrow lib/crypto/aes
1045 lib/krb5 lib/krb5/error_tables lib/krb5/asn.1 lib/krb5/ccache
1046 lib/krb5/keytab lib/krb5/krb lib/krb5/rcache lib/krb5/os
1048 lib/gssapi lib/gssapi/generic lib/gssapi/krb5
1049 lib/gssapi/mechglue lib/gssapi/spnego
1051 lib/rpc lib/rpc/unit-test
1053 lib/kadm5 lib/kadm5/clnt lib/kadm5/srv lib/kadm5/unit-test
1057 kdc slave krb524 config-files gen-manpages include
1060 plugins/locate/python
1062 plugins/preauth/cksum_body
1063 plugins/preauth/wpse
1065 clients clients/klist clients/kinit clients/kvno
1066 clients/kdestroy clients/kpasswd clients/ksu
1068 kadmin kadmin/cli kadmin/dbutil kadmin/passwd
1069 kadmin/passwd/unit-test kadmin/ktutil kadmin/server
1070 kadmin/testing kadmin/testing/scripts kadmin/testing/util
1073 appl/sample appl/sample/sclient appl/sample/sserver
1074 appl/simple appl/simple/client appl/simple/server
1075 appl/gss-sample appl/user_user
1077 tests tests/resolve tests/asn.1 tests/create tests/hammer
1078 tests/verify tests/gssapi tests/dejagnu tests/threads tests/shlib
1079 tests/gss-threads tests/misc