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)
12 AC_SUBST(CANONICAL_HOST)
26 if test "$sunos" != no; then
27 AC_DEFINE_UNQUOTED(SunOS, $sunos,
28 [Define to what version of SunOS you are running.])
41 test -z "$CFLAGS" && CFLAGS="-g"
43 dnl Checks for programs.
55 dnl mawk seems to mishandle \# in lib/roken/roken.awk
56 AC_CHECK_PROGS(AWK, gawk nawk awk, )
61 libdir="$libdir$abilibdirext"
68 AC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
71 AC_ARG_WITH(berkeley-db,
72 [ --without-berkeley-db if you don't want berkeley db],[
73 if test "$withval" = no; then
78 AC_TEST_PACKAGE_NEW(krb4,[#include <krb.h>],-lkrb,-ldes,/usr/athena)
81 if test "$with_krb4" != "no"; then
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>],[
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)
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.])
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"
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])
116 LIBS="$LIB_krb4 $LIBS"
117 AC_FIND_FUNC(krb_enable_debug)
118 AC_FIND_FUNC(krb_disable_debug)
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"
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
130 AM_CONDITIONAL(AIX, test "$aix" != no)dnl
131 AM_CONDITIONAL(AIX4, test "$aix" = 4)
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
141 elif test "$ac_cv_funclib_dlopen" != no; then
142 AIX_EXTRA_KAFS="$ac_cv_funclib_dlopen"
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)
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)
179 [ --disable-otp if you don't want OTP support],
181 if test "$enableval" = "no"; then
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'
190 AM_CONDITIONAL(OTP, test "$otp" = yes)dnl
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
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])
209 AC_TEST_PACKAGE_NEW(readline,
211 #include <readline.h>],-lreadline)
213 AC_TEST_PACKAGE_NEW(hesiod,[#include <hesiod.h>],-lhesiod)
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=""
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
237 dnl Checks for typedefs, structures, and compiler characteristics.
241 AC_CHECK_TYPE_EXTRA(ssize_t, int, [#include <unistd.h>])
244 AC_CHECK_TYPE_EXTRA(mode_t, unsigned short, [])
245 AC_CHECK_TYPE_EXTRA(sig_atomic_t, int, [#include <signal.h>])
249 dnl Checks for header files.
280 netinet/in6_machtypes.h \
291 security/pam_modules.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,
370 #ifdef HAVE_SYS_TYPES_H
371 #include <sys/types.h>
373 #ifdef HAVE_NETINET_IN_H
374 #include <netinet/in.h>
376 #ifdef HAVE_ARPA_NAMESER_H
377 #include <arpa/nameser.h>
385 AC_FIND_FUNC(dn_expand, resolv,
388 #ifdef HAVE_SYS_TYPES_H
389 #include <sys/types.h>
391 #ifdef HAVE_NETINET_IN_H
392 #include <netinet/in.h>
394 #ifdef HAVE_ARPA_NAMESER_H
395 #include <arpa/nameser.h>
403 dnl Checks for library functions.
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)
421 if test "$LIB_dbopen" != "$LIB_dbm_firstkey"; then
422 DBLIB="$DBLIB $LIB_dbm_firstkey"
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)
438 AC_CHECK_GETPWNAM_R_POSIX
440 AC_FIND_FUNC_NO_LIBS(getsockopt, ,
441 [#ifdef HAVE_SYS_TYPES_H
442 #include <sys/types.h>
444 #ifdef HAVE_SYS_SOCKET_H
445 #include <sys/socket.h>
448 AC_FIND_FUNC_NO_LIBS(setsockopt, ,
449 [#ifdef HAVE_SYS_TYPES_H
450 #include <sys/types.h>
452 #ifdef HAVE_SYS_SOCKET_H
453 #include <sys/socket.h>
458 AC_CHECK_FUNCS(getudbnam setlim)
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,
471 if test "$ac_cv_func_hstrerror" = yes; then
479 dnl sigh, wish this could be done in a loop
480 if test "$ac_cv_func_asprintf" = yes; then
483 #include <string.h>],
486 if test "$ac_cv_func_vasprintf" = yes; then
489 #include <string.h>],
492 if test "$ac_cv_func_asnprintf" = yes; then
495 #include <string.h>],
498 if test "$ac_cv_func_vasnprintf" = yes; then
501 #include <string.h>],
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)
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)
524 #ifdef HAVE_SYS_TYPES_H
525 #include <sys/types.h>
527 #ifdef HAVE_SYS_SOCKET_H
528 #include <sys/socket.h>
530 #ifdef HAVE_NETINET_IN_H
531 #include <netinet/in.h>
533 #ifdef HAVE_ARPA_INET_H
534 #include <arpa/inet.h>
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
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
570 #ifdef HAVE_SYS_TYPES_H
571 #include <sys/types.h>
573 #ifdef HAVE_SYS_SOCKET_H
574 #include <sys/socket.h>
576 #ifdef HAVE_NETINET_IN_H
577 #include <netinet/in.h>
579 #ifdef HAVE_ARPA_INET_H
580 #include <arpa/inet.h>
586 gethostbyname, struct hostent *gethostbyname(const char *))
589 #ifdef HAVE_SYS_TYPES_H
590 #include <sys/types.h>
592 #ifdef HAVE_SYS_SOCKET_H
593 #include <sys/socket.h>
595 #ifdef HAVE_NETINET_IN_H
596 #include <netinet/in.h>
598 #ifdef HAVE_ARPA_INET_H
599 #include <arpa/inet.h>
605 gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
608 #ifdef HAVE_SYS_TYPES_H
609 #include <sys/types.h>
611 #ifdef HAVE_SYS_SOCKET_H
612 #include <sys/socket.h>
614 #ifdef HAVE_NETINET_IN_H
615 #include <netinet/in.h>
617 #ifdef HAVE_ARPA_INET_H
618 #include <arpa/inet.h>
624 getservbyname, struct servent *getservbyname(const char *, const char *))
631 openlog, void openlog(const char *, int, int))
653 AC_CHECK_VAR([#ifdef HAVE_SYS_TYPES_H
654 #include <sys/types.h>
661 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
666 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
671 AC_CHECK_VAR([#ifdef HAVE_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>])
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
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
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.])
746 LIBS="$LIB_tgetent $LIBS"
747 AC_FIND_FUNC_NO_LIBS(readline, edit readline)
750 if test "$with_readline" = yes; then
752 elif test "$ac_cv_func_readline" = yes; then
754 elif test "$ac_cv_func_el_init" = yes; then
756 LIB_readline="\$(top_builddir)/lib/editline/libel_compat.a $LIB_el_init"
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
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)
792 *-*-aix3*|*-*-sunos4*|*-*-osf*|*-*-hpux10*)
793 krb_cv_sys_streamspty=no
796 krb_cv_sys_streamspty="$ac_cv_func_getmsg"
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)
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
814 foo=`echo $i | tr 'xindiscernible' 'XINDISCERNIBLE'`
817 while test "x$y" != "x$x"; do
821 AC_DEFINE_UNQUOTED($foo,"$x")
825 # hack to shut up automake
826 LIBOBJS="$LIBOBJS make-print-version.o"
828 LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/\.lo/g'`
832 include/kadm5/Makefile \
836 lib/auth/afskauthlib/Makefile \
837 lib/auth/pam/Makefile \
838 lib/auth/sia/Makefile \
840 lib/com_err/Makefile \
842 lib/editline/Makefile \
843 lib/gssapi/Makefile \
857 appl/afsutil/Makefile \
859 appl/ftp/common/Makefile \
860 appl/ftp/ftp/Makefile \
861 appl/ftp/ftpd/Makefile \
862 appl/kauth/Makefile \
864 appl/login/Makefile \
866 appl/popper/Makefile \
870 appl/telnet/Makefile \
871 appl/telnet/libtelnet/Makefile \
872 appl/telnet/telnet/Makefile \
873 appl/telnet/telnetd/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
893 echo "creating include/version.h"
894 User=${USER-${LOGNAME}}
895 Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
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