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],[1.2.99],[heimdal-bugs@h5l.org])
6 AC_CONFIG_SRCDIR([kuser/kinit.c])
7 AC_CONFIG_HEADERS(include/config.h)
8 AC_CONFIG_MACRO_DIR([cf])
10 AM_INIT_AUTOMAKE([foreign 1.10])
13 dnl Checks for programs.
18 AC_PREFIX_DEFAULT(/usr/heimdal)
20 test "$sysconfdir" = '${prefix}/etc' && sysconfdir='/etc'
21 test "$localstatedir" = '${prefix}/var' && localstatedir='/var/heimdal'
25 AC_SUBST(CANONICAL_HOST)
27 dnl Hints for autobuild
37 dnl this is needed to run the configure tests against glibc
39 AC_DEFINE([_GNU_SOURCE], 1,
40 [Define to enable extensions on glibc-based systems such as Linux.])
54 libdir="$libdir$abilibdirext"
59 LT_INIT([shared static win32-dll])
61 AM_CONDITIONAL(ENABLE_SHARED, test "$enable_shared" = "yes")
64 rk_TEST_PACKAGE(openldap,
67 [-lldap -llber],,,OPENLDAP)
69 AC_ARG_ENABLE(hdb-openldap-module,
70 AS_HELP_STRING([--enable-hdb-openldap-module],
71 [if you want support to build openldap hdb as shared object]))
72 if test "$enable_hdb_openldap_module" = yes -a "$with_openldap" = yes; then
73 AC_DEFINE(OPENLDAP_MODULE, 1, [Define if you want support for hdb ldap module])
75 AM_CONDITIONAL(OPENLDAP_MODULE, test "$enable_hdb_openldap_module" = yes -a "$with_openldap" = yes)
78 dnl Optional modules, pk-init, digest, kx509
81 AC_ARG_ENABLE(pk-init,
82 AS_HELP_STRING([--disable-pk-init],
83 [if you want disable to PK-INIT support]))
84 if test "$enable_pk_init" != no ;then
85 AC_DEFINE([PKINIT], 1, [Define to enable PKINIT.])
87 AM_CONDITIONAL(PKINIT, test "$enable_pk_init" != no)
90 AS_HELP_STRING([--disable-digest],
91 [if you want disable to DIGEST support]))
92 if test "$enable_digest" != no ;then
93 AC_DEFINE([DIGEST], 1, [Define to enable DIGEST.])
97 AS_HELP_STRING([--disable-kx509],
98 [if you want disable to kx509 support]))
99 if test "$enable_kx509" != no ;then
100 AC_DEFINE([KX509], 1, [Define to enable kx509.])
104 AS_HELP_STRING([--disable-krb4],
105 [if you want disable to krb4 support]))
106 if test "$enable_krb4" != no ;then
107 AC_DEFINE([KRB4], 1, [Define to enable Kerberos 4.])
112 rk_TEST_PACKAGE(sqlite3,
113 [#include <sqlite3.h>
114 #ifndef SQLITE_OPEN_CREATE
117 [-lsqlite3],,,SQLITE3)
119 if test "X$with_sqlite3" != Xyes ; then
120 INCLUDE_sqlite3="-I\$(top_srcdir)/lib/sqlite"
121 LIB_sqlite3="\$(top_builddir)/lib/sqlite/libheimsqlite.la"
123 AM_CONDITIONAL(SQLITE3, test "X$with_sqlite3" = Xyes)
125 dnl check for libintl
126 rk_TEST_PACKAGE(libintl,
127 [#include <libintl.h>],
130 dnl path where the hdb directory is stored
131 AC_ARG_WITH([hdbdir],
132 [AS_HELP_STRING([--with-hdbdir],[Default location for KDC database @<:@default=/var/heimdal@:>@])],
134 [with_hdbdir=/var/heimdal])
135 DIR_hdbdir="$with_hdbdir"
136 AC_SUBST([DIR_hdbdir])
139 dnl no kerberos4 any more
141 AC_SUBST(INCLUDE_krb4)
143 AM_CONDITIONAL(KRB4, false)
145 AM_CONDITIONAL(KRB5, true)
146 AM_CONDITIONAL(do_roken_rename, true)
148 AC_DEFINE(KRB5, 1, [Enable Kerberos 5 support in applications.])dnl
156 AS_HELP_STRING([--enable-dce],[if you want support for DCE/DFS PAG's]))
157 if test "$enable_dce" = yes; then
158 AC_DEFINE(DCE, 1, [Define if you want support for DCE/DFS PAG's.])
160 AM_CONDITIONAL(DCE, test "$enable_dce" = yes)
162 ## XXX quite horrible:
163 if test -f /etc/ibmcxx.cfg; then
164 dpagaix_ldadd=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/libraries/{;s/^[[^=]]*=\(.*\)/\1/;s/,/ /gp;}'`
165 dpagaix_cflags=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/options/{;s/^[[^=]]*=\(.*\)/\1/;s/-q[^,]*//;s/,/ /gp;}'`
168 dpagaix_cflags="-D_THREAD_SAFE -D_AIX_PTHREADS_D7 -D_AIX32_THREADS=1 -D_AES_SOURCE -D_AIX41 -I/usr/include/dce"
169 dpagaix_ldadd="-L/usr/lib/threads -ldcelibc_r -ldcepthreads -lpthreads_compat lpthreads -lc_r"
170 dpagaix_ldflags="-Wl,-bI:dfspag.exp"
172 AC_SUBST(dpagaix_cflags)
173 AC_SUBST(dpagaix_ldadd)
174 AC_SUBST(dpagaix_ldflags)
176 AC_ARG_ENABLE([afs-support],
177 AS_HELP_STRING([--disable-afs-support],[if you don't want support for AFS]))
178 if test "$enable_afs_support" = no; then
179 AC_DEFINE(NO_AFS, 1, [Define if you don't wan't support for AFS.])
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 LIBADD_roken="$LIB_roken"
188 AC_SUBST(LIBADD_roken)dnl
189 LIB_roken="\$(top_builddir)/lib/vers/libvers.la $LIB_roken"
196 AS_HELP_STRING([--disable-mmap],[disable use of mmap]))
197 if test "$enable_mmap" = "no"; then
198 AC_DEFINE(NO_MMAP, 1, [Define if you don't want to use mmap.])
201 AC_ARG_ENABLE(afs-string-to-key,
202 AS_HELP_STRING([--disable-afs-string-to-key],
203 [disable use of weak AFS string-to-key functions]),
204 [], [enable_afs_string_to_key=yes])
206 if test "$enable_afs_string_to_key" = "yes"; then
207 AC_DEFINE(ENABLE_AFS_STRING_TO_KEY, 1, [Define if want to use the weak AFS string to key functions.])
213 rk_TEST_PACKAGE(readline,
215 #include <readline.h>],-lreadline,,, READLINE)
217 rk_TEST_PACKAGE(hesiod,[#include <hesiod.h>],-lhesiod,,, HESIOD)
224 AM_CONDITIONAL(HAVE_X, test "$no_x" != yes)
230 dnl Checks for typedefs, structures, and compiler characteristics.
233 AC_CHECK_TYPE_EXTRA(mode_t, unsigned short, [])
234 AC_CHECK_TYPE_EXTRA(sig_atomic_t, int, [#include <signal.h>])
235 AC_HAVE_TYPE([long long])
239 dnl Checks for header files.
256 netinet/in6_machtypes.h \
297 dnl On Solaris 8 there's a compilation warning for term.h because
298 dnl it doesn't define `bool'.
299 AC_CHECK_HEADERS(term.h, , , -)
301 dnl aix have asl.h (A/IX screen library) that we don't want
302 AC_CHECK_HEADERS(asl.h, , , [
304 #ifndef ASL_STRING_EMERG
305 #error ASL_STRING_EMERG missing
308 AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT
309 #if HAVE_SYS_SOCKET_H
310 #include <sys/socket.h>
313 AC_CHECK_HEADERS(sys/ptyvar.h, , , [AC_INCLUDES_DEFAULT
318 AC_CHECK_HEADERS(sys/strtty.h, , , [AC_INCLUDES_DEFAULT
322 #if HAVE_SYS_STREAM_H
323 #include <sys/stream.h>
326 AC_CHECK_HEADERS(sys/ucred.h, , , [AC_INCLUDES_DEFAULT
328 #include <sys/types.h>
331 #include <sys/param.h>
334 AC_CHECK_HEADERS(security/pam_modules.h, , , [AC_INCLUDES_DEFAULT
335 #include <security/pam_appl.h>
339 rk_WIN32_EXPORT(BUILD_KRB5_LIB, KRB5_LIB)
340 rk_WIN32_EXPORT(BUILD_ROKEN_LIB, ROKEN_LIB)
341 rk_WIN32_EXPORT(BUILD_GSSAPI_LIB, GSSAPI_LIB)
343 dnl Checks for libraries.
345 AC_FIND_FUNC_NO_LIBS(logwtmp, util,[
350 AC_FIND_FUNC_NO_LIBS(logout, util,[
355 AC_FIND_FUNC_NO_LIBS(openpty, util,[
361 AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses,[
362 #ifdef HAVE_TERMCAP_H
370 dnl Checks for library functions.
402 yp_get_default_domain \
409 AC_CHECK_GETPWNAM_R_POSIX
411 dnl detect doors on solaris
412 if test "$enable_pthread_support" != no; then
414 LIBS="$LIBS $PTHREADS_LIBS"
415 AC_FIND_FUNC_NO_LIBS(door_create, door)
420 AS_HELP_STRING([--enable-kcm],[enable Kerberos Credentials Manager]),
423 if test "$enable_kcm" = yes ; then
424 if test "$ac_cv_header_sys_un_h" != yes -a "$ac_cv_funclib_door_create" != yes ; then
428 if test "$enable_kcm" = yes; then
429 AC_DEFINE(HAVE_KCM, 1,
430 [Define if you want to use the Kerberos Credentials Manager.])
432 AM_CONDITIONAL(KCM, test "$enable_kcm" = yes)
437 AC_CHECK_FUNCS(getudbnam setlim)
439 dnl AC_KRB_FUNC_GETCWD_BROKEN
442 dnl Check for fields in struct utmp
445 AC_HAVE_STRUCT_FIELD(struct utmp, ut_addr, [#include <utmp.h>])
446 AC_HAVE_STRUCT_FIELD(struct utmp, ut_host, [#include <utmp.h>])
447 AC_HAVE_STRUCT_FIELD(struct utmp, ut_id, [#include <utmp.h>])
448 AC_HAVE_STRUCT_FIELD(struct utmp, ut_pid, [#include <utmp.h>])
449 AC_HAVE_STRUCT_FIELD(struct utmp, ut_type, [#include <utmp.h>])
450 AC_HAVE_STRUCT_FIELD(struct utmp, ut_user, [#include <utmp.h>])
451 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_exit, [#include <utmpx.h>])
452 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_syslen, [#include <utmpx.h>])
454 AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t,
455 u_int8_t, u_int16_t, u_int32_t, u_int64_t,
456 uint8_t, uint16_t, uint32_t, uint64_t],,,[
457 #ifdef HAVE_INTTYPES_H
458 #include <inttypes.h>
460 #ifdef HAVE_SYS_TYPES_H
461 #include <sys/types.h>
463 #ifdef HAVE_SYS_BITYPES_H
464 #include <sys/bitypes.h>
466 #ifdef HAVE_BIND_BITYPES_H
467 #include <bind/bitypes.h>
469 #ifdef HAVE_NETINET_IN6_MACHTYPES_H
470 #include <netinet/in6_machtypes.h>
474 rk_FRAMEWORK_SECURITY
480 dnl Some operating systems already have com_err and compile_et
483 rk_AUTH_MODULES([sia afskauthlib])
487 rk_WFLAGS([-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs])
490 AH_BOTTOM([#ifdef ROKEN_RENAME
491 #include "roken_rename.h"
494 AC_CONFIG_FILES(Makefile \
497 include/gssapi/Makefile \
498 include/hcrypto/Makefile \
499 include/kadm5/Makefile \
503 lib/auth/afskauthlib/Makefile \
504 lib/auth/pam/Makefile \
505 lib/auth/sia/Makefile \
507 lib/com_err/Makefile \
508 lib/hcrypto/Makefile \
509 lib/editline/Makefile \
511 lib/gssapi/Makefile \
521 lib/sqlite/Makefile \
532 appl/afsutil/Makefile \
534 appl/ftp/common/Makefile \
535 appl/ftp/ftp/Makefile \
536 appl/ftp/ftpd/Makefile \
537 appl/gssmask/Makefile \
539 appl/login/Makefile \
541 appl/popper/Makefile \
546 appl/xnlock/Makefile \
547 appl/telnet/Makefile \
548 appl/telnet/libtelnet/Makefile \
549 appl/telnet/telnet/Makefile \
550 appl/telnet/telnetd/Makefile \
553 appl/dceutils/Makefile \
558 tests/ldap/Makefile \
560 tests/java/Makefile \
561 tests/plugin/Makefile \
563 packages/mac/Makefile \
571 dnl This is the release version name-number[beta]
574 cat > include/newversion.h.in <<EOF
575 const char *heimdal_long_version = "@([#])\$Version: $PACKAGE_STRING by @USER@ on @HOST@ ($host) @DATE@ \$";
576 const char *heimdal_version = "AC_PACKAGE_STRING";
579 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
580 echo "include/version.h is unchanged"
581 rm -f include/newversion.h.in
583 echo "creating include/version.h"
584 User=${USER-${LOGNAME}}
585 Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
587 mv -f include/newversion.h.in include/version.h.in
588 sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h