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)
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)
366 AC_FIND_FUNC(inet_ntop, inet6 ip6)
367 AC_CHECK_FUNCS(inet_pton)
369 AC_FIND_FUNC(res_search, resolv,
372 #ifdef HAVE_SYS_TYPES_H
373 #include <sys/types.h>
375 #ifdef HAVE_NETINET_IN_H
376 #include <netinet/in.h>
378 #ifdef HAVE_ARPA_NAMESER_H
379 #include <arpa/nameser.h>
387 AC_FIND_FUNC(dn_expand, resolv,
390 #ifdef HAVE_SYS_TYPES_H
391 #include <sys/types.h>
393 #ifdef HAVE_NETINET_IN_H
394 #include <netinet/in.h>
396 #ifdef HAVE_ARPA_NAMESER_H
397 #include <arpa/nameser.h>
405 dnl Checks for library functions.
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)
423 if test "$LIB_dbopen" != "$LIB_dbm_firstkey"; then
424 DBLIB="$DBLIB $LIB_dbm_firstkey"
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)
440 AC_CHECK_GETPWNAM_R_POSIX
442 AC_FIND_FUNC_NO_LIBS(getsockopt, ,
443 [#ifdef HAVE_SYS_TYPES_H
444 #include <sys/types.h>
446 #ifdef HAVE_SYS_SOCKET_H
447 #include <sys/socket.h>
450 AC_FIND_FUNC_NO_LIBS(setsockopt, ,
451 [#ifdef HAVE_SYS_TYPES_H
452 #include <sys/types.h>
454 #ifdef HAVE_SYS_SOCKET_H
455 #include <sys/socket.h>
460 AC_CHECK_FUNCS(getudbnam setlim)
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,
473 if test "$ac_cv_func_hstrerror" = yes; then
481 dnl sigh, wish this could be done in a loop
482 if test "$ac_cv_func_asprintf" = yes; then
485 #include <string.h>],
488 if test "$ac_cv_func_vasprintf" = yes; then
491 #include <string.h>],
494 if test "$ac_cv_func_asnprintf" = yes; then
497 #include <string.h>],
500 if test "$ac_cv_func_vasnprintf" = yes; then
503 #include <string.h>],
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)
525 #ifdef HAVE_SYS_TYPES_H
526 #include <sys/types.h>
528 #ifdef HAVE_SYS_SOCKET_H
529 #include <sys/socket.h>
531 #ifdef HAVE_NETINET_IN_H
532 #include <netinet/in.h>
534 #ifdef HAVE_ARPA_INET_H
535 #include <arpa/inet.h>
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
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
571 #ifdef HAVE_SYS_TYPES_H
572 #include <sys/types.h>
574 #ifdef HAVE_SYS_SOCKET_H
575 #include <sys/socket.h>
577 #ifdef HAVE_NETINET_IN_H
578 #include <netinet/in.h>
580 #ifdef HAVE_ARPA_INET_H
581 #include <arpa/inet.h>
587 gethostbyname, struct hostent *gethostbyname(const char *))
590 #ifdef HAVE_SYS_TYPES_H
591 #include <sys/types.h>
593 #ifdef HAVE_SYS_SOCKET_H
594 #include <sys/socket.h>
596 #ifdef HAVE_NETINET_IN_H
597 #include <netinet/in.h>
599 #ifdef HAVE_ARPA_INET_H
600 #include <arpa/inet.h>
606 gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
609 #ifdef HAVE_SYS_TYPES_H
610 #include <sys/types.h>
612 #ifdef HAVE_SYS_SOCKET_H
613 #include <sys/socket.h>
615 #ifdef HAVE_NETINET_IN_H
616 #include <netinet/in.h>
618 #ifdef HAVE_ARPA_INET_H
619 #include <arpa/inet.h>
625 getservbyname, struct servent *getservbyname(const char *, const char *))
632 openlog, void openlog(const char *, int, int))
654 AC_CHECK_VAR([#ifdef HAVE_SYS_TYPES_H
655 #include <sys/types.h>
662 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
667 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
672 AC_CHECK_VAR([#ifdef HAVE_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>])
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
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
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.])
747 LIBS="$LIB_tgetent $LIBS"
748 AC_FIND_FUNC_NO_LIBS(readline, edit readline)
751 if test "$with_readline" = yes; then
753 elif test "$ac_cv_func_readline" = yes; then
755 elif test "$ac_cv_func_el_init" = yes; then
757 LIB_readline="\$(top_builddir)/lib/editline/libel_compat.a $LIB_el_init"
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
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)
793 *-*-aix3*|*-*-sunos4*|*-*-osf*|*-*-hpux10*)
794 krb_cv_sys_streamspty=no
797 krb_cv_sys_streamspty="$ac_cv_func_getmsg"
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)
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
815 foo=`echo $i | tr 'xindiscernible' 'XINDISCERNIBLE'`
818 while test "x$y" != "x$x"; do
822 AC_DEFINE_UNQUOTED($foo,"$x")
826 # hack to shut up automake
827 LIBOBJS="$LIBOBJS make-print-version.o"
829 LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/\.lo/g'`
833 include/kadm5/Makefile \
837 lib/auth/afskauthlib/Makefile \
838 lib/auth/pam/Makefile \
839 lib/auth/sia/Makefile \
841 lib/com_err/Makefile \
843 lib/editline/Makefile \
844 lib/gssapi/Makefile \
858 appl/afsutil/Makefile \
860 appl/ftp/common/Makefile \
861 appl/ftp/ftp/Makefile \
862 appl/ftp/ftpd/Makefile \
863 appl/kauth/Makefile \
865 appl/login/Makefile \
867 appl/popper/Makefile \
871 appl/telnet/Makefile \
872 appl/telnet/libtelnet/Makefile \
873 appl/telnet/telnet/Makefile \
874 appl/telnet/telnetd/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
894 echo "creating include/version.h"
895 User=${USER-${LOGNAME}}
896 Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
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