This commit was manufactured by cvs2svn to create tag
[heimdal.git] / configure.in
blobd9e4bb81ee419765fa20fa9fdbb6bdf0356a4172
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.1j)
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 dnl AC_PROG_AWK
55 dnl mawk seems to mishandle \# in lib/roken/roken.awk
56 AC_CHECK_PROGS(AWK, gawk nawk awk, )
57 AC_KRB_PROG_LN_S
59 AC_MIPS_ABI
60 CC="$CC $abi"
61 libdir="$libdir$abilibdirext"
63 AC_C___ATTRIBUTE__
65 AM_DISABLE_SHARED
66 AM_PROG_LIBTOOL
68 AC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
70 berkeley_db=db
71 AC_ARG_WITH(berkeley-db,
72 [  --without-berkeley-db   if you don't want berkeley db],[
73 if test "$withval" = no; then
74         berkeley_db=""
78 AC_TEST_PACKAGE_NEW(krb4,[#include <krb.h>],-lkrb,-ldes,/usr/athena)
80 LIB_kdb=
81 if test "$with_krb4" != "no"; then
82         EXTRA_LIB45=lib45.a
83         AC_SUBST(EXTRA_LIB45)
84         AC_CACHE_CHECK(for four valued krb_put_int, ac_cv_func_krb_put_int_four,
85                 [save_CFLAGS="$CFLAGS"
86                 CFLAGS="$CFLAGS $INCLUDE_krb4"
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                 CFLAGS="$save_CFLAGS"
93         ])
94         if test "$ac_cv_func_krb_put_int_four" = yes; then
95                 AC_DEFINE(HAVE_FOUR_VALUED_KRB_PUT_INT, 1,
96                         [Define if krb_put_int takes four arguments.])
97         fi
98         AC_CACHE_CHECK(for KRB_VERIFY_SECURE, ac_cv_func_krb_verify_secure,
99                 [save_CFLAGS="$CFLAGS"
100                 CFLAGS="$CFLAGS $INCLUDE_krb4"
101                 AC_TRY_COMPILE([#include <krb.h>],[
102                 int x = KRB_VERIFY_SECURE],
103                 ac_cv_func_krb_verify_secure=yes,
104                 ac_cv_func_krb_verify_secure=no)
105                 CFLAGS="$save_CFLAGS"
106         ])
107         if test "$ac_cv_func_krb_verify_secure" != yes; then
108                 AC_DEFINE(KRB_VERIFY_NOT_SECURE, 0,
109                         [Define to zero if your krb.h doesn't])
110                 AC_DEFINE(KRB_VERIFY_SECURE, 1,
111                         [Define to one if your krb.h doesn't])
112                 AC_DEFINE(KRB_VERIFY_SECURE_FAIL, 2,
113                         [Define to two if your krb.h doesn't])
114         fi
115         save_LIBS="$LIBS"
116         LIBS="$LIB_krb4 $LIBS"
117         AC_FIND_FUNC(krb_enable_debug)
118         AC_FIND_FUNC(krb_disable_debug)
119         LIBS="$save_LIBS"
120         LIB_kdb="-lkdb -lkrb"
121         if test "$krb4_libdir"; then
122                 LIB_krb4="-rpath $krb4_libdir $LIB_krb4"
123                 LIB_kdb="-rpath $krb4_libdir -L$krb4_libdir $LIB_kdb"
124         fi
126 AM_CONDITIONAL(KRB4, test "$with_krb4" != "no")
127 AM_CONDITIONAL(KRB5, true)
128 AC_DEFINE(KRB5, 1, [Enable Kerberos 5 support in applications.])dnl
129 AC_SUBST(LIB_kdb)dnl
130 AM_CONDITIONAL(AIX, test "$aix" != no)dnl
131 AM_CONDITIONAL(AIX4, test "$aix" = 4)
132 aix_dynamic_afs=yes
133 AM_CONDITIONAL(AIX_DYNAMIC_AFS, test "$aix_dynamic_afs" = yes)dnl
135 AC_FIND_FUNC_NO_LIBS(dlopen, dl)
137 if test "$aix" != no; then
138         if test "$aix_dynamic_afs" = yes; then
139                 if test "$ac_cv_funclib_dlopen" = yes; then
140                         AIX_EXTRA_KAFS=
141                 elif test "$ac_cv_funclib_dlopen" != no; then
142                         AIX_EXTRA_KAFS="$ac_cv_funclib_dlopen"
143                 else
144                         AIX_EXTRA_KAFS=-lld
145                 fi
146         else
147                 AIX_EXTRA_KAFS=
148         fi
151 AM_CONDITIONAL(HAVE_DLOPEN, test "$ac_cv_funclib_dlopen" != no)dnl
152 AC_SUBST(AFS_EXTRA_LD)dnl
153 AC_SUBST(AIX_EXTRA_KAFS)dnl
155 AC_ARG_ENABLE(kaserver,
156 [  --enable-kaserver      if you want the KDC to try to emulate a kaserver])
157 if test "$enable_kaserver" = yes; then
158         AC_DEFINE(KASERVER, 1,
159                 [Define if you want to use the KDC as a kaserver.])
160         if test "$with_krb4" = "no"; then
161                 AC_MSG_ERROR(kaserver requires krb4)
162                 exit 1
163         fi
166 AC_ARG_ENABLE(kaserver-db,
167 [  --enable-kaserver-db   if you want support for reading kaserver databases in hprop])
168 if test "$enable_kaserver_db" = yes; then
169         AC_DEFINE(KASERVER_DB, 1,
170                 [Define if you want support in hprop for reading kaserver databases])
171         if test "$with_krb4" = "no"; then
172                 AC_MSG_ERROR(kaserver-db requires krb4)
173                 exit 1
174         fi
177 otp=yes
178 AC_ARG_ENABLE(otp,
179 [  --disable-otp          if you don't want OTP support],
181 if test "$enableval" = "no"; then
182         otp=no
185 if test "$otp" = "yes"; then
186         AC_DEFINE(OTP, 1, [Define if you want OTP support in applications.])
187         LIB_otp='$(top_builddir)/lib/otp/libotp.la'
189 AC_SUBST(LIB_otp)
190 AM_CONDITIONAL(OTP, test "$otp" = yes)dnl
192 AC_CHECK_OSFC2
194 new_des3_code=no
195 AC_ARG_ENABLE(new-des3-code,
196 [  --enable-new-des3-code to make new key-deriving des3 the default],
198 if test "$enableval" = "yes"; then
199         new_des3_code=yes
202 if test "$new_des3_code" = "yes"; then
203         AC_DEFINE(NEW_DES3_CODE, 1, 
204                 [Define if you want to enable new triple-DES code])
207 AC_CHECK_MAN
209 AC_TEST_PACKAGE_NEW(readline,
210 [#include <stdio.h>
211  #include <readline.h>],-lreadline)
213 AC_TEST_PACKAGE_NEW(hesiod,[#include <hesiod.h>],-lhesiod)
215 AC_C_BIGENDIAN
216 AC_C_INLINE
218 KRB_CHECK_X
220 if test "$no_x" = "yes" ; then
221         MAKE_X_PROGS_BIN_PROGS=""
222         MAKE_X_PROGS_BIN_SCRPTS=""
223         MAKE_X_PROGS_LIBEXEC_PROGS=""
224 else
225         MAKE_X_PROGS_BIN_PROGS='$(X_PROGS_BIN_PROGS)'
226         MAKE_X_PROGS_BIN_SCRPTS='$(X_PROGS_BIN_SCRPTS)'
227         MAKE_X_PROGS_LIBEXEC_PROGS='$(X_PROGS_LIBEXEC_PROGS)'
229 AC_SUBST(MAKE_X_PROGS_BIN_PROGS)dnl
230 AC_SUBST(MAKE_X_PROGS_BIN_SCRPTS)dnl
231 AC_SUBST(MAKE_X_PROGS_LIBEXEC_PROGS)dnl
233 AC_CHECK_XAU
235 dnl AM_C_PROTOTYPES
237 dnl Checks for typedefs, structures, and compiler characteristics.
238 AC_C_CONST
239 AC_TYPE_OFF_T
240 AC_TYPE_SIZE_T
241 AC_CHECK_TYPE_EXTRA(ssize_t, int, [#include <unistd.h>])
242 AC_TYPE_PID_T
243 AC_TYPE_UID_T
244 AC_CHECK_TYPE_EXTRA(mode_t, unsigned short, [])
245 AC_CHECK_TYPE_EXTRA(sig_atomic_t, int, [#include <signal.h>])
246 AC_HEADER_TIME
247 AC_STRUCT_TM
249 dnl Checks for header files.
250 AC_HEADER_STDC
252 AC_CHECK_HEADERS([\
253         arpa/ftp.h                              \
254         arpa/inet.h                             \
255         arpa/nameser.h                          \
256         arpa/telnet.h                           \
257         bind/bitypes.h                          \
258         bsdsetjmp.h                             \
259         crypt.h                                 \
260         curses.h                                \
261         db.h                                    \
262         db_185.h                                \
263         dbm.h                                   \
264         dirent.h                                \
265         dlfcn.h                                 \
266         err.h                                   \
267         errno.h                                 \
268         fcntl.h                                 \
269         fnmatch.h                               \
270         grp.h                                   \
271         inttypes.h                              \
272         io.h                                    \
273         limits.h                                \
274         maillock.h                              \
275         ndbm.h                                  \
276         net/if.h                                \
277         netdb.h                                 \
278         netinet/in.h                            \
279         netinet/in6.h                           \
280         netinet/in6_machtypes.h                 \
281         netinet/in6_var.h                       \
282         netinet/in_systm.h                      \
283         netinet6/in6.h                          \
284         netinfo/ni.h                            \
285         paths.h                                 \
286         pty.h                                   \
287         pwd.h                                   \
288         resolv.h                                \
289         rpcsvc/dbm.h                            \
290         sac.h                                   \
291         security/pam_modules.h                  \
292         sgtty.h                                 \
293         shadow.h                                \
294         siad.h                                  \
295         signal.h                                \
296         stropts.h                               \
297         sys/bitypes.h                           \
298         sys/category.h                          \
299         sys/file.h                              \
300         sys/filio.h                             \
301         sys/ioccom.h                            \
302         sys/ioctl.h                             \
303         sys/param.h                             \
304         sys/proc.h                              \
305         sys/pty.h                               \
306         sys/ptyio.h                             \
307         sys/ptyvar.h                            \
308         sys/resource.h                          \
309         sys/select.h                            \
310         sys/socket.h                            \
311         sys/sockio.h                            \
312         sys/stat.h                              \
313         sys/str_tty.h                           \
314         sys/stream.h                            \
315         sys/stropts.h                           \
316         sys/strtty.h                            \
317         sys/syscall.h                           \
318         sys/sysctl.h                            \
319         sys/termio.h                            \
320         sys/time.h                              \
321         sys/timeb.h                             \
322         sys/times.h                             \
323         sys/tty.h                               \
324         sys/types.h                             \
325         sys/uio.h                               \
326         sys/un.h                                \
327         sys/utsname.h                           \
328         sys/wait.h                              \
329         syslog.h                                \
330         term.h                                  \
331         termio.h                                \
332         termios.h                               \
333         time.h                                  \
334         tmpdir.h                                \
335         udb.h                                   \
336         unistd.h                                \
337         util.h                                  \
338         utmp.h                                  \
339         utmpx.h                                 \
342 CHECK_NETINET_IP_AND_TCP
345 AC_ARG_ENABLE(netinfo,
346 [  --enable-netinfo      enable netinfo for configuration lookup])
348 if test "$ac_cv_header_netinfo_ni_h" = yes -a "$enable_netinfo" = yes; then
349        AC_DEFINE(HAVE_NETINFO, 1,
350                [Define if you want to use Netinfo instead of krb5.conf.])
353 AM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes)
354 AM_CONDITIONAL(have_fnmatch_h, test "$ac_cv_header_fnmatch_h" = yes)
357 dnl Checks for libraries.
359 AC_FIND_FUNC(socket, socket)
360 AC_FIND_FUNC(gethostbyname, nsl)
361 AC_FIND_FUNC(syslog, syslog)
363 AC_FIND_FUNC_NO_LIBS(logwtmp, util)
364 AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses)
365 AC_FIND_FUNC(gethostbyname2, inet6 ip6)
366 AC_FIND_FUNC(inet_ntop, inet6 ip6)
367 AC_CHECK_FUNCS(inet_pton)
369 AC_FIND_FUNC(res_search, resolv,
371 #include <stdio.h>
372 #ifdef HAVE_SYS_TYPES_H
373 #include <sys/types.h>
374 #endif
375 #ifdef HAVE_NETINET_IN_H
376 #include <netinet/in.h>
377 #endif
378 #ifdef HAVE_ARPA_NAMESER_H
379 #include <arpa/nameser.h>
380 #endif
381 #ifdef HAVE_RESOLV_H
382 #include <resolv.h>
383 #endif
385 [0,0,0,0,0])
387 AC_FIND_FUNC(dn_expand, resolv,
389 #include <stdio.h>
390 #ifdef HAVE_SYS_TYPES_H
391 #include <sys/types.h>
392 #endif
393 #ifdef HAVE_NETINET_IN_H
394 #include <netinet/in.h>
395 #endif
396 #ifdef HAVE_ARPA_NAMESER_H
397 #include <arpa/nameser.h>
398 #endif
399 #ifdef HAVE_RESOLV_H
400 #include <resolv.h>
401 #endif
403 [0,0,0,0,0])
405 dnl Checks for library functions.
407 AC_BROKEN_SNPRINTF
408 AC_BROKEN_VSNPRINTF
410 AC_BROKEN_GLOB
412 if test "$ac_cv_func_glob_working" != yes; then
413         LIBOBJS="$LIBOBJS glob.o"
415 AM_CONDITIONAL(have_glob_h, test "$ac_cv_func_glob_working" = yes)
417 dnl these should happen after tests for *snprintf
419 AC_FIND_FUNC_NO_LIBS(dbopen, $berkeley_db)
420 AC_FIND_FUNC_NO_LIBS(dbm_firstkey, $berkeley_db gdbm ndbm)
422 DBLIB="$LIB_dbopen"
423 if test "$LIB_dbopen" != "$LIB_dbm_firstkey"; then
424         DBLIB="$DBLIB $LIB_dbm_firstkey"
426 AC_SUBST(DBLIB)dnl
428 AC_CHECK_FUNCS(_getpty _scrsize asnprintf asprintf fcntl)
429 AC_CHECK_FUNCS(getmsg getrlimit getspnam getspuid gettimeofday getuid)
430 AC_CHECK_FUNCS(grantpt mktime ptsname rand random)
431 AC_CHECK_FUNCS(revoke select setitimer setpcred setpgid)
432 AC_CHECK_FUNCS(setregid setresgid setresuid setreuid setutent)
433 AC_CHECK_FUNCS(setsid setsockopt sigaction strstr)
434 AC_CHECK_FUNCS(sysconf sysctl timegm ttyname ttyslot umask uname)
435 AC_CHECK_FUNCS(unlockpt vasnprintf vasprintf vhangup)
436 AC_CHECK_FUNCS(yp_get_default_domain)
438 AC_FUNC_GETLOGIN
440 AC_CHECK_GETPWNAM_R_POSIX
442 AC_FIND_FUNC_NO_LIBS(getsockopt, ,
443 [#ifdef HAVE_SYS_TYPES_H
444 #include <sys/types.h>
445 #endif
446 #ifdef HAVE_SYS_SOCKET_H
447 #include <sys/socket.h>
448 #endif],
449 [0,0,0,0,0])
450 AC_FIND_FUNC_NO_LIBS(setsockopt, ,
451 [#ifdef HAVE_SYS_TYPES_H
452 #include <sys/types.h>
453 #endif
454 #ifdef HAVE_SYS_SOCKET_H
455 #include <sys/socket.h>
456 #endif],
457 [0,0,0,0,0])
459 dnl Cray stuff
460 AC_CHECK_FUNCS(getudbnam setlim)
462 AC_TYPE_SIGNAL
463 if test "$ac_cv_type_signal" = "void" ; then
464         AC_DEFINE(VOID_RETSIGTYPE, 1, [Define if signal handlers return void.])
466 AC_SUBST(VOID_RETSIGTYPE)
468 AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
469 [#ifdef HAVE_NETDB_H
470 #include <netdb.h>
471 #endif],
473 if test "$ac_cv_func_hstrerror" = yes; then
474 AC_NEED_PROTO([
475 #ifdef HAVE_NETDB_H
476 #include <netdb.h>
477 #endif],
478 hstrerror)
481 dnl sigh, wish this could be done in a loop
482 if test "$ac_cv_func_asprintf" = yes; then
483 AC_NEED_PROTO([
484 #include <stdio.h>
485 #include <string.h>],
486 asprintf)dnl
488 if test "$ac_cv_func_vasprintf" = yes; then
489 AC_NEED_PROTO([
490 #include <stdio.h>
491 #include <string.h>],
492 vasprintf)dnl
494 if test "$ac_cv_func_asnprintf" = yes; then
495 AC_NEED_PROTO([
496 #include <stdio.h>
497 #include <string.h>],
498 asnprintf)dnl
500 if test "$ac_cv_func_vasnprintf" = yes; then
501 AC_NEED_PROTO([
502 #include <stdio.h>
503 #include <string.h>],
504 vasnprintf)dnl
507 AC_BROKEN(chown copyhostent daemon err errx fchown flock fnmatch freehostent)
508 AC_BROKEN(getcwd getdtablesize gethostname getipnodebyaddr getipnodebyname)
509 AC_BROKEN(geteuid getgid getegid)
510 AC_BROKEN(getopt getusershell)
511 AC_BROKEN(inet_aton initgroups innetgr iruserok lstat memmove)
512 AC_BROKEN(mkstemp putenv rcmd readv recvmsg sendmsg setegid setenv seteuid)
513 AC_BROKEN(strcasecmp strncasecmp strdup strerror strftime strlwr)
514 AC_BROKEN(strndup strnlen strsep strtok_r strupr)
515 AC_BROKEN(swab unsetenv verr verrx vsyslog)
516 AC_BROKEN(vwarn vwarnx warn warnx writev)
518 AC_NEED_PROTO([#include <stdlib.h>], setenv)
519 AC_NEED_PROTO([#include <stdlib.h>], unsetenv)
520 AC_NEED_PROTO([#include <unistd.h>], gethostname)
521 AC_NEED_PROTO([#include <unistd.h>], mkstemp)
522 AC_NEED_PROTO([#include <unistd.h>], getusershell)
524 AC_NEED_PROTO([
525 #ifdef HAVE_SYS_TYPES_H
526 #include <sys/types.h>
527 #endif
528 #ifdef HAVE_SYS_SOCKET_H
529 #include <sys/socket.h>
530 #endif
531 #ifdef HAVE_NETINET_IN_H
532 #include <netinet/in.h>
533 #endif
534 #ifdef HAVE_ARPA_INET_H
535 #include <arpa/inet.h>
536 #endif],
537 inet_aton)
539 AC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl
542 dnl libroken references crypt
545 LIB_roken='$(top_builddir)/lib/roken/libroken.la $(LIB_crypt)'
546 AC_SUBST(LIB_roken)dnl
548 AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
549 ac_cv_func_realloc_broken=no
550 AC_TRY_RUN([
551 #include <stddef.h>
552 #include <stdlib.h>
554 int main()
556         return realloc(NULL, 17) == NULL;
558 ],:, ac_cv_func_realloc_broken=yes, :)
560 if test "$ac_cv_func_realloc_broken" = yes ; then
561         AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.])
564 dnl AC_KRB_FUNC_GETCWD_BROKEN
567 dnl Checks for prototypes and declarations
570 AC_PROTO_COMPAT([
571 #ifdef HAVE_SYS_TYPES_H
572 #include <sys/types.h>
573 #endif
574 #ifdef HAVE_SYS_SOCKET_H
575 #include <sys/socket.h>
576 #endif
577 #ifdef HAVE_NETINET_IN_H
578 #include <netinet/in.h>
579 #endif
580 #ifdef HAVE_ARPA_INET_H
581 #include <arpa/inet.h>
582 #endif
583 #ifdef HAVE_NETDB_H
584 #include <netdb.h>
585 #endif
587 gethostbyname, struct hostent *gethostbyname(const char *))
589 AC_PROTO_COMPAT([
590 #ifdef HAVE_SYS_TYPES_H
591 #include <sys/types.h>
592 #endif
593 #ifdef HAVE_SYS_SOCKET_H
594 #include <sys/socket.h>
595 #endif
596 #ifdef HAVE_NETINET_IN_H
597 #include <netinet/in.h>
598 #endif
599 #ifdef HAVE_ARPA_INET_H
600 #include <arpa/inet.h>
601 #endif
602 #ifdef HAVE_NETDB_H
603 #include <netdb.h>
604 #endif
606 gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
608 AC_PROTO_COMPAT([
609 #ifdef HAVE_SYS_TYPES_H
610 #include <sys/types.h>
611 #endif
612 #ifdef HAVE_SYS_SOCKET_H
613 #include <sys/socket.h>
614 #endif
615 #ifdef HAVE_NETINET_IN_H
616 #include <netinet/in.h>
617 #endif
618 #ifdef HAVE_ARPA_INET_H
619 #include <arpa/inet.h>
620 #endif
621 #ifdef HAVE_NETDB_H
622 #include <netdb.h>
623 #endif
625 getservbyname, struct servent *getservbyname(const char *, const char *))
627 AC_PROTO_COMPAT([
628 #ifdef HAVE_SYSLOG_H
629 #include <syslog.h>
630 #endif
632 openlog, void openlog(const char *, int, int))
634 AC_NEED_PROTO([
635 #ifdef HAVE_CRYPT_H
636 #include <crypt.h>
637 #endif
638 #ifdef HAVE_UNISTD_H
639 #include <unistd.h>
640 #endif
642 crypt)
644 AC_NEED_PROTO([
645 #include <string.h>
647 strtok_r)
649 AC_NEED_PROTO([
650 #include <string.h>
652 strsep)
654 AC_CHECK_VAR([#ifdef HAVE_SYS_TYPES_H
655 #include <sys/types.h>
656 #endif
657 #ifdef HAVE_NETDB_H
658 #include <netdb.h>
659 #endif],
660 h_errno)
662 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
663 #include <netdb.h>
664 #endif],
665 h_errlist)
667 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
668 #include <netdb.h>
669 #endif],
670 h_nerr)
672 AC_CHECK_VAR([#ifdef HAVE_ERR_H
673 #include <err.h>
674 #endif],[__progname])
676 AC_CHECK_DECLARATION([#include <stdlib.h>], optarg)
677 AC_CHECK_DECLARATION([#include <stdlib.h>], optind)
678 AC_CHECK_DECLARATION([#include <stdlib.h>], opterr)
679 AC_CHECK_DECLARATION([#include <stdlib.h>], optopt)
681 AC_CHECK_DECLARATION([#include <stdlib.h>], environ)
684 dnl Check for fields in struct utmp
687 AC_HAVE_STRUCT_FIELD(struct utmp, ut_addr, [#include <utmp.h>])
688 AC_HAVE_STRUCT_FIELD(struct utmp, ut_host, [#include <utmp.h>])
689 AC_HAVE_STRUCT_FIELD(struct utmp, ut_id, [#include <utmp.h>])
690 AC_HAVE_STRUCT_FIELD(struct utmp, ut_pid, [#include <utmp.h>])
691 AC_HAVE_STRUCT_FIELD(struct utmp, ut_type, [#include <utmp.h>])
692 AC_HAVE_STRUCT_FIELD(struct utmp, ut_user, [#include <utmp.h>])
693 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_exit, [#include <utmpx.h>])
694 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_syslen, [#include <utmpx.h>])
696 AC_KRB_IPV6
698 AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
700 AC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/socket.h>])
703 dnl Check for struct winsize
706 AC_KRB_STRUCT_WINSIZE
709 dnl Check for struct spwd
712 AC_KRB_STRUCT_SPWD
715 dnl Check for sa_len in struct sockaddr
718 AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
719 #include <sys/socket.h>])
722 AC_GROK_TYPES(int8_t int16_t int32_t int64_t)
723 AC_GROK_TYPES(u_int8_t u_int16_t u_int32_t u_int64_t)
726 dnl Tests for editline
729 dnl el_init
731 AC_FIND_FUNC_NO_LIBS(el_init, edit)
732 if test "$ac_cv_func_el_init" = yes ; then
733         AC_CACHE_CHECK(for four argument el_init, ac_cv_func_el_init_four,[
734                 AC_TRY_COMPILE([#include <stdio.h>
735                         #include <histedit.h>],
736                         [el_init("", NULL, NULL, NULL);],
737                         ac_cv_func_el_init_four=yes,
738                         ac_cv_func_el_init_four=no)])
739         if test "$ac_cv_func_el_init_four" = yes; then
740                 AC_DEFINE(HAVE_FOUR_VALUED_EL_INIT, 1, [Define if el_init takes four arguments.])
741         fi
744 dnl readline
746 save_LIBS="$LIBS"
747 LIBS="$LIB_tgetent $LIBS"
748 AC_FIND_FUNC_NO_LIBS(readline, edit readline)
749 LIBS="$save_LIBS"
750 ac_foo=no
751 if test "$with_readline" = yes; then
752         :
753 elif test "$ac_cv_func_readline" = yes; then
754         :
755 elif test "$ac_cv_func_el_init" = yes; then
756         ac_foo=yes
757         LIB_readline="\$(top_builddir)/lib/editline/libel_compat.a $LIB_el_init"
758 else
759         LIB_readline='$(top_builddir)/lib/editline/libeditline.a'
761 AM_CONDITIONAL(el_compat, test "$ac_foo" = yes)
762 if test "$readline_libdir"; then
763         LIB_readline="-rpath $readline_libdir $LIB_readline"
765 LIB_readline="$LIB_readline \$(LIB_tgetent)"
766 AC_DEFINE(HAVE_READLINE, 1, 
767         [Define if you have a readline compatible library.])dnl
769 dnl telnet muck --------------------------------------------------
771 AC_DEFINE(AUTHENTICATION, 1, 
772         [Define if you want authentication support in telnet.])dnl
773 AC_DEFINE(ENCRYPTION, 1,
774         [Define if you want encryption support in telnet.])dnl
775 AC_DEFINE(DES_ENCRYPTION, 1,
776         [Define if you want to use DES encryption in telnet.])dnl
777 AC_DEFINE(DIAGNOSTICS, 1,
778         [Define this to enable diagnostics in telnet.])dnl
779 AC_DEFINE(OLD_ENVIRON, 1,
780         [Define this to enable old environment option in telnet.])dnl
781 if false; then
782 AC_DEFINE(ENV_HACK, 1,
783         [Define this if you want support for broken ENV_{VAR,VAL} telnets.])
786 # Simple test for streamspty, based on the existance of getmsg(), alas
787 # this breaks on SunOS4 which have streams but BSD-like ptys
789 # And also something wierd has happend with dec-osf1, fallback to bsd-ptys
791 AC_MSG_CHECKING(for streamspty)
792 case "$host" in
793 *-*-aix3*|*-*-sunos4*|*-*-osf*|*-*-hpux10*)
794         krb_cv_sys_streamspty=no
795         ;;
797         krb_cv_sys_streamspty="$ac_cv_func_getmsg"
798         ;;
799 esac
800 if test "$krb_cv_sys_streamspty" = yes; then
801         AC_DEFINE(STREAMSPTY, 1, [Define if you have streams ptys.])
803 dnl AC_SUBST(STREAMSPTY)
804 AC_MSG_RESULT($krb_cv_sys_streamspty)
806 AC_AUTH_MODULES
808 dnl This is done by AC_OUTPUT but we need the result here.
810 test "x$prefix" = xNONE && prefix=$ac_default_prefix
811 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
813 for i in bin lib libexec sbin; do
814         i=${i}dir
815         foo=`echo $i | tr 'xindiscernible' 'XINDISCERNIBLE'`
816         x="\$${i}"
817         eval y="$x"
818         while test "x$y" != "x$x"; do
819                 x="$y"
820                 eval y="$x"
821         done
822         AC_DEFINE_UNQUOTED($foo,"$x")
823 done
825 if false; then
826         # hack to shut up automake
827         LIBOBJS="$LIBOBJS make-print-version.o"
829 LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/\.lo/g'`
830 AC_SUBST(LTLIBOBJS)
831 AC_OUTPUT(Makefile                      \
832         include/Makefile                \
833         include/kadm5/Makefile          \
834         lib/Makefile                    \
835         lib/45/Makefile                 \
836         lib/auth/Makefile               \
837         lib/auth/afskauthlib/Makefile   \
838         lib/auth/pam/Makefile           \
839         lib/auth/sia/Makefile           \
840         lib/asn1/Makefile               \
841         lib/com_err/Makefile            \
842         lib/des/Makefile                \
843         lib/editline/Makefile           \
844         lib/gssapi/Makefile             \
845         lib/hdb/Makefile                \
846         lib/kadm5/Makefile              \
847         lib/kafs/Makefile               \
848         lib/krb5/Makefile               \
849         lib/otp/Makefile                \
850         lib/roken/Makefile              \
851         lib/sl/Makefile                 \
852         kuser/Makefile                  \
853         kpasswd/Makefile                \
854         kadmin/Makefile                 \
855         admin/Makefile                  \
856         kdc/Makefile                    \
857         appl/Makefile                   \
858         appl/afsutil/Makefile           \
859         appl/ftp/Makefile               \
860         appl/ftp/common/Makefile        \
861         appl/ftp/ftp/Makefile           \
862         appl/ftp/ftpd/Makefile          \
863         appl/kauth/Makefile             \
864         appl/kx/Makefile                \
865         appl/login/Makefile             \
866         appl/otp/Makefile               \
867         appl/popper/Makefile            \
868         appl/push/Makefile              \
869         appl/rsh/Makefile               \
870         appl/su/Makefile                \
871         appl/telnet/Makefile            \
872         appl/telnet/libtelnet/Makefile  \
873         appl/telnet/telnet/Makefile     \
874         appl/telnet/telnetd/Makefile    \
875         appl/test/Makefile              \
876         appl/kf/Makefile                \
877         doc/Makefile                    \
881 dnl This is the release version name-number[beta]
883 HEIMDALVERSION="$PACKAGE-$VERSION"
885 cat > include/newversion.h.in <<EOF
886 char *heimdal_long_version = "@(#)\$Version: $HEIMDALVERSION by @USER@ on @HOST@ ($host) @DATE@ \$";
887 char *heimdal_version = "$HEIMDALVERSION";
890 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
891         echo "include/version.h is unchanged"
892         rm -f include/newversion.h.in
893 else
894         echo "creating include/version.h"
895         User=${USER-${LOGNAME}}
896         Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
897         Date=`date`
898         mv -f include/newversion.h.in include/version.h.in
899         sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h