1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION($Revision: 1.325.2.2 $)
4 #test -z "$CFLAGS" && CFLAGS="-g"
5 AC_INIT(Heimdal, 0.5.1, heimdal-bugs@pdc.kth.se)
6 AC_CONFIG_SRCDIR([kuser/kinit.c])
7 AM_CONFIG_HEADER(include/config.h)
9 dnl Checks for programs.
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 AC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
54 rk_TEST_PACKAGE(openldap,
57 [-lldap -llber],,,OPENLDAP)
59 rk_TEST_PACKAGE(krb4,[#include <krb.h>],-lkrb,-ldes,/usr/athena, KRB4, krb4-config)
62 if test "$with_krb4" != "no"; then
64 CFLAGS="$CFLAGS $INCLUDE_krb4"
66 LIBS="$LIB_krb4 $LIBS"
69 AC_CACHE_CHECK(for four valued krb_put_int, ac_cv_func_krb_put_int_four,
70 [AC_TRY_COMPILE([#include <krb.h>],[
72 krb_put_int(17, tmp, 4, sizeof(tmp));],
73 ac_cv_func_krb_put_int_four=yes,
74 ac_cv_func_krb_put_int_four=no)
76 if test "$ac_cv_func_krb_put_int_four" = yes; then
77 AC_DEFINE(HAVE_FOUR_VALUED_KRB_PUT_INT, 1,
78 [define if krb_put_int takes four arguments.])
80 AH_BOTTOM([#if defined(HAVE_FOUR_VALUED_KRB_PUT_INT) || !defined(KRB4)
81 #define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (L), (S))
83 #define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (S))
86 AC_CACHE_CHECK(for KRB_VERIFY_SECURE, ac_cv_func_krb_verify_secure,
87 [AC_TRY_COMPILE([#include <krb.h>],[
88 int x = KRB_VERIFY_SECURE],
89 ac_cv_func_krb_verify_secure=yes,
90 ac_cv_func_krb_verify_secure=no)
92 if test "$ac_cv_func_krb_verify_secure" != yes; then
93 AC_DEFINE(KRB_VERIFY_SECURE, 1,
94 [Define to one if your krb.h doesn't])
95 AC_DEFINE(KRB_VERIFY_SECURE_FAIL, 2,
96 [Define to two if your krb.h doesn't])
98 AC_CACHE_CHECK(for KRB_VERIFY_NOT_SECURE,
99 ac_cv_func_krb_verify_not_secure,
100 [AC_TRY_COMPILE([#include <krb.h>],[
101 int x = KRB_VERIFY_NOT_SECURE],
102 ac_cv_func_krb_verify_not_secure=yes,
103 ac_cv_func_krb_verify_not_secure=no)
105 if test "$ac_cv_func_krb_verify_not_secure" != yes; then
106 AC_DEFINE(KRB_VERIFY_NOT_SECURE, 0,
107 [Define to zero if your krb.h doesn't])
109 AC_FIND_FUNC(krb_enable_debug)
110 AC_FIND_FUNC(krb_disable_debug)
111 AC_FIND_FUNC(krb_get_our_ip_for_realm)
112 AC_FIND_FUNC(krb_kdctimeofday)
114 [#ifndef HAVE_KRB_KDCTIMEOFDAY
115 #define krb_kdctimeofday(X) gettimeofday((X), NULL)
117 AC_FIND_FUNC(krb_get_kdc_time_diff)
119 [#ifndef HAVE_KRB_GET_KDC_TIME_DIFF
120 #define krb_get_kdc_time_diff() (0)
122 AC_CACHE_CHECK([for KRB_SENDAUTH_VERS],
123 ac_cv_func_krb_sendauth_vers,
124 [AC_TRY_COMPILE([#include <krb.h>
126 char *x = KRB_SENDAUTH_VERS],
127 ac_cv_func_krb_sendauth_vers=yes,
128 ac_cv_func_krb_sendauth_vers=no)
130 if test "$ac_cv_func_krb_sendauth_vers" != yes; then
131 AC_DEFINE(KRB_SENDAUTH_VERS, ["AUTHV0.1"],
132 [This is the krb4 sendauth version.])
134 AC_CACHE_CHECK(for krb_mk_req with const arguments,
135 ac_cv_func_krb_mk_req_const,
136 [AC_TRY_COMPILE([#include <krb.h>
137 int krb_mk_req(KTEXT a, const char *s, const char *i,
138 const char *r, int32_t checksum)
140 ac_cv_func_krb_mk_req_const=yes,
141 ac_cv_func_krb_mk_req_const=no)
143 if test "$ac_cv_func_krb_mk_req_const" = "yes"; then
144 AC_DEFINE(KRB_MK_REQ_CONST, 1,
145 [Define if krb_mk_req takes const char *])
149 CFLAGS="$save_CFLAGS"
150 LIB_kdb="-lkdb -lkrb"
152 AM_CONDITIONAL(KRB4, test "$with_krb4" != "no")
153 AM_CONDITIONAL(KRB5, true)
154 AM_CONDITIONAL(do_roken_rename, true)
156 AC_DEFINE(KRB5, 1, [Enable Kerberos 5 support in applications.])dnl
162 AC_HELP_STRING([--enable-dce],[if you want support for DCE/DFS PAG's]))
163 if test "$enable_dce" = yes; then
164 AC_DEFINE(DCE, 1, [Define if you want support for DCE/DFS PAG's.])
166 AM_CONDITIONAL(DCE, test "$enable_dce" = yes)
168 ## XXX quite horrible:
169 if test -f /etc/ibmcxx.cfg; then
170 dpagaix_ldadd=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/libraries/{;s/^[[^=]]*=\(.*\)/\1/;s/,/ /gp;}'`
171 dpagaix_cflags=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/options/{;s/^[[^=]]*=\(.*\)/\1/;s/-q[^,]*//;s/,/ /gp;}'`
174 dpagaix_cflags="-D_THREAD_SAFE -D_AIX_PTHREADS_D7 -D_AIX32_THREADS=1 -D_AES_SOURCE -D_AIX41 -I/usr/include/dce"
175 dpagaix_ldadd="-L/usr/lib/threads -ldcelibc_r -ldcepthreads -lpthreads_compat lpthreads -lc_r"
176 dpagaix_ldflags="-Wl,-bI:dfspag.exp"
178 AC_SUBST(dpagaix_cflags)
179 AC_SUBST(dpagaix_ldadd)
180 AC_SUBST(dpagaix_ldflags)
184 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])
187 LIB_roken="\$(top_builddir)/lib/vers/libvers.la $LIB_roken"
194 AC_HELP_STRING([--disable-mmap],[disable use of mmap]))
195 if test "$enable_mmap" = "no"; then
196 AC_DEFINE(NO_MMAP, 1, [Define if you don't want to use mmap.])
201 rk_TEST_PACKAGE(readline,
203 #include <readline.h>],-lreadline,,, READLINE)
205 rk_TEST_PACKAGE(hesiod,[#include <hesiod.h>],-lhesiod,,, HESIOD)
216 AM_CONDITIONAL(HAVE_X, test "$no_x" != yes)
222 dnl Checks for typedefs, structures, and compiler characteristics.
225 AC_CHECK_TYPE_EXTRA(mode_t, unsigned short, [])
226 AC_CHECK_TYPE_EXTRA(sig_atomic_t, int, [#include <signal.h>])
227 AC_HAVE_TYPE([long long])
231 dnl Checks for header files.
248 netinet/in6_machtypes.h \
253 security/pam_modules.h \
287 AC_ARG_ENABLE(netinfo,
288 AC_HELP_STRING([--enable-netinfo],[enable netinfo for configuration lookup]))
290 if test "$ac_cv_header_netinfo_ni_h" = yes -a "$enable_netinfo" = yes; then
291 AC_DEFINE(HAVE_NETINFO, 1,
292 [Define if you want to use Netinfo instead of krb5.conf.])
295 dnl Checks for libraries.
297 AC_FIND_FUNC_NO_LIBS(logwtmp, util)
298 AC_FIND_FUNC_NO_LIBS(logout, util)
299 AC_FIND_FUNC_NO_LIBS(openpty, util)
300 AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses)
302 dnl Checks for library functions.
332 yp_get_default_domain \
339 AC_CHECK_GETPWNAM_R_POSIX
342 AC_CHECK_FUNCS(getudbnam setlim)
344 dnl AC_KRB_FUNC_GETCWD_BROKEN
347 dnl Check for fields in struct utmp
350 AC_HAVE_STRUCT_FIELD(struct utmp, ut_addr, [#include <utmp.h>])
351 AC_HAVE_STRUCT_FIELD(struct utmp, ut_host, [#include <utmp.h>])
352 AC_HAVE_STRUCT_FIELD(struct utmp, ut_id, [#include <utmp.h>])
353 AC_HAVE_STRUCT_FIELD(struct utmp, ut_pid, [#include <utmp.h>])
354 AC_HAVE_STRUCT_FIELD(struct utmp, ut_type, [#include <utmp.h>])
355 AC_HAVE_STRUCT_FIELD(struct utmp, ut_user, [#include <utmp.h>])
356 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_exit, [#include <utmpx.h>])
357 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_syslen, [#include <utmpx.h>])
359 AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t,
360 u_int8_t, u_int16_t, u_int32_t, u_int64_t,
361 uint8_t, uint16_t, uint32_t, uint64_t],,,[
362 #ifdef HAVE_INTTYPES_H
363 #include <inttypes.h>
365 #ifdef HAVE_SYS_TYPES_H
366 #include <sys/types.h>
368 #ifdef HAVE_SYS_BITYPES_H
369 #include <sys/bitypes.h>
371 #ifdef HAVE_BIND_BITYPES_H
372 #include <bind/bitypes.h>
374 #ifdef HAVE_NETINET_IN6_MACHTYPES_H
375 #include <netinet/in6_machtypes.h>
383 dnl Some operating systems already have com_err and compile_et
386 rk_AUTH_MODULES([sia afskauthlib])
390 LTLIBOBJS=`echo "$LIB@&t@OBJS" |
391 sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
394 AH_BOTTOM([#ifdef ROKEN_RENAME
395 #include "roken_rename.h"
398 AC_CONFIG_FILES(Makefile \
400 include/kadm5/Makefile \
404 lib/auth/afskauthlib/Makefile \
405 lib/auth/pam/Makefile \
406 lib/auth/sia/Makefile \
408 lib/com_err/Makefile \
410 lib/editline/Makefile \
411 lib/gssapi/Makefile \
427 appl/afsutil/Makefile \
429 appl/ftp/common/Makefile \
430 appl/ftp/ftp/Makefile \
431 appl/ftp/ftpd/Makefile \
433 appl/login/Makefile \
435 appl/popper/Makefile \
440 appl/xnlock/Makefile \
441 appl/telnet/Makefile \
442 appl/telnet/libtelnet/Makefile \
443 appl/telnet/telnet/Makefile \
444 appl/telnet/telnetd/Makefile \
447 appl/dceutils/Makefile \
455 dnl This is the release version name-number[beta]
458 cat > include/newversion.h.in <<EOF
459 const char *heimdal_long_version = "@([#])\$Version: $PACKAGE_STRING by @USER@ on @HOST@ ($host) @DATE@ \$";
460 const char *heimdal_version = "AC_PACKAGE_STRING";
463 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
464 echo "include/version.h is unchanged"
465 rm -f include/newversion.h.in
467 echo "creating include/version.h"
468 User=${USER-${LOGNAME}}
469 Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
471 mv -f include/newversion.h.in include/version.h.in
472 sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h