1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION($Revision$)
3 AC_PREREQ(2.14.-1.1)dnl 2.14a
4 AC_INIT(heimdal, 0.4b, heimdal-bugs@pdc.kth.se)
5 AM_CONFIG_HEADER(include/config.h)
7 dnl Checks for programs.
12 AM_INIT_AUTOMAKE(heimdal,0.4b)
14 AC_PREFIX_DEFAULT(/usr/heimdal)
18 AC_SUBST(CANONICAL_HOST)
35 if test "$sunos" != no; then
36 AC_DEFINE_UNQUOTED(SunOS, $sunos,
37 [Define to what version of SunOS you are running.])
50 test -z "$CFLAGS" && CFLAGS="-g"
64 libdir="$libdir$abilibdirext"
71 AC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
75 dnl AC_ROKEN(10,[/usr/heimdal /usr/athena],[lib/roken],[$(top_builddir)/lib/roken/libroken.la],[-I$(top_builddir)/lib/roken -I$(top_srcdir)/lib/roken])
78 LIB_roken="\$(top_builddir)/lib/vers/libvers.la $LIB_roken"
80 AC_TEST_PACKAGE_NEW(openldap,
83 [-lldap -llber],,,OPENLDAP)
85 if test "$openldap_libdir"; then
86 LIB_openldap="-R $openldap_libdir $LIB_openldap"
89 AC_TEST_PACKAGE_NEW(krb4,[#include <krb.h>],-lkrb,-ldes,/usr/athena, KRB4)
92 if test "$with_krb4" != "no"; then
94 CFLAGS="$CFLAGS $INCLUDE_krb4"
96 LIBS="$LIB_krb4 -ldes $LIBS"
99 AC_CACHE_CHECK(for four valued krb_put_int, ac_cv_func_krb_put_int_four,
100 [AC_TRY_COMPILE([#include <krb.h>],[
102 krb_put_int(17, tmp, 4, sizeof(tmp));],
103 ac_cv_func_krb_put_int_four=yes,
104 ac_cv_func_krb_put_int_four=no)
106 if test "$ac_cv_func_krb_put_int_four" = yes; then
107 AC_DEFINE(HAVE_FOUR_VALUED_KRB_PUT_INT, 1,
108 [define if krb_put_int takes four arguments.])
110 AH_BOTTOM([#if defined(HAVE_FOUR_VALUED_KRB_PUT_INT) || !defined(KRB4)
111 #define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (L), (S))
113 #define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (S))
116 AC_CACHE_CHECK(for KRB_VERIFY_SECURE, ac_cv_func_krb_verify_secure,
117 [AC_TRY_COMPILE([#include <krb.h>],[
118 int x = KRB_VERIFY_SECURE],
119 ac_cv_func_krb_verify_secure=yes,
120 ac_cv_func_krb_verify_secure=no)
122 if test "$ac_cv_func_krb_verify_secure" != yes; then
123 AC_DEFINE(KRB_VERIFY_SECURE, 1,
124 [Define to one if your krb.h doesn't])
125 AC_DEFINE(KRB_VERIFY_SECURE_FAIL, 2,
126 [Define to two if your krb.h doesn't])
128 AC_CACHE_CHECK(for KRB_VERIFY_NOT_SECURE,
129 ac_cv_func_krb_verify_not_secure,
130 [AC_TRY_COMPILE([#include <krb.h>],[
131 int x = KRB_VERIFY_NOT_SECURE],
132 ac_cv_func_krb_verify_not_secure=yes,
133 ac_cv_func_krb_verify_not_secure=no)
135 if test "$ac_cv_func_krb_verify_not_secure" != yes; then
136 AC_DEFINE(KRB_VERIFY_NOT_SECURE, 0,
137 [Define to zero if your krb.h doesn't])
139 AC_FIND_FUNC(krb_enable_debug)
140 AC_FIND_FUNC(krb_disable_debug)
141 AC_FIND_FUNC(krb_get_our_ip_for_realm)
142 AC_CACHE_CHECK(for krb_mk_req with const arguments,
143 ac_cv_func_krb_mk_req_const,
144 [AC_TRY_COMPILE([#include <krb.h>
145 int krb_mk_req(KTEXT a, const char *s, const char *i,
146 const char *r, int32_t checksum)
148 ac_cv_func_krb_mk_req_const=yes,
149 ac_cv_func_krb_mk_req_const=no)
151 if test "$ac_cv_func_krb_mk_req_const" = "yes"; then
152 AC_DEFINE(KRB_MK_REQ_CONST, 1,
153 [Define if krb_mk_req takes cons char *])
157 CFLAGS="$save_CFLAGS"
158 LIB_kdb="-lkdb -lkrb"
159 test_LIB_krb4="$LIB_krb4"
160 if test "$krb4_libdir"; then
161 LIB_krb4="-R $krb4_libdir $LIB_krb4"
162 LIB_kdb="-R $krb4_libdir -L$krb4_libdir $LIB_kdb"
165 AM_CONDITIONAL(KRB4, test "$with_krb4" != "no")
166 AM_CONDITIONAL(KRB5, true)
167 AM_CONDITIONAL(do_roken_rename, true)
169 AC_DEFINE(KRB5, 1, [Enable Kerberos 5 support in applications.])dnl
172 AC_ARG_ENABLE(dce, [ --enable-dce if you want support for DCE/DFS PAG's.])
173 if test "$enable_dce" = yes; then
174 AC_DEFINE(DCE, 1, [Define if you want support for DCE/DFS PAG's.])
176 AM_CONDITIONAL(DCE, test "$enable_dce" = yes)
178 ## XXX quite horrible:
179 if test -f /etc/ibmcxx.cfg; then
180 dpagaix_LDADD=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/libraries/{;s/^[[^=]]*=\(.*\)/\1/;s/,/ /gp;}'`
181 dpagaix_CFLAGS=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/options/{;s/^[[^=]]*=\(.*\)/\1/;s/-q[^,]*//;s/,/ /gp;}'`
183 dpagaix_CFLAGS="-D_THREAD_SAFE -D_AIX_PTHREADS_D7 -D_AIX32_THREADS=1 -D_AES_SOURCE -D_AIX41 -I/usr/include/dce"
184 dpagaix_LDADD="-L/usr/lib/threads -ldcelibc_r -ldcepthreads -lpthreads_compat lpthreads -lc_r"
185 dpagaix_LDFLAGS="-Wl,-bI:dfspag.exp"
187 AC_SUBST(dpagaix_CFLAGS)
188 AC_SUBST(dpagaix_LDADD)
192 [ --disable-otp if you don't want OTP support],
194 if test "$enableval" = "no"; then
198 if test "$otp" = "yes"; then
199 AC_DEFINE(OTP, 1, [Define if you want OTP support in applications.])
200 LIB_otp='$(top_builddir)/lib/otp/libotp.la'
203 AM_CONDITIONAL(OTP, test "$otp" = yes)dnl
209 AC_TEST_PACKAGE_NEW(readline,
211 #include <readline.h>],-lreadline,,, READLINE)
213 AC_TEST_PACKAGE_NEW(hesiod,[#include <hesiod.h>],-lhesiod,,, HESIOD)
223 AM_CONDITIONAL(HAVE_X, test "$no_x" != yes)
229 dnl Checks for typedefs, structures, and compiler characteristics.
233 AC_CHECK_TYPE_EXTRA(ssize_t, int, [#include <unistd.h>])
236 AC_CHECK_TYPE_EXTRA(mode_t, unsigned short, [])
237 AC_CHECK_TYPE_EXTRA(sig_atomic_t, int, [#include <signal.h>])
238 AC_HAVE_TYPE([long long])
242 dnl Checks for header files.
272 netinet/in6_machtypes.h \
284 security/pam_modules.h \
337 CHECK_NETINET_IP_AND_TCP
340 AC_ARG_ENABLE(netinfo,
341 [ --enable-netinfo enable netinfo for configuration lookup])
343 if test "$ac_cv_header_netinfo_ni_h" = yes -a "$enable_netinfo" = yes; then
344 AC_DEFINE(HAVE_NETINFO, 1,
345 [Define if you want to use Netinfo instead of krb5.conf.])
348 AM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes)
349 AM_CONDITIONAL(have_fnmatch_h, test "$ac_cv_header_fnmatch_h" = yes)
351 dnl Checks for libraries.
353 AC_FIND_FUNC(socket, socket)
354 AC_FIND_FUNC(gethostbyname, nsl)
355 AC_FIND_FUNC(syslog, syslog)
359 AC_FIND_FUNC_NO_LIBS(logwtmp, util)
360 AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses)
361 AC_FIND_FUNC(gethostbyname2, inet6 ip6)
363 AC_FIND_FUNC(res_search, resolv,
366 #ifdef HAVE_SYS_TYPES_H
367 #include <sys/types.h>
369 #ifdef HAVE_NETINET_IN_H
370 #include <netinet/in.h>
372 #ifdef HAVE_ARPA_NAMESER_H
373 #include <arpa/nameser.h>
381 AC_FIND_FUNC(dn_expand, resolv,
384 #ifdef HAVE_SYS_TYPES_H
385 #include <sys/types.h>
387 #ifdef HAVE_NETINET_IN_H
388 #include <netinet/in.h>
390 #ifdef HAVE_ARPA_NAMESER_H
391 #include <arpa/nameser.h>
399 dnl Checks for library functions.
435 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)
466 dnl AC_KRB_FUNC_GETCWD_BROKEN
469 dnl Check for fields in struct utmp
472 AC_HAVE_STRUCT_FIELD(struct utmp, ut_addr, [#include <utmp.h>])
473 AC_HAVE_STRUCT_FIELD(struct utmp, ut_host, [#include <utmp.h>])
474 AC_HAVE_STRUCT_FIELD(struct utmp, ut_id, [#include <utmp.h>])
475 AC_HAVE_STRUCT_FIELD(struct utmp, ut_pid, [#include <utmp.h>])
476 AC_HAVE_STRUCT_FIELD(struct utmp, ut_type, [#include <utmp.h>])
477 AC_HAVE_STRUCT_FIELD(struct utmp, ut_user, [#include <utmp.h>])
478 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_exit, [#include <utmpx.h>])
479 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_syslen, [#include <utmpx.h>])
482 dnl Check for fields in struct tm
485 AC_HAVE_STRUCT_FIELD(struct tm, tm_gmtoff, [#include <time.h>])
486 AC_HAVE_STRUCT_FIELD(struct tm, tm_zone, [#include <time.h>])
489 dnl or do we have a variable `timezone' ?
492 rk_CHECK_VAR(timezone, [#include <time.h>])
494 AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
496 AC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
498 AC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
500 AC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/socket.h>])
502 AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
505 dnl Check for struct winsize
508 AC_KRB_STRUCT_WINSIZE
511 dnl Check for struct spwd
517 dnl Check for sa_len in struct sockaddr
520 AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
521 #include <sys/socket.h>])
524 AC_GROK_TYPES([int8_t int16_t int32_t int64_t \
525 u_int8_t u_int16_t u_int32_t u_int64_t \
526 uint8_t uint16_t uint32_t uint64_t])
529 dnl crypto functions tests
540 AC_FIND_FUNC_NO_LIBS2(MD4_Init, crypto des, [], [], [], [$test_LIB_krb4])
541 AC_FIND_FUNC_NO_LIBS2(MD5_Init, crypto des, [], [], [], [$test_LIB_krb4])
542 AC_FIND_FUNC_NO_LIBS2(SHA1_Init, crypto des, [], [], [], [$test_LIB_krb4])
543 AC_FIND_FUNC_NO_LIBS2(des_cbc_encrypt, crypto des, [], [], [], [$test_LIB_krb4])
544 AC_FIND_FUNC_NO_LIBS2(RC4, crypto des, [], [], [], [$test_LIB_krb4])
545 if test "$ac_cv_func_des_cbc_encrypt" = "yes" -a \
546 "$ac_cv_func_MD4_Init" = "yes" -a \
547 "$ac_cv_func_MD5_Init" = "yes" -a \
548 "$ac_cv_func_SHA1_Init" = "yes" -a \
549 "$ac_cv_func_RC4" = "yes"; then
552 if test "$krb4_libdir" != "" -a "$ac_cv_funclib_des_cbc_encrypt" = "-ldes"; then
553 LIB_des="-R $krb4_libdir -L$krb4_libdir"
555 LIB_des="$LIB_des $ac_cv_funclib_MD4_Init"
556 LIB_des_appl="$LIB_des"
559 LIB_des='$(top_builddir)/lib/des/libdes.la'
564 AC_SUBST(LIB_des_appl)
568 dnl telnet muck --------------------------------------------------
570 AC_DEFINE(AUTHENTICATION, 1,
571 [Define if you want authentication support in telnet.])dnl
572 AC_DEFINE(ENCRYPTION, 1,
573 [Define if you want encryption support in telnet.])dnl
574 AC_DEFINE(DES_ENCRYPTION, 1,
575 [Define if you want to use DES encryption in telnet.])dnl
576 AC_DEFINE(DIAGNOSTICS, 1,
577 [Define this to enable diagnostics in telnet.])dnl
578 AC_DEFINE(OLD_ENVIRON, 1,
579 [Define this to enable old environment option in telnet.])dnl
581 AC_DEFINE(ENV_HACK, 1,
582 [Define this if you want support for broken ENV_{VAR,VAL} telnets.])
585 # Simple test for streamspty, based on the existance of getmsg(), alas
586 # this breaks on SunOS4 which have streams but BSD-like ptys
588 # And also something wierd has happend with dec-osf1, fallback to bsd-ptys
590 AC_CHECK_FUNC(getmsg)
592 if test "$ac_cv_func_getmsg" = "yes"; then
594 AC_CACHE_CHECK(for working getmsg, ac_cv_func_getmsg_work,
603 ret = getmsg(open("/dev/null", 0), NULL, NULL, NULL);
604 if(ret < 0 && errno == ENOSYS)
608 ], ac_cv_func_getmsg_work=yes, ac_cv_func_getmsg_work=no,
609 ac_cv_func_getmsg_work=no))
610 test "$ac_cv_func_getmsg_work" = "yes" &&
611 AC_DEFINE(HAVE_GETMSG, 1, [Define if you have a working getmsg.])
615 if test "$ac_cv_func_getmsg_work" = yes; then
616 AC_MSG_CHECKING(for streamspty)
618 *-*-aix3*|*-*-sunos4*|*-*-osf*|*-*-hpux1[[01]]*)
619 krb_cv_sys_streamspty=no
622 krb_cv_sys_streamspty=yes
625 AC_MSG_RESULT($krb_cv_sys_streamspty)
627 if test "$krb_cv_sys_streamspty" = yes; then
628 AC_DEFINE(STREAMSPTY, 1, [Define if you have streams ptys.])
633 dnl This is done by AC_OUTPUT but we need the result here.
635 test "x$prefix" = xNONE && prefix=$ac_default_prefix
636 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
638 for i in bin lib libexec sbin; do
640 foo=`echo $i | tr 'xindiscernible' 'XINDISCERNIBLE'`
643 while test "x$y" != "x$x"; do
647 AC_DEFINE_UNQUOTED($foo,"$x")
649 AH_BOTTOM([#undef BINDIR
655 # hack to shut up automake
656 LIBOBJS="$LIBOBJS make-print-version.o"
658 LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/\.lo/g'`
660 AC_CONFIG_FILES(Makefile \
662 include/kadm5/Makefile \
666 lib/auth/afskauthlib/Makefile \
667 lib/auth/pam/Makefile \
668 lib/auth/sia/Makefile \
670 lib/com_err/Makefile \
672 lib/editline/Makefile \
673 lib/gssapi/Makefile \
689 appl/afsutil/Makefile \
691 appl/ftp/common/Makefile \
692 appl/ftp/ftp/Makefile \
693 appl/ftp/ftpd/Makefile \
695 appl/login/Makefile \
697 appl/popper/Makefile \
702 appl/xnlock/Makefile \
703 appl/telnet/Makefile \
704 appl/telnet/libtelnet/Makefile \
705 appl/telnet/telnet/Makefile \
706 appl/telnet/telnetd/Makefile \
709 appl/dceutils/Makefile \
717 dnl This is the release version name-number[beta]
719 HEIMDALVERSION="$PACKAGE-$VERSION"
721 cat > include/newversion.h.in <<EOF
722 const char *heimdal_long_version = "@(#)\$Version: $HEIMDALVERSION by @USER@ on @HOST@ ($host) @DATE@ \$";
723 const char *heimdal_version = "$HEIMDALVERSION";
726 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
727 echo "include/version.h is unchanged"
728 rm -f include/newversion.h.in
730 echo "creating include/version.h"
731 User=${USER-${LOGNAME}}
732 Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
734 mv -f include/newversion.h.in include/version.h.in
735 sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h