1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION($Revision: 1.331.2.8 $)
4 ##test -z "$CFLAGS" && CFLAGS="-g"
5 AC_INIT([Heimdal], [0.6.3], [heimdal-bugs@pdc.kth.se])
6 AC_CONFIG_SRCDIR([kuser/kinit.c])
7 AM_CONFIG_HEADER(include/config.h)
9 dnl Checks for programs.
14 AM_INIT_AUTOMAKE([foreign no-dependencies 1.7])
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)
27 dnl need to set this on the command line, since it might otherwise break
28 dnl with generated code, such as lex
29 if test "$enable_largefile" != no -a "$ac_cv_sys_large_files" != no; then
30 CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
34 dnl this is needed to run the configure tests against glibc
36 AC_DEFINE([_GNU_SOURCE], 1,
37 [Define to enable extensions on glibc-based systems such as Linux.])
51 libdir="$libdir$abilibdirext"
58 AC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
60 rk_TEST_PACKAGE(openldap,
63 [-lldap -llber],,,OPENLDAP)
65 rk_TEST_PACKAGE(krb4,[#include <krb.h>],-lkrb,-ldes,/usr/athena, KRB4, krb4-config)
68 if test "$with_krb4" != "no"; then
70 CFLAGS="$CFLAGS $INCLUDE_krb4"
72 LIBS="$LIB_krb4 $LIBS"
75 AC_CACHE_CHECK(for four valued krb_put_int, ac_cv_func_krb_put_int_four,
76 [AC_TRY_COMPILE([#include <krb.h>],[
78 krb_put_int(17, tmp, 4, sizeof(tmp));],
79 ac_cv_func_krb_put_int_four=yes,
80 ac_cv_func_krb_put_int_four=no)
82 if test "$ac_cv_func_krb_put_int_four" = yes; then
83 AC_DEFINE(HAVE_FOUR_VALUED_KRB_PUT_INT, 1,
84 [define if krb_put_int takes four arguments.])
86 AH_BOTTOM([#if defined(HAVE_FOUR_VALUED_KRB_PUT_INT) || !defined(KRB4)
87 #define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (L), (S))
89 #define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (S))
92 AC_CACHE_CHECK(for KRB_VERIFY_SECURE, ac_cv_func_krb_verify_secure,
93 [AC_TRY_COMPILE([#include <krb.h>],[
94 int x = KRB_VERIFY_SECURE],
95 ac_cv_func_krb_verify_secure=yes,
96 ac_cv_func_krb_verify_secure=no)
98 if test "$ac_cv_func_krb_verify_secure" != yes; then
99 AC_DEFINE(KRB_VERIFY_SECURE, 1,
100 [Define to one if your krb.h doesn't])
101 AC_DEFINE(KRB_VERIFY_SECURE_FAIL, 2,
102 [Define to two if your krb.h doesn't])
104 AC_CACHE_CHECK(for KRB_VERIFY_NOT_SECURE,
105 ac_cv_func_krb_verify_not_secure,
106 [AC_TRY_COMPILE([#include <krb.h>],[
107 int x = KRB_VERIFY_NOT_SECURE],
108 ac_cv_func_krb_verify_not_secure=yes,
109 ac_cv_func_krb_verify_not_secure=no)
111 if test "$ac_cv_func_krb_verify_not_secure" != yes; then
112 AC_DEFINE(KRB_VERIFY_NOT_SECURE, 0,
113 [Define to zero if your krb.h doesn't])
115 AC_FIND_FUNC(krb_enable_debug)
116 AC_FIND_FUNC(krb_disable_debug)
117 AC_FIND_FUNC(krb_get_our_ip_for_realm)
118 AC_FIND_FUNC(krb_kdctimeofday)
120 [#ifndef HAVE_KRB_KDCTIMEOFDAY
121 #define krb_kdctimeofday(X) gettimeofday((X), NULL)
123 AC_FIND_FUNC(krb_get_kdc_time_diff)
125 [#ifndef HAVE_KRB_GET_KDC_TIME_DIFF
126 #define krb_get_kdc_time_diff() (0)
128 AC_CACHE_CHECK([for KRB_SENDAUTH_VERS],
129 ac_cv_func_krb_sendauth_vers,
130 [AC_TRY_COMPILE([#include <krb.h>
132 char *x = KRB_SENDAUTH_VERS],
133 ac_cv_func_krb_sendauth_vers=yes,
134 ac_cv_func_krb_sendauth_vers=no)
136 if test "$ac_cv_func_krb_sendauth_vers" != yes; then
137 AC_DEFINE(KRB_SENDAUTH_VERS, ["AUTHV0.1"],
138 [This is the krb4 sendauth version.])
140 AC_CACHE_CHECK(for krb_mk_req with const arguments,
141 ac_cv_func_krb_mk_req_const,
142 [AC_TRY_COMPILE([#include <krb.h>
143 int krb_mk_req(KTEXT a, const char *s, const char *i,
144 const char *r, int32_t checksum)
146 ac_cv_func_krb_mk_req_const=yes,
147 ac_cv_func_krb_mk_req_const=no)
149 if test "$ac_cv_func_krb_mk_req_const" = "yes"; then
150 AC_DEFINE(KRB_MK_REQ_CONST, 1,
151 [Define if krb_mk_req takes const char *])
155 CFLAGS="$save_CFLAGS"
156 LIB_kdb="-lkdb -lkrb"
158 AM_CONDITIONAL(KRB4, test "$with_krb4" != "no")
159 AM_CONDITIONAL(KRB5, true)
160 AM_CONDITIONAL(do_roken_rename, true)
162 AC_DEFINE(KRB5, 1, [Enable Kerberos 5 support in applications.])dnl
168 AC_HELP_STRING([--enable-dce],[if you want support for DCE/DFS PAG's]))
169 if test "$enable_dce" = yes; then
170 AC_DEFINE(DCE, 1, [Define if you want support for DCE/DFS PAG's.])
172 AM_CONDITIONAL(DCE, test "$enable_dce" = yes)
174 ## XXX quite horrible:
175 if test -f /etc/ibmcxx.cfg; then
176 dpagaix_ldadd=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/libraries/{;s/^[[^=]]*=\(.*\)/\1/;s/,/ /gp;}'`
177 dpagaix_cflags=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/options/{;s/^[[^=]]*=\(.*\)/\1/;s/-q[^,]*//;s/,/ /gp;}'`
180 dpagaix_cflags="-D_THREAD_SAFE -D_AIX_PTHREADS_D7 -D_AIX32_THREADS=1 -D_AES_SOURCE -D_AIX41 -I/usr/include/dce"
181 dpagaix_ldadd="-L/usr/lib/threads -ldcelibc_r -ldcepthreads -lpthreads_compat lpthreads -lc_r"
182 dpagaix_ldflags="-Wl,-bI:dfspag.exp"
184 AC_SUBST(dpagaix_cflags)
185 AC_SUBST(dpagaix_ldadd)
186 AC_SUBST(dpagaix_ldflags)
190 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])
193 LIB_roken="\$(top_builddir)/lib/vers/libvers.la $LIB_roken"
200 AC_HELP_STRING([--disable-mmap],[disable use of mmap]))
201 if test "$enable_mmap" = "no"; then
202 AC_DEFINE(NO_MMAP, 1, [Define if you don't want to use mmap.])
207 rk_TEST_PACKAGE(readline,
209 #include <readline.h>],-lreadline,,, READLINE)
211 rk_TEST_PACKAGE(hesiod,[#include <hesiod.h>],-lhesiod,,, HESIOD)
222 AM_CONDITIONAL(HAVE_X, test "$no_x" != yes)
228 dnl Checks for typedefs, structures, and compiler characteristics.
231 AC_CHECK_TYPE_EXTRA(mode_t, unsigned short, [])
232 AC_CHECK_TYPE_EXTRA(sig_atomic_t, int, [#include <signal.h>])
233 AC_HAVE_TYPE([long long])
237 dnl Checks for header files.
254 netinet/in6_machtypes.h \
259 security/pam_modules.h \
293 AC_ARG_ENABLE(netinfo,
294 AC_HELP_STRING([--enable-netinfo],[enable netinfo for configuration lookup]))
296 if test "$ac_cv_header_netinfo_ni_h" = yes -a "$enable_netinfo" = yes; then
297 AC_DEFINE(HAVE_NETINFO, 1,
298 [Define if you want to use Netinfo instead of krb5.conf.])
301 dnl Checks for libraries.
303 AC_FIND_FUNC_NO_LIBS(logwtmp, util)
304 AC_FIND_FUNC_NO_LIBS(logout, util)
305 AC_FIND_FUNC_NO_LIBS(openpty, util)
306 AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses)
308 dnl Checks for library functions.
338 yp_get_default_domain \
345 AC_CHECK_GETPWNAM_R_POSIX
348 AC_CHECK_FUNCS(getudbnam setlim)
350 dnl AC_KRB_FUNC_GETCWD_BROKEN
353 dnl Check for fields in struct utmp
356 AC_HAVE_STRUCT_FIELD(struct utmp, ut_addr, [#include <utmp.h>])
357 AC_HAVE_STRUCT_FIELD(struct utmp, ut_host, [#include <utmp.h>])
358 AC_HAVE_STRUCT_FIELD(struct utmp, ut_id, [#include <utmp.h>])
359 AC_HAVE_STRUCT_FIELD(struct utmp, ut_pid, [#include <utmp.h>])
360 AC_HAVE_STRUCT_FIELD(struct utmp, ut_type, [#include <utmp.h>])
361 AC_HAVE_STRUCT_FIELD(struct utmp, ut_user, [#include <utmp.h>])
362 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_exit, [#include <utmpx.h>])
363 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_syslen, [#include <utmpx.h>])
365 AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t,
366 u_int8_t, u_int16_t, u_int32_t, u_int64_t,
367 uint8_t, uint16_t, uint32_t, uint64_t],,,[
368 #ifdef HAVE_INTTYPES_H
369 #include <inttypes.h>
371 #ifdef HAVE_SYS_TYPES_H
372 #include <sys/types.h>
374 #ifdef HAVE_SYS_BITYPES_H
375 #include <sys/bitypes.h>
377 #ifdef HAVE_BIND_BITYPES_H
378 #include <bind/bitypes.h>
380 #ifdef HAVE_NETINET_IN6_MACHTYPES_H
381 #include <netinet/in6_machtypes.h>
389 dnl Some operating systems already have com_err and compile_et
392 rk_AUTH_MODULES([sia afskauthlib])
396 LTLIBOBJS=`echo "$LIB@&t@OBJS" |
397 sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
400 AH_BOTTOM([#ifdef ROKEN_RENAME
401 #include "roken_rename.h"
404 AC_CONFIG_FILES(Makefile \
406 include/kadm5/Makefile \
410 lib/auth/afskauthlib/Makefile \
411 lib/auth/pam/Makefile \
412 lib/auth/sia/Makefile \
414 lib/com_err/Makefile \
416 lib/editline/Makefile \
417 lib/gssapi/Makefile \
433 appl/afsutil/Makefile \
435 appl/ftp/common/Makefile \
436 appl/ftp/ftp/Makefile \
437 appl/ftp/ftpd/Makefile \
439 appl/login/Makefile \
441 appl/popper/Makefile \
446 appl/xnlock/Makefile \
447 appl/telnet/Makefile \
448 appl/telnet/libtelnet/Makefile \
449 appl/telnet/telnet/Makefile \
450 appl/telnet/telnetd/Makefile \
453 appl/dceutils/Makefile \
461 dnl This is the release version name-number[beta]
464 cat > include/newversion.h.in <<EOF
465 const char *heimdal_long_version = "@([#])\$Version: $PACKAGE_STRING by @USER@ on @HOST@ ($host) @DATE@ \$";
466 const char *heimdal_version = "AC_PACKAGE_STRING";
469 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
470 echo "include/version.h is unchanged"
471 rm -f include/newversion.h.in
473 echo "creating include/version.h"
474 User=${USER-${LOGNAME}}
475 Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
477 mv -f include/newversion.h.in include/version.h.in
478 sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h