This commit was manufactured by cvs2svn to create tag
[heimdal.git] / configure.in
blob76371e158937d048938471cbfcd81b53ab15e379
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.1l)
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)
367 AC_FIND_FUNC(res_search, resolv,
369 #include <stdio.h>
370 #ifdef HAVE_SYS_TYPES_H
371 #include <sys/types.h>
372 #endif
373 #ifdef HAVE_NETINET_IN_H
374 #include <netinet/in.h>
375 #endif
376 #ifdef HAVE_ARPA_NAMESER_H
377 #include <arpa/nameser.h>
378 #endif
379 #ifdef HAVE_RESOLV_H
380 #include <resolv.h>
381 #endif
383 [0,0,0,0,0])
385 AC_FIND_FUNC(dn_expand, resolv,
387 #include <stdio.h>
388 #ifdef HAVE_SYS_TYPES_H
389 #include <sys/types.h>
390 #endif
391 #ifdef HAVE_NETINET_IN_H
392 #include <netinet/in.h>
393 #endif
394 #ifdef HAVE_ARPA_NAMESER_H
395 #include <arpa/nameser.h>
396 #endif
397 #ifdef HAVE_RESOLV_H
398 #include <resolv.h>
399 #endif
401 [0,0,0,0,0])
403 dnl Checks for library functions.
405 AC_BROKEN_SNPRINTF
406 AC_BROKEN_VSNPRINTF
408 AC_BROKEN_GLOB
410 if test "$ac_cv_func_glob_working" != yes; then
411         LIBOBJS="$LIBOBJS glob.o"
413 AM_CONDITIONAL(have_glob_h, test "$ac_cv_func_glob_working" = yes)
415 dnl these should happen after tests for *snprintf
417 AC_FIND_FUNC_NO_LIBS(dbopen, $berkeley_db)
418 AC_FIND_FUNC_NO_LIBS(dbm_firstkey, $berkeley_db gdbm ndbm)
420 DBLIB="$LIB_dbopen"
421 if test "$LIB_dbopen" != "$LIB_dbm_firstkey"; then
422         DBLIB="$DBLIB $LIB_dbm_firstkey"
424 AC_SUBST(DBLIB)dnl
426 AC_CHECK_FUNCS(_getpty _scrsize asnprintf asprintf fcntl)
427 AC_CHECK_FUNCS(getmsg getrlimit getspnam getspuid gettimeofday getuid)
428 AC_CHECK_FUNCS(grantpt mktime ptsname rand random)
429 AC_CHECK_FUNCS(revoke select setitimer setpcred setpgid)
430 AC_CHECK_FUNCS(setregid setresgid setresuid setreuid setutent)
431 AC_CHECK_FUNCS(setsid setsockopt sigaction strstr)
432 AC_CHECK_FUNCS(sysconf sysctl timegm ttyname ttyslot umask uname)
433 AC_CHECK_FUNCS(unlockpt vasnprintf vasprintf vhangup)
434 AC_CHECK_FUNCS(yp_get_default_domain)
436 AC_FUNC_GETLOGIN
438 AC_CHECK_GETPWNAM_R_POSIX
440 AC_FIND_FUNC_NO_LIBS(getsockopt, ,
441 [#ifdef HAVE_SYS_TYPES_H
442 #include <sys/types.h>
443 #endif
444 #ifdef HAVE_SYS_SOCKET_H
445 #include <sys/socket.h>
446 #endif],
447 [0,0,0,0,0])
448 AC_FIND_FUNC_NO_LIBS(setsockopt, ,
449 [#ifdef HAVE_SYS_TYPES_H
450 #include <sys/types.h>
451 #endif
452 #ifdef HAVE_SYS_SOCKET_H
453 #include <sys/socket.h>
454 #endif],
455 [0,0,0,0,0])
457 dnl Cray stuff
458 AC_CHECK_FUNCS(getudbnam setlim)
460 AC_TYPE_SIGNAL
461 if test "$ac_cv_type_signal" = "void" ; then
462         AC_DEFINE(VOID_RETSIGTYPE, 1, [Define if signal handlers return void.])
464 AC_SUBST(VOID_RETSIGTYPE)
466 AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
467 [#ifdef HAVE_NETDB_H
468 #include <netdb.h>
469 #endif],
471 if test "$ac_cv_func_hstrerror" = yes; then
472 AC_NEED_PROTO([
473 #ifdef HAVE_NETDB_H
474 #include <netdb.h>
475 #endif],
476 hstrerror)
479 dnl sigh, wish this could be done in a loop
480 if test "$ac_cv_func_asprintf" = yes; then
481 AC_NEED_PROTO([
482 #include <stdio.h>
483 #include <string.h>],
484 asprintf)dnl
486 if test "$ac_cv_func_vasprintf" = yes; then
487 AC_NEED_PROTO([
488 #include <stdio.h>
489 #include <string.h>],
490 vasprintf)dnl
492 if test "$ac_cv_func_asnprintf" = yes; then
493 AC_NEED_PROTO([
494 #include <stdio.h>
495 #include <string.h>],
496 asnprintf)dnl
498 if test "$ac_cv_func_vasnprintf" = yes; then
499 AC_NEED_PROTO([
500 #include <stdio.h>
501 #include <string.h>],
502 vasnprintf)dnl
505 AC_BROKEN(chown copyhostent daemon err errx fchown flock fnmatch freehostent)
506 AC_BROKEN(getcwd getdtablesize gethostname getipnodebyaddr getipnodebyname)
507 AC_BROKEN(geteuid getgid getegid)
508 AC_BROKEN(getopt getusershell)
509 AC_BROKEN(inet_aton inet_ntop inet_pton initgroups innetgr iruserok lstat)
510 AC_BROKEN(memmove)
511 AC_BROKEN(mkstemp putenv rcmd readv recvmsg sendmsg setegid setenv seteuid)
512 AC_BROKEN(strcasecmp strncasecmp strdup strerror strftime strlwr)
513 AC_BROKEN(strndup strnlen strsep strtok_r strupr)
514 AC_BROKEN(swab unsetenv verr verrx vsyslog)
515 AC_BROKEN(vwarn vwarnx warn warnx writev)
517 AC_NEED_PROTO([#include <stdlib.h>], setenv)
518 AC_NEED_PROTO([#include <stdlib.h>], unsetenv)
519 AC_NEED_PROTO([#include <unistd.h>], gethostname)
520 AC_NEED_PROTO([#include <unistd.h>], mkstemp)
521 AC_NEED_PROTO([#include <unistd.h>], getusershell)
523 AC_NEED_PROTO([
524 #ifdef HAVE_SYS_TYPES_H
525 #include <sys/types.h>
526 #endif
527 #ifdef HAVE_SYS_SOCKET_H
528 #include <sys/socket.h>
529 #endif
530 #ifdef HAVE_NETINET_IN_H
531 #include <netinet/in.h>
532 #endif
533 #ifdef HAVE_ARPA_INET_H
534 #include <arpa/inet.h>
535 #endif],
536 inet_aton)
538 AC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl
541 dnl libroken references crypt
544 LIB_roken='$(top_builddir)/lib/roken/libroken.la $(LIB_crypt)'
545 AC_SUBST(LIB_roken)dnl
547 AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
548 ac_cv_func_realloc_broken=no
549 AC_TRY_RUN([
550 #include <stddef.h>
551 #include <stdlib.h>
553 int main()
555         return realloc(NULL, 17) == NULL;
557 ],:, ac_cv_func_realloc_broken=yes, :)
559 if test "$ac_cv_func_realloc_broken" = yes ; then
560         AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.])
563 dnl AC_KRB_FUNC_GETCWD_BROKEN
566 dnl Checks for prototypes and declarations
569 AC_PROTO_COMPAT([
570 #ifdef HAVE_SYS_TYPES_H
571 #include <sys/types.h>
572 #endif
573 #ifdef HAVE_SYS_SOCKET_H
574 #include <sys/socket.h>
575 #endif
576 #ifdef HAVE_NETINET_IN_H
577 #include <netinet/in.h>
578 #endif
579 #ifdef HAVE_ARPA_INET_H
580 #include <arpa/inet.h>
581 #endif
582 #ifdef HAVE_NETDB_H
583 #include <netdb.h>
584 #endif
586 gethostbyname, struct hostent *gethostbyname(const char *))
588 AC_PROTO_COMPAT([
589 #ifdef HAVE_SYS_TYPES_H
590 #include <sys/types.h>
591 #endif
592 #ifdef HAVE_SYS_SOCKET_H
593 #include <sys/socket.h>
594 #endif
595 #ifdef HAVE_NETINET_IN_H
596 #include <netinet/in.h>
597 #endif
598 #ifdef HAVE_ARPA_INET_H
599 #include <arpa/inet.h>
600 #endif
601 #ifdef HAVE_NETDB_H
602 #include <netdb.h>
603 #endif
605 gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
607 AC_PROTO_COMPAT([
608 #ifdef HAVE_SYS_TYPES_H
609 #include <sys/types.h>
610 #endif
611 #ifdef HAVE_SYS_SOCKET_H
612 #include <sys/socket.h>
613 #endif
614 #ifdef HAVE_NETINET_IN_H
615 #include <netinet/in.h>
616 #endif
617 #ifdef HAVE_ARPA_INET_H
618 #include <arpa/inet.h>
619 #endif
620 #ifdef HAVE_NETDB_H
621 #include <netdb.h>
622 #endif
624 getservbyname, struct servent *getservbyname(const char *, const char *))
626 AC_PROTO_COMPAT([
627 #ifdef HAVE_SYSLOG_H
628 #include <syslog.h>
629 #endif
631 openlog, void openlog(const char *, int, int))
633 AC_NEED_PROTO([
634 #ifdef HAVE_CRYPT_H
635 #include <crypt.h>
636 #endif
637 #ifdef HAVE_UNISTD_H
638 #include <unistd.h>
639 #endif
641 crypt)
643 AC_NEED_PROTO([
644 #include <string.h>
646 strtok_r)
648 AC_NEED_PROTO([
649 #include <string.h>
651 strsep)
653 AC_CHECK_VAR([#ifdef HAVE_SYS_TYPES_H
654 #include <sys/types.h>
655 #endif
656 #ifdef HAVE_NETDB_H
657 #include <netdb.h>
658 #endif],
659 h_errno)
661 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
662 #include <netdb.h>
663 #endif],
664 h_errlist)
666 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
667 #include <netdb.h>
668 #endif],
669 h_nerr)
671 AC_CHECK_VAR([#ifdef HAVE_ERR_H
672 #include <err.h>
673 #endif],[__progname])
675 AC_CHECK_DECLARATION([#include <stdlib.h>], optarg)
676 AC_CHECK_DECLARATION([#include <stdlib.h>], optind)
677 AC_CHECK_DECLARATION([#include <stdlib.h>], opterr)
678 AC_CHECK_DECLARATION([#include <stdlib.h>], optopt)
680 AC_CHECK_DECLARATION([#include <stdlib.h>], environ)
683 dnl Check for fields in struct utmp
686 AC_HAVE_STRUCT_FIELD(struct utmp, ut_addr, [#include <utmp.h>])
687 AC_HAVE_STRUCT_FIELD(struct utmp, ut_host, [#include <utmp.h>])
688 AC_HAVE_STRUCT_FIELD(struct utmp, ut_id, [#include <utmp.h>])
689 AC_HAVE_STRUCT_FIELD(struct utmp, ut_pid, [#include <utmp.h>])
690 AC_HAVE_STRUCT_FIELD(struct utmp, ut_type, [#include <utmp.h>])
691 AC_HAVE_STRUCT_FIELD(struct utmp, ut_user, [#include <utmp.h>])
692 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_exit, [#include <utmpx.h>])
693 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_syslen, [#include <utmpx.h>])
695 AC_KRB_IPV6
697 AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
699 AC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/socket.h>])
702 dnl Check for struct winsize
705 AC_KRB_STRUCT_WINSIZE
708 dnl Check for struct spwd
711 AC_KRB_STRUCT_SPWD
714 dnl Check for sa_len in struct sockaddr
717 AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
718 #include <sys/socket.h>])
721 AC_GROK_TYPES(int8_t int16_t int32_t int64_t)
722 AC_GROK_TYPES(u_int8_t u_int16_t u_int32_t u_int64_t)
725 dnl Tests for editline
728 dnl el_init
730 AC_FIND_FUNC_NO_LIBS(el_init, edit)
731 if test "$ac_cv_func_el_init" = yes ; then
732         AC_CACHE_CHECK(for four argument el_init, ac_cv_func_el_init_four,[
733                 AC_TRY_COMPILE([#include <stdio.h>
734                         #include <histedit.h>],
735                         [el_init("", NULL, NULL, NULL);],
736                         ac_cv_func_el_init_four=yes,
737                         ac_cv_func_el_init_four=no)])
738         if test "$ac_cv_func_el_init_four" = yes; then
739                 AC_DEFINE(HAVE_FOUR_VALUED_EL_INIT, 1, [Define if el_init takes four arguments.])
740         fi
743 dnl readline
745 save_LIBS="$LIBS"
746 LIBS="$LIB_tgetent $LIBS"
747 AC_FIND_FUNC_NO_LIBS(readline, edit readline)
748 LIBS="$save_LIBS"
749 ac_foo=no
750 if test "$with_readline" = yes; then
751         :
752 elif test "$ac_cv_func_readline" = yes; then
753         :
754 elif test "$ac_cv_func_el_init" = yes; then
755         ac_foo=yes
756         LIB_readline="\$(top_builddir)/lib/editline/libel_compat.a $LIB_el_init"
757 else
758         LIB_readline='$(top_builddir)/lib/editline/libeditline.a'
760 AM_CONDITIONAL(el_compat, test "$ac_foo" = yes)
761 if test "$readline_libdir"; then
762         LIB_readline="-rpath $readline_libdir $LIB_readline"
764 LIB_readline="$LIB_readline \$(LIB_tgetent)"
765 AC_DEFINE(HAVE_READLINE, 1, 
766         [Define if you have a readline compatible library.])dnl
768 dnl telnet muck --------------------------------------------------
770 AC_DEFINE(AUTHENTICATION, 1, 
771         [Define if you want authentication support in telnet.])dnl
772 AC_DEFINE(ENCRYPTION, 1,
773         [Define if you want encryption support in telnet.])dnl
774 AC_DEFINE(DES_ENCRYPTION, 1,
775         [Define if you want to use DES encryption in telnet.])dnl
776 AC_DEFINE(DIAGNOSTICS, 1,
777         [Define this to enable diagnostics in telnet.])dnl
778 AC_DEFINE(OLD_ENVIRON, 1,
779         [Define this to enable old environment option in telnet.])dnl
780 if false; then
781 AC_DEFINE(ENV_HACK, 1,
782         [Define this if you want support for broken ENV_{VAR,VAL} telnets.])
785 # Simple test for streamspty, based on the existance of getmsg(), alas
786 # this breaks on SunOS4 which have streams but BSD-like ptys
788 # And also something wierd has happend with dec-osf1, fallback to bsd-ptys
790 AC_MSG_CHECKING(for streamspty)
791 case "$host" in
792 *-*-aix3*|*-*-sunos4*|*-*-osf*|*-*-hpux10*)
793         krb_cv_sys_streamspty=no
794         ;;
796         krb_cv_sys_streamspty="$ac_cv_func_getmsg"
797         ;;
798 esac
799 if test "$krb_cv_sys_streamspty" = yes; then
800         AC_DEFINE(STREAMSPTY, 1, [Define if you have streams ptys.])
802 dnl AC_SUBST(STREAMSPTY)
803 AC_MSG_RESULT($krb_cv_sys_streamspty)
805 AC_AUTH_MODULES
807 dnl This is done by AC_OUTPUT but we need the result here.
809 test "x$prefix" = xNONE && prefix=$ac_default_prefix
810 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
812 for i in bin lib libexec sbin; do
813         i=${i}dir
814         foo=`echo $i | tr 'xindiscernible' 'XINDISCERNIBLE'`
815         x="\$${i}"
816         eval y="$x"
817         while test "x$y" != "x$x"; do
818                 x="$y"
819                 eval y="$x"
820         done
821         AC_DEFINE_UNQUOTED($foo,"$x")
822 done
824 if false; then
825         # hack to shut up automake
826         LIBOBJS="$LIBOBJS make-print-version.o"
828 LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/\.lo/g'`
829 AC_SUBST(LTLIBOBJS)
830 AC_OUTPUT(Makefile                      \
831         include/Makefile                \
832         include/kadm5/Makefile          \
833         lib/Makefile                    \
834         lib/45/Makefile                 \
835         lib/auth/Makefile               \
836         lib/auth/afskauthlib/Makefile   \
837         lib/auth/pam/Makefile           \
838         lib/auth/sia/Makefile           \
839         lib/asn1/Makefile               \
840         lib/com_err/Makefile            \
841         lib/des/Makefile                \
842         lib/editline/Makefile           \
843         lib/gssapi/Makefile             \
844         lib/hdb/Makefile                \
845         lib/kadm5/Makefile              \
846         lib/kafs/Makefile               \
847         lib/krb5/Makefile               \
848         lib/otp/Makefile                \
849         lib/roken/Makefile              \
850         lib/sl/Makefile                 \
851         kuser/Makefile                  \
852         kpasswd/Makefile                \
853         kadmin/Makefile                 \
854         admin/Makefile                  \
855         kdc/Makefile                    \
856         appl/Makefile                   \
857         appl/afsutil/Makefile           \
858         appl/ftp/Makefile               \
859         appl/ftp/common/Makefile        \
860         appl/ftp/ftp/Makefile           \
861         appl/ftp/ftpd/Makefile          \
862         appl/kauth/Makefile             \
863         appl/kx/Makefile                \
864         appl/login/Makefile             \
865         appl/otp/Makefile               \
866         appl/popper/Makefile            \
867         appl/push/Makefile              \
868         appl/rsh/Makefile               \
869         appl/su/Makefile                \
870         appl/telnet/Makefile            \
871         appl/telnet/libtelnet/Makefile  \
872         appl/telnet/telnet/Makefile     \
873         appl/telnet/telnetd/Makefile    \
874         appl/test/Makefile              \
875         appl/kf/Makefile                \
876         doc/Makefile                    \
880 dnl This is the release version name-number[beta]
882 HEIMDALVERSION="$PACKAGE-$VERSION"
884 cat > include/newversion.h.in <<EOF
885 char *heimdal_long_version = "@(#)\$Version: $HEIMDALVERSION by @USER@ on @HOST@ ($host) @DATE@ \$";
886 char *heimdal_version = "$HEIMDALVERSION";
889 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
890         echo "include/version.h is unchanged"
891         rm -f include/newversion.h.in
892 else
893         echo "creating include/version.h"
894         User=${USER-${LOGNAME}}
895         Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
896         Date=`date`
897         mv -f include/newversion.h.in include/version.h.in
898         sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h