(_PATH_DEV): add
[heimdal.git] / configure.in
blobd1a493000f95e39d8752328e3990d20dc41655dc
1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION($Revision$)
3 AC_INIT(lib/krb5/send_to_kdc.c)
4 AM_CONFIG_HEADER(include/config.h)
6 AM_INIT_AUTOMAKE(heimdal,0.2m)
8 AC_PREFIX_DEFAULT(/usr/heimdal)
10 AC_CANONICAL_HOST
11 CANONICAL_HOST=$host
12 AC_SUBST(CANONICAL_HOST)
14 sunos=no
15 case "$host" in 
16 *-*-sunos4*)
17         sunos=40
18         ;;
19 *-*-solaris2.7)
20         sunos=57
21         ;;
22 *-*-solaris2*)
23         sunos=50
24         ;;
25 esac
26 if test "$sunos" != no; then
27         AC_DEFINE_UNQUOTED(SunOS, $sunos, 
28                 [Define to what version of SunOS you are running.])
31 aix=no
32 case "$host" in 
33 *-*-aix3*)
34         aix=3
35         ;;
36 *-*-aix4*)
37         aix=4
38         ;;
39 esac
41 test -z "$CFLAGS" && CFLAGS="-g"
43 dnl Checks for programs.
44 AC_PROG_CC
46 AC_CYGWIN
47 AC_OBJEXT
48 AC_EXEEXT
50 dnl AC_KRB_PROG_YACC
51 AC_PROG_YACC
52 AM_PROG_LEX
53 AC_PROG_RANLIB
54 AC_PROG_AWK
55 AC_KRB_PROG_LN_S
57 AC_MIPS_ABI
58 CC="$CC $abi"
59 libdir="$libdir$abilibdirext"
61 AC_C___ATTRIBUTE__
63 AM_DISABLE_SHARED
64 AM_PROG_LIBTOOL
66 AC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
68 berkeley_db=db
69 AC_ARG_WITH(berkeley-db,
70 [  --without-berkeley-db   if you don't want berkeley db],[
71 if test "$withval" = no; then
72         berkeley_db=""
76 AC_TEST_PACKAGE_NEW(krb4,[#include <krb.h>],-lkrb,-ldes,/usr/athena)
78 LIB_kdb=
79 if test "$with_krb4" != "no"; then
80         save_CFLAGS="$CFLAGS"
81         CFLAGS="$CFLAGS $INCLUDE_krb4"
82         save_LIBS="$LIBS"
83         LIBS="$LIB_krb4 -ldes $LIBS"
84         EXTRA_LIB45=lib45.a
85         AC_SUBST(EXTRA_LIB45)
86         AC_CACHE_CHECK(for four valued krb_put_int, ac_cv_func_krb_put_int_four,
87                 [AC_TRY_COMPILE([#include <krb.h>],[
88                 char tmp[4];
89                 krb_put_int(17, tmp, 4, sizeof(tmp));],
90                 ac_cv_func_krb_put_int_four=yes,
91                 ac_cv_func_krb_put_int_four=no)
92         ])
93         if test "$ac_cv_func_krb_put_int_four" = yes; then
94                 AC_DEFINE(HAVE_FOUR_VALUED_KRB_PUT_INT, 1,
95                         [define if krb_put_int takes four arguments.])
96         fi
97         AC_CACHE_CHECK(for KRB_VERIFY_SECURE, ac_cv_func_krb_verify_secure,
98                 [AC_TRY_COMPILE([#include <krb.h>],[
99                 int x = KRB_VERIFY_SECURE],
100                 ac_cv_func_krb_verify_secure=yes,
101                 ac_cv_func_krb_verify_secure=no)
102         ])
103         if test "$ac_cv_func_krb_verify_secure" != yes; then
104                 AC_DEFINE(KRB_VERIFY_SECURE, 1,
105                         [Define to one if your krb.h doesn't])
106                 AC_DEFINE(KRB_VERIFY_SECURE_FAIL, 2,
107                         [Define to two if your krb.h doesn't])
108         fi
109         AC_CACHE_CHECK(for KRB_VERIFY_NOT_SECURE,
110                 ac_cv_func_krb_verify_not_secure,
111                 [AC_TRY_COMPILE([#include <krb.h>],[
112                 int x = KRB_VERIFY_NOT_SECURE],
113                 ac_cv_func_krb_verify_not_secure=yes,
114                 ac_cv_func_krb_verify_not_secure=no)
115         ])
116         if test "$ac_cv_func_krb_verify_not_secure" != yes; then
117                 AC_DEFINE(KRB_VERIFY_NOT_SECURE, 0,
118                         [Define to zero if your krb.h doesn't])
119         fi
120         AC_FIND_FUNC(krb_enable_debug)
121         AC_FIND_FUNC(krb_disable_debug)
122         AC_FIND_FUNC(krb_get_our_ip_for_realm)
123         LIBS="$save_LIBS"
124         CFLAGS="$save_CFLAGS"
125         LIB_kdb="-lkdb -lkrb"
126         if test "$krb4_libdir"; then
127                 LIB_krb4="-rpath $krb4_libdir $LIB_krb4"
128                 LIB_kdb="-rpath $krb4_libdir -L$krb4_libdir $LIB_kdb"
129         fi
131 AM_CONDITIONAL(KRB4, test "$with_krb4" != "no")
132 AM_CONDITIONAL(KRB5, true)
133 AC_DEFINE(KRB5, 1, [Enable Kerberos 5 support in applications.])dnl
134 AC_SUBST(LIB_kdb)dnl
135 AM_CONDITIONAL(AIX, test "$aix" != no)dnl
136 AM_CONDITIONAL(AIX4, test "$aix" = 4)
137 aix_dynamic_afs=yes
138 AM_CONDITIONAL(AIX_DYNAMIC_AFS, test "$aix_dynamic_afs" = yes)dnl
140 AC_FIND_FUNC_NO_LIBS(dlopen, dl)
142 if test "$aix" != no; then
143         if test "$aix_dynamic_afs" = yes; then
144                 if test "$ac_cv_funclib_dlopen" = yes; then
145                         AIX_EXTRA_KAFS=
146                 elif test "$ac_cv_funclib_dlopen" != no; then
147                         AIX_EXTRA_KAFS="$ac_cv_funclib_dlopen"
148                 else
149                         AIX_EXTRA_KAFS=-lld
150                 fi
151         else
152                 AIX_EXTRA_KAFS=
153         fi
156 AM_CONDITIONAL(HAVE_DLOPEN, test "$ac_cv_funclib_dlopen" != no)dnl
157 AC_SUBST(AFS_EXTRA_LD)dnl
158 AC_SUBST(AIX_EXTRA_KAFS)dnl
160 AC_ARG_ENABLE(kaserver,
161 [  --enable-kaserver      if you want the KDC to try to emulate a kaserver])
162 if test "$enable_kaserver" = yes; then
163         AC_DEFINE(KASERVER, 1,
164                 [Define if you want to use the KDC as a kaserver.])
165         if test "$with_krb4" = "no"; then
166                 AC_MSG_ERROR(kaserver requires krb4)
167                 exit 1
168         fi
171 AC_ARG_ENABLE(kaserver-db,
172 [  --enable-kaserver-db   if you want support for reading kaserver databases in hprop])
173 if test "$enable_kaserver_db" = yes; then
174         AC_DEFINE(KASERVER_DB, 1,
175                 [Define if you want support in hprop for reading kaserver databases])
176         if test "$with_krb4" = "no"; then
177                 AC_MSG_ERROR(kaserver-db requires krb4)
178                 exit 1
179         fi
182 otp=yes
183 AC_ARG_ENABLE(otp,
184 [  --disable-otp          if you don't want OTP support],
186 if test "$enableval" = "no"; then
187         otp=no
190 if test "$otp" = "yes"; then
191         AC_DEFINE(OTP, 1, [Define if you want OTP support in applications.])
192         LIB_otp='$(top_builddir)/lib/otp/libotp.la'
194 AC_SUBST(LIB_otp)
195 AM_CONDITIONAL(OTP, test "$otp" = yes)dnl
197 AC_CHECK_OSFC2
199 AC_CHECK_MAN
201 AC_TEST_PACKAGE_NEW(readline,
202 [#include <stdio.h>
203  #include <readline.h>],-lreadline)
205 AC_TEST_PACKAGE_NEW(hesiod,[#include <hesiod.h>],-lhesiod)
207 KRB_C_BIGENDIAN
208 AC_C_INLINE
210 KRB_CHECK_X
212 if test "$no_x" = "yes" ; then
213         MAKE_X_PROGS_BIN_PROGS=""
214         MAKE_X_PROGS_BIN_SCRPTS=""
215         MAKE_X_PROGS_LIBEXEC_PROGS=""
216 else
217         MAKE_X_PROGS_BIN_PROGS='$(X_PROGS_BIN_PROGS)'
218         MAKE_X_PROGS_BIN_SCRPTS='$(X_PROGS_BIN_SCRPTS)'
219         MAKE_X_PROGS_LIBEXEC_PROGS='$(X_PROGS_LIBEXEC_PROGS)'
221 AC_SUBST(MAKE_X_PROGS_BIN_PROGS)dnl
222 AC_SUBST(MAKE_X_PROGS_BIN_SCRPTS)dnl
223 AC_SUBST(MAKE_X_PROGS_LIBEXEC_PROGS)dnl
225 AC_CHECK_XAU
227 dnl AM_C_PROTOTYPES
229 dnl Checks for typedefs, structures, and compiler characteristics.
230 AC_C_CONST
231 AC_TYPE_OFF_T
232 AC_TYPE_SIZE_T
233 AC_CHECK_TYPE_EXTRA(ssize_t, int, [#include <unistd.h>])
234 AC_TYPE_PID_T
235 AC_TYPE_UID_T
236 AC_CHECK_TYPE_EXTRA(mode_t, unsigned short, [])
237 AC_CHECK_TYPE_EXTRA(sig_atomic_t, int, [#include <signal.h>])
238 AC_HEADER_TIME
239 AC_STRUCT_TM
241 dnl Checks for header files.
242 AC_HEADER_STDC
244 if test "$berkeley_db"; then
245   AC_CHECK_HEADERS([                            \
246         db.h                                    \
247         db_185.h                                \
248   ])
251 AC_CHECK_HEADERS([\
252         arpa/ftp.h                              \
253         arpa/inet.h                             \
254         arpa/nameser.h                          \
255         arpa/telnet.h                           \
256         bind/bitypes.h                          \
257         bsdsetjmp.h                             \
258         crypt.h                                 \
259         curses.h                                \
260         dbm.h                                   \
261         dirent.h                                \
262         dlfcn.h                                 \
263         err.h                                   \
264         errno.h                                 \
265         fcntl.h                                 \
266         fnmatch.h                               \
267         grp.h                                   \
268         inttypes.h                              \
269         io.h                                    \
270         limits.h                                \
271         maillock.h                              \
272         ndbm.h                                  \
273         net/if.h                                \
274         netdb.h                                 \
275         netinet/in.h                            \
276         netinet/in6.h                           \
277         netinet/in6_machtypes.h                 \
278         netinet/in6_var.h                       \
279         netinet/in_systm.h                      \
280         netinet6/in6.h                          \
281         netinfo/ni.h                            \
282         paths.h                                 \
283         pthread.h                               \
284         pty.h                                   \
285         pwd.h                                   \
286         resolv.h                                \
287         rpcsvc/dbm.h                            \
288         sac.h                                   \
289         security/pam_modules.h                  \
290         sgtty.h                                 \
291         shadow.h                                \
292         siad.h                                  \
293         signal.h                                \
294         stropts.h                               \
295         sys/bitypes.h                           \
296         sys/category.h                          \
297         sys/file.h                              \
298         sys/filio.h                             \
299         sys/ioccom.h                            \
300         sys/ioctl.h                             \
301         sys/param.h                             \
302         sys/proc.h                              \
303         sys/pty.h                               \
304         sys/ptyio.h                             \
305         sys/ptyvar.h                            \
306         sys/resource.h                          \
307         sys/select.h                            \
308         sys/socket.h                            \
309         sys/sockio.h                            \
310         sys/stat.h                              \
311         sys/str_tty.h                           \
312         sys/stream.h                            \
313         sys/stropts.h                           \
314         sys/strtty.h                            \
315         sys/syscall.h                           \
316         sys/sysctl.h                            \
317         sys/termio.h                            \
318         sys/time.h                              \
319         sys/timeb.h                             \
320         sys/times.h                             \
321         sys/tty.h                               \
322         sys/types.h                             \
323         sys/uio.h                               \
324         sys/un.h                                \
325         sys/utsname.h                           \
326         sys/wait.h                              \
327         syslog.h                                \
328         term.h                                  \
329         termio.h                                \
330         termios.h                               \
331         time.h                                  \
332         tmpdir.h                                \
333         udb.h                                   \
334         unistd.h                                \
335         util.h                                  \
336         utmp.h                                  \
337         utmpx.h                                 \
340 CHECK_NETINET_IP_AND_TCP
343 AC_ARG_ENABLE(netinfo,
344 [  --enable-netinfo      enable netinfo for configuration lookup])
346 if test "$ac_cv_header_netinfo_ni_h" = yes -a "$enable_netinfo" = yes; then
347        AC_DEFINE(HAVE_NETINFO, 1,
348                [Define if you want to use Netinfo instead of krb5.conf.])
351 AM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes)
352 AM_CONDITIONAL(have_fnmatch_h, test "$ac_cv_header_fnmatch_h" = yes)
354 AC_KRB_IPV6
356 dnl Checks for libraries.
358 AC_FIND_FUNC(socket, socket)
359 AC_FIND_FUNC(gethostbyname, nsl)
360 AC_FIND_FUNC(syslog, syslog)
362 AC_FIND_FUNC_NO_LIBS(logwtmp, util)
363 AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses)
364 AC_FIND_FUNC(gethostbyname2, inet6 ip6)
366 AC_FIND_FUNC(res_search, resolv,
368 #include <stdio.h>
369 #ifdef HAVE_SYS_TYPES_H
370 #include <sys/types.h>
371 #endif
372 #ifdef HAVE_NETINET_IN_H
373 #include <netinet/in.h>
374 #endif
375 #ifdef HAVE_ARPA_NAMESER_H
376 #include <arpa/nameser.h>
377 #endif
378 #ifdef HAVE_RESOLV_H
379 #include <resolv.h>
380 #endif
382 [0,0,0,0,0])
384 AC_FIND_FUNC(dn_expand, resolv,
386 #include <stdio.h>
387 #ifdef HAVE_SYS_TYPES_H
388 #include <sys/types.h>
389 #endif
390 #ifdef HAVE_NETINET_IN_H
391 #include <netinet/in.h>
392 #endif
393 #ifdef HAVE_ARPA_NAMESER_H
394 #include <arpa/nameser.h>
395 #endif
396 #ifdef HAVE_RESOLV_H
397 #include <resolv.h>
398 #endif
400 [0,0,0,0,0])
402 dnl Checks for library functions.
404 AC_BROKEN_SNPRINTF
405 AC_BROKEN_VSNPRINTF
407 AC_BROKEN_GLOB
409 if test "$ac_cv_func_glob_working" != yes; then
410         LIBOBJS="$LIBOBJS glob.o"
412 AM_CONDITIONAL(have_glob_h, test "$ac_cv_func_glob_working" = yes)
414 dnl these should happen after tests for *snprintf
416 AC_FIND_FUNC_NO_LIBS(dbopen, $berkeley_db)
417 AC_FIND_FUNC_NO_LIBS(dbm_firstkey, $berkeley_db gdbm ndbm)
419 DBLIB="$LIB_dbopen"
420 if test "$LIB_dbopen" != "$LIB_dbm_firstkey"; then
421         DBLIB="$DBLIB $LIB_dbm_firstkey"
423 AC_SUBST(DBLIB)dnl
425 AC_CHECK_FUNCS(_getpty _scrsize asnprintf asprintf cgetent fcntl)
426 AC_CHECK_FUNCS(getmsg getrlimit getspnam gettimeofday getuid)
427 AC_CHECK_FUNCS(grantpt mktime ptsname rand random setproctitle)
428 AC_CHECK_FUNCS(revoke select setitimer setpcred setpgid)
429 AC_CHECK_FUNCS(setregid setresgid setresuid setreuid setutent)
430 AC_CHECK_FUNCS(setsid sigaction strstr)
431 AC_CHECK_FUNCS(sysconf sysctl timegm ttyname ttyslot umask uname)
432 AC_CHECK_FUNCS(unlockpt vasnprintf vasprintf vhangup)
433 AC_CHECK_FUNCS(yp_get_default_domain)
435 if test "$ac_cv_func_cgetent" = no; then
436         LIBOBJS="$LIBOBJS getcap.o"
439 AC_FUNC_GETLOGIN
441 KRB_CAPABILITIES
443 AC_CHECK_GETPWNAM_R_POSIX
445 AC_FIND_FUNC_NO_LIBS(getsockopt,,
446 [#ifdef HAVE_SYS_TYPES_H
447 #include <sys/types.h>
448 #endif
449 #ifdef HAVE_SYS_SOCKET_H
450 #include <sys/socket.h>
451 #endif],
452 [0,0,0,0,0])
453 AC_FIND_FUNC_NO_LIBS(setsockopt,,
454 [#ifdef HAVE_SYS_TYPES_H
455 #include <sys/types.h>
456 #endif
457 #ifdef HAVE_SYS_SOCKET_H
458 #include <sys/socket.h>
459 #endif],
460 [0,0,0,0,0])
462 dnl Cray stuff
463 AC_CHECK_FUNCS(getudbnam setlim)
465 AC_TYPE_SIGNAL
466 if test "$ac_cv_type_signal" = "void" ; then
467         AC_DEFINE(VOID_RETSIGTYPE, 1, [Define if signal handlers return void.])
469 AC_SUBST(VOID_RETSIGTYPE)
471 AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
472 [#ifdef HAVE_NETDB_H
473 #include <netdb.h>
474 #endif],
476 if test "$ac_cv_func_hstrerror" = yes; then
477 AC_NEED_PROTO([
478 #ifdef HAVE_NETDB_H
479 #include <netdb.h>
480 #endif],
481 hstrerror)
484 dnl sigh, wish this could be done in a loop
485 if test "$ac_cv_func_asprintf" = yes; then
486 AC_NEED_PROTO([
487 #include <stdio.h>
488 #include <string.h>],
489 asprintf)dnl
491 if test "$ac_cv_func_vasprintf" = yes; then
492 AC_NEED_PROTO([
493 #include <stdio.h>
494 #include <string.h>],
495 vasprintf)dnl
497 if test "$ac_cv_func_asnprintf" = yes; then
498 AC_NEED_PROTO([
499 #include <stdio.h>
500 #include <string.h>],
501 asnprintf)dnl
503 if test "$ac_cv_func_vasnprintf" = yes; then
504 AC_NEED_PROTO([
505 #include <stdio.h>
506 #include <string.h>],
507 vasnprintf)dnl
510 AC_BROKEN(chown copyhostent daemon err errx fchown flock fnmatch)
511 AC_BROKEN(freeaddrinfo freehostent gai_strerror getaddrinfo)
512 AC_BROKEN(getcwd getdtablesize gethostname getipnodebyaddr getipnodebyname)
513 AC_BROKEN(geteuid getgid getegid)
514 AC_BROKEN(getnameinfo getopt getusershell)
515 AC_BROKEN(inet_aton inet_ntop inet_pton initgroups innetgr iruserok lstat)
516 AC_BROKEN(memmove)
517 AC_BROKEN(mkstemp putenv rcmd readv recvmsg sendmsg setegid setenv seteuid)
518 AC_BROKEN(strcasecmp strncasecmp strdup strerror strftime)
519 AC_BROKEN(strlcat strlcpy strlwr)
520 AC_BROKEN(strndup strnlen strptime strsep strtok_r strupr)
521 AC_BROKEN(swab unsetenv verr verrx vsyslog)
522 AC_BROKEN(vwarn vwarnx warn warnx writev)
524 AC_NEED_PROTO([#include <stdlib.h>], setenv)
525 AC_NEED_PROTO([#include <stdlib.h>], unsetenv)
526 AC_NEED_PROTO([#include <unistd.h>], gethostname)
527 AC_NEED_PROTO([#include <unistd.h>], mkstemp)
528 AC_NEED_PROTO([#include <unistd.h>], getusershell)
530 AC_NEED_PROTO([
531 #ifdef HAVE_SYS_TYPES_H
532 #include <sys/types.h>
533 #endif
534 #ifdef HAVE_SYS_SOCKET_H
535 #include <sys/socket.h>
536 #endif
537 #ifdef HAVE_NETINET_IN_H
538 #include <netinet/in.h>
539 #endif
540 #ifdef HAVE_ARPA_INET_H
541 #include <arpa/inet.h>
542 #endif],
543 inet_aton)
545 AC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl
548 dnl libroken references crypt and dbopen
551 LIB_roken='$(top_builddir)/lib/roken/libroken.la $(LIB_crypt) $(LIB_dbopen)'
552 AC_SUBST(LIB_roken)dnl
554 AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
555 ac_cv_func_realloc_broken=no
556 AC_TRY_RUN([
557 #include <stddef.h>
558 #include <stdlib.h>
560 int main()
562         return realloc(NULL, 17) == NULL;
564 ],:, ac_cv_func_realloc_broken=yes, :)
566 if test "$ac_cv_func_realloc_broken" = yes ; then
567         AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.])
570 dnl AC_KRB_FUNC_GETCWD_BROKEN
573 dnl Checks for prototypes and declarations
576 AC_PROTO_COMPAT([
577 #ifdef HAVE_SYS_TYPES_H
578 #include <sys/types.h>
579 #endif
580 #ifdef HAVE_SYS_SOCKET_H
581 #include <sys/socket.h>
582 #endif
583 #ifdef HAVE_NETINET_IN_H
584 #include <netinet/in.h>
585 #endif
586 #ifdef HAVE_ARPA_INET_H
587 #include <arpa/inet.h>
588 #endif
589 #ifdef HAVE_NETDB_H
590 #include <netdb.h>
591 #endif
593 gethostbyname, struct hostent *gethostbyname(const char *))
595 AC_PROTO_COMPAT([
596 #ifdef HAVE_SYS_TYPES_H
597 #include <sys/types.h>
598 #endif
599 #ifdef HAVE_SYS_SOCKET_H
600 #include <sys/socket.h>
601 #endif
602 #ifdef HAVE_NETINET_IN_H
603 #include <netinet/in.h>
604 #endif
605 #ifdef HAVE_ARPA_INET_H
606 #include <arpa/inet.h>
607 #endif
608 #ifdef HAVE_NETDB_H
609 #include <netdb.h>
610 #endif
612 gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
614 AC_PROTO_COMPAT([
615 #ifdef HAVE_SYS_TYPES_H
616 #include <sys/types.h>
617 #endif
618 #ifdef HAVE_SYS_SOCKET_H
619 #include <sys/socket.h>
620 #endif
621 #ifdef HAVE_NETINET_IN_H
622 #include <netinet/in.h>
623 #endif
624 #ifdef HAVE_ARPA_INET_H
625 #include <arpa/inet.h>
626 #endif
627 #ifdef HAVE_NETDB_H
628 #include <netdb.h>
629 #endif
631 getservbyname, struct servent *getservbyname(const char *, const char *))
633 AC_PROTO_COMPAT([
634 #ifdef HAVE_SYSLOG_H
635 #include <syslog.h>
636 #endif
638 openlog, void openlog(const char *, int, int))
640 AC_NEED_PROTO([
641 #ifdef HAVE_CRYPT_H
642 #include <crypt.h>
643 #endif
644 #ifdef HAVE_UNISTD_H
645 #include <unistd.h>
646 #endif
648 crypt)
650 AC_NEED_PROTO([
651 #include <string.h>
653 strtok_r)
655 AC_NEED_PROTO([
656 #include <string.h>
658 strsep)
660 AC_CHECK_VAR([#ifdef HAVE_SYS_TYPES_H
661 #include <sys/types.h>
662 #endif
663 #ifdef HAVE_NETDB_H
664 #include <netdb.h>
665 #endif],
666 h_errno)
668 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
669 #include <netdb.h>
670 #endif],
671 h_errlist)
673 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
674 #include <netdb.h>
675 #endif],
676 h_nerr)
678 AC_CHECK_VAR([#ifdef HAVE_ERR_H
679 #include <err.h>
680 #endif],[__progname])
682 AC_CHECK_DECLARATION([#include <stdlib.h>
683 #ifdef HAVE_UNISTD_H
684 #include <unistd.h>
685 #endif], optarg)
686 AC_CHECK_DECLARATION([#include <stdlib.h>
687 #ifdef HAVE_UNISTD_H
688 #include <unistd.h>
689 #endif], optind)
690 AC_CHECK_DECLARATION([#include <stdlib.h>
691 #ifdef HAVE_UNISTD_H
692 #include <unistd.h>
693 #endif], opterr)
694 AC_CHECK_DECLARATION([#include <stdlib.h>
695 #ifdef HAVE_UNISTD_H
696 #include <unistd.h>
697 #endif], optopt)
699 AC_CHECK_DECLARATION([#include <stdlib.h>], environ)
702 dnl Check for fields in struct utmp
705 AC_HAVE_STRUCT_FIELD(struct utmp, ut_addr, [#include <utmp.h>])
706 AC_HAVE_STRUCT_FIELD(struct utmp, ut_host, [#include <utmp.h>])
707 AC_HAVE_STRUCT_FIELD(struct utmp, ut_id, [#include <utmp.h>])
708 AC_HAVE_STRUCT_FIELD(struct utmp, ut_pid, [#include <utmp.h>])
709 AC_HAVE_STRUCT_FIELD(struct utmp, ut_type, [#include <utmp.h>])
710 AC_HAVE_STRUCT_FIELD(struct utmp, ut_user, [#include <utmp.h>])
711 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_exit, [#include <utmpx.h>])
712 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_syslen, [#include <utmpx.h>])
715 dnl Check for fields in struct tm
718 AC_HAVE_STRUCT_FIELD(struct tm, tm_gmtoff, [#include <time.h>])
719 AC_HAVE_STRUCT_FIELD(struct tm, tm_zone, [#include <time.h>])
722 dnl or do we have a variable `timezone' ?
725 AC_CHECK_VAR(
726 [#include <time.h>],
727 timezone)
729 AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
731 AC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
733 AC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
735 AC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/socket.h>])
737 AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
740 dnl Check for struct winsize
743 AC_KRB_STRUCT_WINSIZE
746 dnl Check for struct spwd
749 AC_KRB_STRUCT_SPWD
752 dnl Check for sa_len in struct sockaddr
755 AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
756 #include <sys/socket.h>])
759 AC_GROK_TYPES(int8_t int16_t int32_t int64_t)
760 AC_GROK_TYPES(u_int8_t u_int16_t u_int32_t u_int64_t)
763 dnl Tests for editline
766 dnl el_init
768 AC_FIND_FUNC_NO_LIBS(el_init, edit, [], [], [$LIB_tgetent])
769 if test "$ac_cv_func_el_init" = yes ; then
770         AC_CACHE_CHECK(for four argument el_init, ac_cv_func_el_init_four,[
771                 AC_TRY_COMPILE([#include <stdio.h>
772                         #include <histedit.h>],
773                         [el_init("", NULL, NULL, NULL);],
774                         ac_cv_func_el_init_four=yes,
775                         ac_cv_func_el_init_four=no)])
776         if test "$ac_cv_func_el_init_four" = yes; then
777                 AC_DEFINE(HAVE_FOUR_VALUED_EL_INIT, 1, [Define if el_init takes four arguments.])
778         fi
781 dnl readline
783 ac_foo=no
784 if test "$with_readline" = yes; then
785         :
786 elif test "$ac_cv_func_readline" = yes; then
787         :
788 elif test "$ac_cv_func_el_init" = yes; then
789         ac_foo=yes
790         LIB_readline="\$(top_builddir)/lib/editline/libel_compat.a $LIB_el_init"
791 else
792         LIB_readline='$(top_builddir)/lib/editline/libeditline.a'
794 AM_CONDITIONAL(el_compat, test "$ac_foo" = yes)
795 if test "$readline_libdir"; then
796         LIB_readline="-rpath $readline_libdir $LIB_readline"
798 LIB_readline="$LIB_readline \$(LIB_tgetent)"
799 AC_DEFINE(HAVE_READLINE, 1, 
800         [Define if you have a readline compatible library.])dnl
802 dnl telnet muck --------------------------------------------------
804 AC_DEFINE(AUTHENTICATION, 1, 
805         [Define if you want authentication support in telnet.])dnl
806 AC_DEFINE(ENCRYPTION, 1,
807         [Define if you want encryption support in telnet.])dnl
808 AC_DEFINE(DES_ENCRYPTION, 1,
809         [Define if you want to use DES encryption in telnet.])dnl
810 AC_DEFINE(DIAGNOSTICS, 1,
811         [Define this to enable diagnostics in telnet.])dnl
812 AC_DEFINE(OLD_ENVIRON, 1,
813         [Define this to enable old environment option in telnet.])dnl
814 if false; then
815 AC_DEFINE(ENV_HACK, 1,
816         [Define this if you want support for broken ENV_{VAR,VAL} telnets.])
819 # Simple test for streamspty, based on the existance of getmsg(), alas
820 # this breaks on SunOS4 which have streams but BSD-like ptys
822 # And also something wierd has happend with dec-osf1, fallback to bsd-ptys
824 AC_MSG_CHECKING(for streamspty)
825 case "$host" in
826 *-*-aix3*|*-*-sunos4*|*-*-osf*|*-*-hpux10*)
827         krb_cv_sys_streamspty=no
828         ;;
830         krb_cv_sys_streamspty="$ac_cv_func_getmsg"
831         ;;
832 esac
833 if test "$krb_cv_sys_streamspty" = yes; then
834         AC_DEFINE(STREAMSPTY, 1, [Define if you have streams ptys.])
836 dnl AC_SUBST(STREAMSPTY)
837 AC_MSG_RESULT($krb_cv_sys_streamspty)
839 AC_AUTH_MODULES
841 dnl This is done by AC_OUTPUT but we need the result here.
843 test "x$prefix" = xNONE && prefix=$ac_default_prefix
844 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
846 for i in bin lib libexec sbin; do
847         i=${i}dir
848         foo=`echo $i | tr 'xindiscernible' 'XINDISCERNIBLE'`
849         x="\$${i}"
850         eval y="$x"
851         while test "x$y" != "x$x"; do
852                 x="$y"
853                 eval y="$x"
854         done
855         AC_DEFINE_UNQUOTED($foo,"$x")
856 done
858 if false; then
859         # hack to shut up automake
860         LIBOBJS="$LIBOBJS make-print-version.o"
862 LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/\.lo/g'`
863 AC_SUBST(LTLIBOBJS)
864 AC_OUTPUT(Makefile                      \
865         include/Makefile                \
866         include/kadm5/Makefile          \
867         lib/Makefile                    \
868         lib/45/Makefile                 \
869         lib/auth/Makefile               \
870         lib/auth/afskauthlib/Makefile   \
871         lib/auth/pam/Makefile           \
872         lib/auth/sia/Makefile           \
873         lib/asn1/Makefile               \
874         lib/com_err/Makefile            \
875         lib/des/Makefile                \
876         lib/editline/Makefile           \
877         lib/gssapi/Makefile             \
878         lib/hdb/Makefile                \
879         lib/kadm5/Makefile              \
880         lib/kafs/Makefile               \
881         lib/krb5/Makefile               \
882         lib/otp/Makefile                \
883         lib/roken/Makefile              \
884         lib/sl/Makefile                 \
885         kuser/Makefile                  \
886         kpasswd/Makefile                \
887         kadmin/Makefile                 \
888         admin/Makefile                  \
889         kdc/Makefile                    \
890         appl/Makefile                   \
891         appl/afsutil/Makefile           \
892         appl/ftp/Makefile               \
893         appl/ftp/common/Makefile        \
894         appl/ftp/ftp/Makefile           \
895         appl/ftp/ftpd/Makefile          \
896         appl/kauth/Makefile             \
897         appl/kx/Makefile                \
898         appl/login/Makefile             \
899         appl/otp/Makefile               \
900         appl/popper/Makefile            \
901         appl/push/Makefile              \
902         appl/rsh/Makefile               \
903         appl/su/Makefile                \
904         appl/xnlock/Makefile            \
905         appl/telnet/Makefile            \
906         appl/telnet/libtelnet/Makefile  \
907         appl/telnet/telnet/Makefile     \
908         appl/telnet/telnetd/Makefile    \
909         appl/test/Makefile              \
910         appl/kf/Makefile                \
911         doc/Makefile                    \
915 dnl This is the release version name-number[beta]
917 HEIMDALVERSION="$PACKAGE-$VERSION"
919 cat > include/newversion.h.in <<EOF
920 char *heimdal_long_version = "@(#)\$Version: $HEIMDALVERSION by @USER@ on @HOST@ ($host) @DATE@ \$";
921 char *heimdal_version = "$HEIMDALVERSION";
924 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
925         echo "include/version.h is unchanged"
926         rm -f include/newversion.h.in
927 else
928         echo "creating include/version.h"
929         User=${USER-${LOGNAME}}
930         Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
931         Date=`date`
932         mv -f include/newversion.h.in include/version.h.in
933         sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h