1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION($Revision$)
4 test -z "$CFLAGS" && CFLAGS="-g"
5 AC_INIT([Heimdal],[0.7pre],[heimdal-bugs@pdc.kth.se])
6 AC_CONFIG_SRCDIR([kuser/kinit.c])
7 AC_CONFIG_HEADERS(include/config.h)
9 dnl Checks for programs.
13 AM_INIT_AUTOMAKE([foreign no-dependencies 1.7])
16 AC_PREFIX_DEFAULT(/usr/heimdal)
18 test "$sysconfdir" = '${prefix}/etc' && sysconfdir='/etc'
19 test "$localstatedir" = '${prefix}/var' && localstatedir='/var/heimdal'
23 AC_SUBST(CANONICAL_HOST)
28 dnl this is needed to run the configure tests against glibc
30 AC_DEFINE([_GNU_SOURCE], 1,
31 [Define to enable extensions on glibc-based systems such as Linux.])
45 libdir="$libdir$abilibdirext"
52 rk_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
54 rk_TEST_PACKAGE(openldap,
57 [-lldap -llber],,,OPENLDAP)
59 AC_ARG_ENABLE(hdb-openldap-module,
60 AS_HELP_STRING([--enable-hdb-openldap-module],
61 [if you want support to build openldap hdb as shared object]))
62 if test "$enable_hdb_openldap_module" = yes -a "$with_openldap" = yes; then
63 AC_DEFINE(OPENLDAP_MODULE, 1, [Define if you want support for hdb ldap module])
65 AM_CONDITIONAL(OPENLDAP_MODULE, test "$enable_hdb_openldap_module" = yes -a "$with_openldap" = yes)
67 rk_TEST_PACKAGE(krb4,[#include <krb.h>],-lkrb,-ldes,/usr/athena, KRB4, krb4-config)
70 if test "$with_krb4" != "no"; then
72 CFLAGS="$CFLAGS $INCLUDE_krb4"
74 LIBS="$LIB_krb4 $LIBS"
77 AC_CACHE_CHECK(for four valued krb_put_int, ac_cv_func_krb_put_int_four,
78 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>]], [[
80 krb_put_int(17, tmp, 4, sizeof(tmp));]])],
81 [ac_cv_func_krb_put_int_four=yes],
82 [ac_cv_func_krb_put_int_four=no])
84 if test "$ac_cv_func_krb_put_int_four" = yes; then
85 AC_DEFINE(HAVE_FOUR_VALUED_KRB_PUT_INT, 1,
86 [define if krb_put_int takes four arguments.])
88 AH_BOTTOM([#if defined(HAVE_FOUR_VALUED_KRB_PUT_INT) || !defined(KRB4)
89 #define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (L), (S))
91 #define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (S))
94 AC_CACHE_CHECK(for KRB_VERIFY_SECURE, ac_cv_func_krb_verify_secure,
95 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>]], [[
96 int x = KRB_VERIFY_SECURE]])],
97 [ac_cv_func_krb_verify_secure=yes],
98 [ac_cv_func_krb_verify_secure=no])
100 if test "$ac_cv_func_krb_verify_secure" != yes; then
101 AC_DEFINE(KRB_VERIFY_SECURE, 1,
102 [Define to one if your krb.h doesn't])
103 AC_DEFINE(KRB_VERIFY_SECURE_FAIL, 2,
104 [Define to two if your krb.h doesn't])
106 AC_CACHE_CHECK(for KRB_VERIFY_NOT_SECURE,
107 ac_cv_func_krb_verify_not_secure,
108 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>]], [[
109 int x = KRB_VERIFY_NOT_SECURE]])],
110 [ac_cv_func_krb_verify_not_secure=yes],
111 [ac_cv_func_krb_verify_not_secure=no])
113 if test "$ac_cv_func_krb_verify_not_secure" != yes; then
114 AC_DEFINE(KRB_VERIFY_NOT_SECURE, 0,
115 [Define to zero if your krb.h doesn't])
117 AC_FIND_FUNC(krb_enable_debug)
118 AC_FIND_FUNC(krb_disable_debug)
119 AC_FIND_FUNC(krb_get_our_ip_for_realm)
120 AC_FIND_FUNC(krb_kdctimeofday)
122 [#ifndef HAVE_KRB_KDCTIMEOFDAY
123 #define krb_kdctimeofday(X) gettimeofday((X), NULL)
125 AC_FIND_FUNC(krb_get_kdc_time_diff)
127 [#ifndef HAVE_KRB_GET_KDC_TIME_DIFF
128 #define krb_get_kdc_time_diff() (0)
130 AC_CACHE_CHECK([for KRB_SENDAUTH_VERS],
131 ac_cv_func_krb_sendauth_vers,
132 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>
133 #include <prot.h>]], [[
134 char *x = KRB_SENDAUTH_VERS]])],
135 [ac_cv_func_krb_sendauth_vers=yes],
136 [ac_cv_func_krb_sendauth_vers=no])
138 if test "$ac_cv_func_krb_sendauth_vers" != yes; then
139 AC_DEFINE(KRB_SENDAUTH_VERS, ["AUTHV0.1"],
140 [This is the krb4 sendauth version.])
142 AC_CACHE_CHECK(for krb_mk_req with const arguments,
143 ac_cv_func_krb_mk_req_const,
144 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>
145 int krb_mk_req(KTEXT a, const char *s, const char *i,
146 const char *r, int32_t checksum)
147 { return 17; }]], [[]])],
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 const char *])
157 CFLAGS="$save_CFLAGS"
158 LIB_kdb="-lkdb -lkrb"
160 AM_CONDITIONAL(KRB4, test "$with_krb4" != "no")
161 AM_CONDITIONAL(KRB5, true)
162 AM_CONDITIONAL(do_roken_rename, true)
164 AC_DEFINE(KRB5, 1, [Enable Kerberos 5 support in applications.])dnl
168 AC_DEFINE(ENABLE_AES, 1, [Define if you want support AES])
173 AS_HELP_STRING([--enable-dce],[if you want support for DCE/DFS PAG's]))
174 if test "$enable_dce" = yes; then
175 AC_DEFINE(DCE, 1, [Define if you want support for DCE/DFS PAG's.])
177 AM_CONDITIONAL(DCE, test "$enable_dce" = yes)
179 ## XXX quite horrible:
180 if test -f /etc/ibmcxx.cfg; then
181 dpagaix_ldadd=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/libraries/{;s/^[[^=]]*=\(.*\)/\1/;s/,/ /gp;}'`
182 dpagaix_cflags=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/options/{;s/^[[^=]]*=\(.*\)/\1/;s/-q[^,]*//;s/,/ /gp;}'`
185 dpagaix_cflags="-D_THREAD_SAFE -D_AIX_PTHREADS_D7 -D_AIX32_THREADS=1 -D_AES_SOURCE -D_AIX41 -I/usr/include/dce"
186 dpagaix_ldadd="-L/usr/lib/threads -ldcelibc_r -ldcepthreads -lpthreads_compat lpthreads -lc_r"
187 dpagaix_ldflags="-Wl,-bI:dfspag.exp"
189 AC_SUBST(dpagaix_cflags)
190 AC_SUBST(dpagaix_ldadd)
191 AC_SUBST(dpagaix_ldflags)
195 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])
198 LIB_roken="\$(top_builddir)/lib/vers/libvers.la $LIB_roken"
205 AS_HELP_STRING([--disable-mmap],[disable use of mmap]))
206 if test "$enable_mmap" = "no"; then
207 AC_DEFINE(NO_MMAP, 1, [Define if you don't want to use mmap.])
212 rk_TEST_PACKAGE(readline,
214 #include <readline.h>],-lreadline,,, READLINE)
216 rk_TEST_PACKAGE(hesiod,[#include <hesiod.h>],-lhesiod,,, HESIOD)
227 AM_CONDITIONAL(HAVE_X, test "$no_x" != yes)
233 dnl Checks for typedefs, structures, and compiler characteristics.
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.
259 netinet/in6_machtypes.h \
296 dnl On Solaris 8 there's a compilation warning for term.h because
297 dnl it doesn't define `bool'.
298 AC_CHECK_HEADERS(term.h, , , -)
300 AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT
301 #if HAVE_SYS_SOCKET_H
302 #include <sys/socket.h>
305 AC_CHECK_HEADERS(sys/strtty.h, , , [AC_INCLUDES_DEFAULT
306 #if HAVE_SYS_STREAM_H
307 #include <sys/stream.h>
310 AC_CHECK_HEADERS(security/pam_modules.h, , , [AC_INCLUDES_DEFAULT
311 #include <security/pam_appl.h>
314 AC_ARG_ENABLE(netinfo,
315 AS_HELP_STRING([--enable-netinfo],[enable netinfo for configuration lookup]))
317 if test "$ac_cv_header_netinfo_ni_h" = yes -a "$enable_netinfo" = yes; then
318 AC_DEFINE(HAVE_NETINFO, 1,
319 [Define if you want to use Netinfo instead of krb5.conf.])
323 AC_HELP_STRING([--enable-kcm],[enable Kerberos Credentials Manager]))
325 if test "$ac_cv_header_sys_un_h" = yes -a "$enable_kcm" = yes; then
326 AC_DEFINE(HAVE_KCM, 1,
327 [Define if you want to use the Kerberos Credentials Manager.])
329 AM_CONDITIONAL(KCM, test "$enable_kcm" = yes)
332 rk_WIN32_EXPORT(BUILD_KRB5_LIB, KRB5_LIB_FUNCTION)
334 dnl Checks for libraries.
336 AC_FIND_FUNC_NO_LIBS(logwtmp, util)
337 AC_FIND_FUNC_NO_LIBS(logout, util)
338 AC_FIND_FUNC_NO_LIBS(openpty, util)
339 AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses)
341 dnl Checks for library functions.
371 yp_get_default_domain \
378 AC_CHECK_GETPWNAM_R_POSIX
381 AC_CHECK_FUNCS(getudbnam setlim)
383 dnl AC_KRB_FUNC_GETCWD_BROKEN
386 dnl Check for fields in struct utmp
389 AC_HAVE_STRUCT_FIELD(struct utmp, ut_addr, [#include <utmp.h>])
390 AC_HAVE_STRUCT_FIELD(struct utmp, ut_host, [#include <utmp.h>])
391 AC_HAVE_STRUCT_FIELD(struct utmp, ut_id, [#include <utmp.h>])
392 AC_HAVE_STRUCT_FIELD(struct utmp, ut_pid, [#include <utmp.h>])
393 AC_HAVE_STRUCT_FIELD(struct utmp, ut_type, [#include <utmp.h>])
394 AC_HAVE_STRUCT_FIELD(struct utmp, ut_user, [#include <utmp.h>])
395 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_exit, [#include <utmpx.h>])
396 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_syslen, [#include <utmpx.h>])
398 AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t,
399 u_int8_t, u_int16_t, u_int32_t, u_int64_t,
400 uint8_t, uint16_t, uint32_t, uint64_t],,,[
401 #ifdef HAVE_INTTYPES_H
402 #include <inttypes.h>
404 #ifdef HAVE_SYS_TYPES_H
405 #include <sys/types.h>
407 #ifdef HAVE_SYS_BITYPES_H
408 #include <sys/bitypes.h>
410 #ifdef HAVE_BIND_BITYPES_H
411 #include <bind/bitypes.h>
413 #ifdef HAVE_NETINET_IN6_MACHTYPES_H
414 #include <netinet/in6_machtypes.h>
422 dnl Some operating systems already have com_err and compile_et
425 rk_AUTH_MODULES([sia afskauthlib])
429 AH_BOTTOM([#ifdef ROKEN_RENAME
430 #include "roken_rename.h"
433 AC_CONFIG_FILES(Makefile \
435 include/kadm5/Makefile \
439 lib/auth/afskauthlib/Makefile \
440 lib/auth/pam/Makefile \
441 lib/auth/sia/Makefile \
443 lib/com_err/Makefile \
445 lib/editline/Makefile \
446 lib/gssapi/Makefile \
463 appl/afsutil/Makefile \
465 appl/ftp/common/Makefile \
466 appl/ftp/ftp/Makefile \
467 appl/ftp/ftpd/Makefile \
469 appl/login/Makefile \
471 appl/popper/Makefile \
476 appl/xnlock/Makefile \
477 appl/telnet/Makefile \
478 appl/telnet/libtelnet/Makefile \
479 appl/telnet/telnet/Makefile \
480 appl/telnet/telnetd/Makefile \
483 appl/dceutils/Makefile \
491 dnl This is the release version name-number[beta]
494 cat > include/newversion.h.in <<EOF
495 const char *heimdal_long_version = "@([#])\$Version: $PACKAGE_STRING by @USER@ on @HOST@ ($host) @DATE@ \$";
496 const char *heimdal_version = "AC_PACKAGE_STRING";
499 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
500 echo "include/version.h is unchanged"
501 rm -f include/newversion.h.in
503 echo "creating include/version.h"
504 User=${USER-${LOGNAME}}
505 Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
507 mv -f include/newversion.h.in include/version.h.in
508 sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h