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.8pre],[heimdal-bugs@pdc.kth.se])
6 AC_CONFIG_SRCDIR([kuser/kinit.c])
7 AC_CONFIG_HEADERS(include/config.h)
9 AM_INIT_AUTOMAKE([foreign no-dependencies 1.8])
12 dnl Checks for programs.
17 AC_PREFIX_DEFAULT(/usr/heimdal)
19 test "$sysconfdir" = '${prefix}/etc' && sysconfdir='/etc'
20 test "$localstatedir" = '${prefix}/var' && localstatedir='/var/heimdal'
24 AC_SUBST(CANONICAL_HOST)
29 dnl this is needed to run the configure tests against glibc
31 AC_DEFINE([_GNU_SOURCE], 1,
32 [Define to enable extensions on glibc-based systems such as Linux.])
46 libdir="$libdir$abilibdirext"
53 rk_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
55 rk_TEST_PACKAGE(openldap,
58 [-lldap -llber],,,OPENLDAP)
60 AC_ARG_ENABLE(hdb-openldap-module,
61 AS_HELP_STRING([--enable-hdb-openldap-module],
62 [if you want support to build openldap hdb as shared object]))
63 if test "$enable_hdb_openldap_module" = yes -a "$with_openldap" = yes; then
64 AC_DEFINE(OPENLDAP_MODULE, 1, [Define if you want support for hdb ldap module])
66 AM_CONDITIONAL(OPENLDAP_MODULE, test "$enable_hdb_openldap_module" = yes -a "$with_openldap" = yes)
68 AC_ARG_ENABLE(pk-init,
69 AS_HELP_STRING([--enable-pk-init],
70 [if you want support to pk-init]))
71 if test "$enable_pk_init" = yes ;then
72 AC_DEFINE([PKINIT], 1, [Define to enable PKINIT.])
75 rk_TEST_PACKAGE(krb4,[#include <krb.h>],-lkrb,-ldes,/usr/athena, KRB4, krb4-config)
78 if test "$with_krb4" != "no"; then
80 CFLAGS="$CFLAGS $INCLUDE_krb4"
82 LIBS="$LIB_krb4 $LIBS"
85 AC_CACHE_CHECK(for four valued krb_put_int, ac_cv_func_krb_put_int_four,
86 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>]], [[
88 krb_put_int(17, tmp, 4, sizeof(tmp));]])],
89 [ac_cv_func_krb_put_int_four=yes],
90 [ac_cv_func_krb_put_int_four=no])
92 if test "$ac_cv_func_krb_put_int_four" = yes; then
93 AC_DEFINE(HAVE_FOUR_VALUED_KRB_PUT_INT, 1,
94 [define if krb_put_int takes four arguments.])
96 AH_BOTTOM([#if defined(HAVE_FOUR_VALUED_KRB_PUT_INT) || !defined(KRB4)
97 #define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (L), (S))
99 #define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (S))
102 AC_CACHE_CHECK(for KRB_VERIFY_SECURE, ac_cv_func_krb_verify_secure,
103 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>]], [[
104 int x = KRB_VERIFY_SECURE]])],
105 [ac_cv_func_krb_verify_secure=yes],
106 [ac_cv_func_krb_verify_secure=no])
108 if test "$ac_cv_func_krb_verify_secure" != yes; then
109 AC_DEFINE(KRB_VERIFY_SECURE, 1,
110 [Define to one if your krb.h doesn't])
111 AC_DEFINE(KRB_VERIFY_SECURE_FAIL, 2,
112 [Define to two if your krb.h doesn't])
114 AC_CACHE_CHECK(for KRB_VERIFY_NOT_SECURE,
115 ac_cv_func_krb_verify_not_secure,
116 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>]], [[
117 int x = KRB_VERIFY_NOT_SECURE]])],
118 [ac_cv_func_krb_verify_not_secure=yes],
119 [ac_cv_func_krb_verify_not_secure=no])
121 if test "$ac_cv_func_krb_verify_not_secure" != yes; then
122 AC_DEFINE(KRB_VERIFY_NOT_SECURE, 0,
123 [Define to zero if your krb.h doesn't])
125 AC_FIND_FUNC(krb_enable_debug)
126 AC_FIND_FUNC(krb_disable_debug)
127 AC_FIND_FUNC(krb_get_our_ip_for_realm)
128 AC_FIND_FUNC(krb_kdctimeofday)
130 [#ifndef HAVE_KRB_KDCTIMEOFDAY
131 #define krb_kdctimeofday(X) gettimeofday((X), NULL)
133 AC_FIND_FUNC(krb_get_kdc_time_diff)
135 [#ifndef HAVE_KRB_GET_KDC_TIME_DIFF
136 #define krb_get_kdc_time_diff() (0)
138 AC_CACHE_CHECK([for KRB_SENDAUTH_VERS],
139 ac_cv_func_krb_sendauth_vers,
140 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>
141 #include <prot.h>]], [[
142 char *x = KRB_SENDAUTH_VERS]])],
143 [ac_cv_func_krb_sendauth_vers=yes],
144 [ac_cv_func_krb_sendauth_vers=no])
146 if test "$ac_cv_func_krb_sendauth_vers" != yes; then
147 AC_DEFINE(KRB_SENDAUTH_VERS, ["AUTHV0.1"],
148 [This is the krb4 sendauth version.])
150 AC_CACHE_CHECK(for krb_mk_req with const arguments,
151 ac_cv_func_krb_mk_req_const,
152 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>
153 int krb_mk_req(KTEXT a, const char *s, const char *i,
154 const char *r, int32_t checksum)
155 { return 17; }]], [[]])],
156 [ac_cv_func_krb_mk_req_const=yes],
157 [ac_cv_func_krb_mk_req_const=no])
159 if test "$ac_cv_func_krb_mk_req_const" = "yes"; then
160 AC_DEFINE(KRB_MK_REQ_CONST, 1,
161 [Define if krb_mk_req takes const char *])
165 CFLAGS="$save_CFLAGS"
166 LIB_kdb="-lkdb -lkrb"
168 AM_CONDITIONAL(KRB4, test "$with_krb4" != "no")
169 AM_CONDITIONAL(KRB5, true)
170 AM_CONDITIONAL(do_roken_rename, true)
172 AC_DEFINE(KRB5, 1, [Enable Kerberos 5 support in applications.])dnl
180 AS_HELP_STRING([--enable-dce],[if you want support for DCE/DFS PAG's]))
181 if test "$enable_dce" = yes; then
182 AC_DEFINE(DCE, 1, [Define if you want support for DCE/DFS PAG's.])
184 AM_CONDITIONAL(DCE, test "$enable_dce" = yes)
186 ## XXX quite horrible:
187 if test -f /etc/ibmcxx.cfg; then
188 dpagaix_ldadd=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/libraries/{;s/^[[^=]]*=\(.*\)/\1/;s/,/ /gp;}'`
189 dpagaix_cflags=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/options/{;s/^[[^=]]*=\(.*\)/\1/;s/-q[^,]*//;s/,/ /gp;}'`
192 dpagaix_cflags="-D_THREAD_SAFE -D_AIX_PTHREADS_D7 -D_AIX32_THREADS=1 -D_AES_SOURCE -D_AIX41 -I/usr/include/dce"
193 dpagaix_ldadd="-L/usr/lib/threads -ldcelibc_r -ldcepthreads -lpthreads_compat lpthreads -lc_r"
194 dpagaix_ldflags="-Wl,-bI:dfspag.exp"
196 AC_SUBST(dpagaix_cflags)
197 AC_SUBST(dpagaix_ldadd)
198 AC_SUBST(dpagaix_ldflags)
202 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])
205 LIB_roken="\$(top_builddir)/lib/vers/libvers.la $LIB_roken"
212 AS_HELP_STRING([--disable-mmap],[disable use of mmap]))
213 if test "$enable_mmap" = "no"; then
214 AC_DEFINE(NO_MMAP, 1, [Define if you don't want to use mmap.])
217 AC_ARG_ENABLE(afs-string-to-key,
218 AS_HELP_STRING([--disable-afs-string-to-key],
219 [disable use of weak AFS string-to-key functions]),
220 [], [enable_afs_string_to_key=yes])
222 if test "$enable_afs_string_to_key" = "yes"; then
223 AC_DEFINE(ENABLE_AFS_STRING_TO_KEY, 1, [Define if want to use the weak AFS string to key functions.])
229 rk_TEST_PACKAGE(readline,
231 #include <readline.h>],-lreadline,,, READLINE)
233 rk_TEST_PACKAGE(hesiod,[#include <hesiod.h>],-lhesiod,,, HESIOD)
244 AM_CONDITIONAL(HAVE_X, test "$no_x" != yes)
250 dnl Checks for typedefs, structures, and compiler characteristics.
253 AC_CHECK_TYPE_EXTRA(mode_t, unsigned short, [])
254 AC_CHECK_TYPE_EXTRA(sig_atomic_t, int, [#include <signal.h>])
255 AC_HAVE_TYPE([long long])
259 dnl Checks for header files.
276 netinet/in6_machtypes.h \
315 dnl On Solaris 8 there's a compilation warning for term.h because
316 dnl it doesn't define `bool'.
317 AC_CHECK_HEADERS(term.h, , , -)
319 AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT
320 #if HAVE_SYS_SOCKET_H
321 #include <sys/socket.h>
324 AC_CHECK_HEADERS(sys/ptyvar.h, , , [AC_INCLUDES_DEFAULT
329 AC_CHECK_HEADERS(sys/strtty.h, , , [AC_INCLUDES_DEFAULT
333 #if HAVE_SYS_STREAM_H
334 #include <sys/stream.h>
337 AC_CHECK_HEADERS(security/pam_modules.h, , , [AC_INCLUDES_DEFAULT
338 #include <security/pam_appl.h>
341 AC_ARG_ENABLE(netinfo,
342 AS_HELP_STRING([--enable-netinfo],[enable netinfo for configuration lookup]))
344 if test "$ac_cv_header_netinfo_ni_h" = yes -a "$enable_netinfo" = yes; then
345 AC_DEFINE(HAVE_NETINFO, 1,
346 [Define if you want to use Netinfo instead of krb5.conf.])
350 AS_HELP_STRING([--enable-kcm],[enable Kerberos Credentials Manager]))
352 if test "$ac_cv_header_sys_un_h" = yes -a "$enable_kcm" = yes; then
353 AC_DEFINE(HAVE_KCM, 1,
354 [Define if you want to use the Kerberos Credentials Manager.])
356 AM_CONDITIONAL(KCM, test "$enable_kcm" = yes)
359 rk_WIN32_EXPORT(BUILD_KRB5_LIB, KRB5_LIB_FUNCTION)
360 rk_WIN32_EXPORT(BUILD_ROKEN_LIB, ROKEN_LIB_FUNCTION)
362 dnl Checks for libraries.
364 AC_FIND_FUNC_NO_LIBS(logwtmp, util,[
369 AC_FIND_FUNC_NO_LIBS(logout, util,[
374 AC_FIND_FUNC_NO_LIBS(openpty, util,[
380 AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses,[
381 #ifdef HAVE_TERMCAP_H
389 dnl Checks for library functions.
421 yp_get_default_domain \
428 AC_CHECK_GETPWNAM_R_POSIX
430 dnl detect doors on solaris
431 if test "$enable_pthread_support" != no; then
433 LIBS="$LIBS $PTHREADS_LIBS"
434 AC_FIND_FUNC_NO_LIBS(door_create, door)
439 AC_CHECK_FUNCS(getudbnam setlim)
441 dnl AC_KRB_FUNC_GETCWD_BROKEN
444 dnl Check for fields in struct utmp
447 AC_HAVE_STRUCT_FIELD(struct utmp, ut_addr, [#include <utmp.h>])
448 AC_HAVE_STRUCT_FIELD(struct utmp, ut_host, [#include <utmp.h>])
449 AC_HAVE_STRUCT_FIELD(struct utmp, ut_id, [#include <utmp.h>])
450 AC_HAVE_STRUCT_FIELD(struct utmp, ut_pid, [#include <utmp.h>])
451 AC_HAVE_STRUCT_FIELD(struct utmp, ut_type, [#include <utmp.h>])
452 AC_HAVE_STRUCT_FIELD(struct utmp, ut_user, [#include <utmp.h>])
453 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_exit, [#include <utmpx.h>])
454 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_syslen, [#include <utmpx.h>])
456 AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t,
457 u_int8_t, u_int16_t, u_int32_t, u_int64_t,
458 uint8_t, uint16_t, uint32_t, uint64_t],,,[
459 #ifdef HAVE_INTTYPES_H
460 #include <inttypes.h>
462 #ifdef HAVE_SYS_TYPES_H
463 #include <sys/types.h>
465 #ifdef HAVE_SYS_BITYPES_H
466 #include <sys/bitypes.h>
468 #ifdef HAVE_BIND_BITYPES_H
469 #include <bind/bitypes.h>
471 #ifdef HAVE_NETINET_IN6_MACHTYPES_H
472 #include <netinet/in6_machtypes.h>
480 dnl Some operating systems already have com_err and compile_et
483 rk_AUTH_MODULES([sia afskauthlib])
487 AH_BOTTOM([#ifdef ROKEN_RENAME
488 #include "roken_rename.h"
491 AC_CONFIG_FILES(Makefile \
493 include/kadm5/Makefile \
497 lib/auth/afskauthlib/Makefile \
498 lib/auth/pam/Makefile \
499 lib/auth/sia/Makefile \
501 lib/com_err/Makefile \
503 lib/editline/Makefile \
504 lib/gssapi/Makefile \
521 appl/afsutil/Makefile \
523 appl/ftp/common/Makefile \
524 appl/ftp/ftp/Makefile \
525 appl/ftp/ftpd/Makefile \
527 appl/login/Makefile \
529 appl/popper/Makefile \
534 appl/xnlock/Makefile \
535 appl/telnet/Makefile \
536 appl/telnet/libtelnet/Makefile \
537 appl/telnet/telnet/Makefile \
538 appl/telnet/telnetd/Makefile \
541 appl/dceutils/Makefile \
549 dnl This is the release version name-number[beta]
552 cat > include/newversion.h.in <<EOF
553 const char *heimdal_long_version = "@([#])\$Version: $PACKAGE_STRING by @USER@ on @HOST@ ($host) @DATE@ \$";
554 const char *heimdal_version = "AC_PACKAGE_STRING";
557 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
558 echo "include/version.h is unchanged"
559 rm -f include/newversion.h.in
561 echo "creating include/version.h"
562 User=${USER-${LOGNAME}}
563 Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
565 mv -f include/newversion.h.in include/version.h.in
566 sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h