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],[7.99.1],[https://github.com/heimdal/heimdal/issues])
6 AC_CONFIG_SRCDIR([kuser/kinit.c])
7 AC_CONFIG_HEADERS(include/config.h)
8 AC_CONFIG_MACRO_DIR([cf])
10 srcdir=`cd "$srcdir" && pwd || echo "$srcdir"`
12 AM_INIT_AUTOMAKE([foreign 1.11])
16 LT_INIT([shared static win32-dll])
19 dnl Checks for programs.
24 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
26 AC_PREFIX_DEFAULT(/usr/heimdal)
28 test "$sysconfdir" = '${prefix}/etc' && sysconfdir='/etc'
29 test "$localstatedir" = '${prefix}/var' && localstatedir='/var/heimdal'
33 AC_SUBST(CANONICAL_HOST)
42 dnl this is needed to run the configure tests against glibc
44 AC_DEFINE([_GNU_SOURCE], 1,
45 [Define to enable extensions on glibc-based systems such as Linux.])
51 dnl this is needed when der-protos.h or der-private.h has to be generated
53 if ! test -f "$srcdir/lib/asn1/der-protos.h" ||
54 ! test -f "$srcdir/lib/asn1/der-private.h"; then
56 AC_KRB_PERL_MOD(Getopt::Std)
57 AC_KRB_PERL_MOD(File::Compare)
70 libdir="$libdir$abilibdirext"
74 AM_CONDITIONAL(ENABLE_SHARED, test "$enable_shared" = "yes")
78 dnl Helper bits for cross compiling
83 AM_CONDITIONAL(CROSS_COMPILE, test "${cross_compiling}" = yes)
85 AC_ARG_WITH(cross-tools,
86 AS_HELP_STRING([--with-cross-tools=dir], [use cross tools in dir]),
87 [if test "$withval" = "yes"; then
88 AC_MSG_ERROR([Need path to cross tools])
90 with_cross_tools="${with_cross_tools}/"
93 if test "${cross_compiling}" != yes ; then
95 ASN1_COMPILE="\$(top_builddir)/lib/asn1/asn1_compile\$(EXEEXT)"
96 SLC="\$(top_builddir)/lib/sl/slc"
98 ASN1_COMPILE_DEP="\$(ASN1_COMPILE)"
101 ASN1_COMPILE="${with_cross_tools}asn1_compile"
102 SLC="${with_cross_tools}slc"
107 ac_cv_prog_COMPILE_ET=${with_cross_tools}compile_et
111 AC_SUBST([ASN1_COMPILE])
112 AC_SUBST([ASN1_COMPILE_DEP])
118 AC_DEFINE(HEIM_WEAK_CRYPTO, 1, [Define if you want support for weak crypto])
120 rk_TEST_PACKAGE(openldap,
123 [-lldap -llber],,,OPENLDAP)
125 AC_ARG_ENABLE(hdb-openldap-module,
126 AS_HELP_STRING([--enable-hdb-openldap-module],
127 [if you want support to build openldap hdb as shared object]))
128 if test "$enable_hdb_openldap_module" = yes -a "$with_openldap" = yes; then
129 AC_DEFINE(OPENLDAP_MODULE, 1, [Define if you want support for hdb ldap module])
131 AM_CONDITIONAL(OPENLDAP_MODULE, test "$enable_hdb_openldap_module" = yes -a "$with_openldap" = yes)
134 dnl Optional modules, pk-init, digest, kx509
137 AC_ARG_ENABLE(pk-init,
138 AS_HELP_STRING([--disable-pk-init],
139 [if you want disable to PK-INIT support]))
140 if test "$enable_pk_init" != no ;then
141 AC_DEFINE([PKINIT], 1, [Define to enable PKINIT.])
143 AM_CONDITIONAL(PKINIT, test "$enable_pk_init" != no)
145 AC_ARG_ENABLE(digest,
146 AS_HELP_STRING([--disable-digest],
147 [if you want disable to DIGEST support]))
148 if test "$enable_digest" != no ;then
149 AC_DEFINE([DIGEST], 1, [Define to enable DIGEST.])
153 AS_HELP_STRING([--disable-kx509],
154 [if you want disable to kx509 support]))
155 if test "$enable_kx509" != no ;then
156 AC_DEFINE([KX509], 1, [Define to enable kx509.])
159 dnl Need to test if pkg-config exists
164 AC_HELP_STRING([--with-capng], [use libcap-ng to drop KDC privileges @<:@default=check@:>@]),
167 if test "$with_capng" != "no"; then
168 PKG_CHECK_MODULES([CAPNG], [libcap-ng >= 0.4.0],
169 [with_capng=yes],[with_capng=no])
171 if test "$with_capng" = "yes"; then
172 AC_DEFINE_UNQUOTED([HAVE_CAPNG], 1, [whether capng is available for privilege reduction])
174 AM_CONDITIONAL([HAVE_CAPNG], [test "$with_capng" != "no"])
175 AC_SUBST([CAPNG_CFLAGS])
176 AC_SUBST([CAPNG_LIBS])
179 rk_TEST_PACKAGE(sqlite3,
180 [#include <sqlite3.h>
181 #ifndef SQLITE_OPEN_CREATE
184 [-lsqlite3],,,SQLITE3)
186 if test "X$with_sqlite3" != Xyes ; then
187 INCLUDE_sqlite3="-I\$(top_srcdir)/lib/sqlite"
188 LIB_sqlite3="\$(top_builddir)/lib/sqlite/libheimsqlite.la"
190 AM_CONDITIONAL(SQLITE3, test "X$with_sqlite3" = Xyes)
192 AC_DEFINE(HAVE_SQLITE3, 1, [Define if you want support for sqlite in Heimdal.])
194 AC_ARG_ENABLE(sqlite-cache,
195 AS_HELP_STRING([--disable-sqlite-cache],[if you want support for cache in sqlite]))
196 if test "$enable_sqlite_cache" != no; then
197 AC_DEFINE(HAVE_SCC, 1, [Define if you want support for cache in sqlite.])
199 AM_CONDITIONAL(have_scc, test "$enable_sqlite_cache" != no)
202 dnl check for libintl
203 rk_TEST_PACKAGE(libintl,
204 [#include <libintl.h>],
207 dnl path where the hdb directory is stored
208 AC_ARG_WITH([hdbdir],
209 [AS_HELP_STRING([--with-hdbdir],[Default location for KDC database @<:@default=/var/heimdal@:>@])],
211 [with_hdbdir=/var/heimdal])
212 DIR_hdbdir="$with_hdbdir"
213 AC_SUBST([DIR_hdbdir])
216 AM_CONDITIONAL(KRB5, true)
217 AM_CONDITIONAL(do_roken_rename, true)
219 AC_DEFINE(SUPPORT_INETD, 1, [Enable use of inetd style startup.])dnl
222 AC_DEFINE(KRB5, 1, [Enable Kerberos 5 support in applications.])dnl
230 AS_HELP_STRING([--enable-dce],[if you want support for DCE/DFS PAG's]))
231 if test "$enable_dce" = yes; then
232 AC_DEFINE(DCE, 1, [Define if you want support for DCE/DFS PAG's.])
234 AM_CONDITIONAL(DCE, test "$enable_dce" = yes)
236 ## XXX quite horrible:
237 if test -f /etc/ibmcxx.cfg; then
238 dpagaix_ldadd=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/libraries/{;s/^[[^=]]*=\(.*\)/\1/;s/,/ /gp;}'`
239 dpagaix_cflags=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/options/{;s/^[[^=]]*=\(.*\)/\1/;s/-q[^,]*//;s/,/ /gp;}'`
242 dpagaix_cflags="-D_THREAD_SAFE -D_AIX_PTHREADS_D7 -D_AIX32_THREADS=1 -D_AES_SOURCE -D_AIX41 -I/usr/include/dce"
243 dpagaix_ldadd="-L/usr/lib/threads -ldcelibc_r -ldcepthreads -lpthreads_compat lpthreads -lc_r"
244 dpagaix_ldflags="-Wl,-bI:dfspag.exp"
246 AC_SUBST(dpagaix_cflags)
247 AC_SUBST(dpagaix_ldadd)
248 AC_SUBST(dpagaix_ldflags)
250 AC_ARG_ENABLE([afs-support],
251 AS_HELP_STRING([--disable-afs-support],[if you don't want support for AFS]))
252 if test "$enable_afs_support" = no; then
253 AC_DEFINE(NO_AFS, 1, [Define if you don't wan't support for AFS.])
257 AM_CONDITIONAL(NO_AFS, test "$enable_afs_support" = no)
261 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])
264 LIBADD_roken="$LIB_roken"
265 AC_SUBST(LIBADD_roken)dnl
266 LIB_roken="\$(top_builddir)/lib/vers/libvers.la $LIB_roken"
275 AS_HELP_STRING([--disable-mmap],[disable use of mmap]))
276 if test "$enable_mmap" = "no"; then
277 AC_DEFINE(NO_MMAP, 1, [Define if you don't want to use mmap.])
280 AC_ARG_ENABLE(afs-string-to-key,
281 AS_HELP_STRING([--disable-afs-string-to-key],
282 [disable use of weak AFS string-to-key functions]),
283 [], [enable_afs_string_to_key=yes])
285 if test "$enable_afs_string_to_key" = "yes"; then
286 AC_DEFINE(ENABLE_AFS_STRING_TO_KEY, 1, [Define if want to use the weak AFS string to key functions.])
287 ENABLE_AFS_STRING_TO_KEY=1
289 AC_SUBST(ENABLE_AFS_STRING_TO_KEY)dnl
294 rk_TEST_PACKAGE(readline,
296 #if defined(HAVE_READLINE_READLINE_H)
297 #include <readline/readline.h>
298 #elif defined(HAVE_READLINE_H)
299 #include <readline.h>
301 ],-lreadline,,, READLINE,, [readline.h readline/readline.h])
303 rk_TEST_PACKAGE(libedit,
305 #if defined(HAVE_READLINE_READLINE_H)
306 #include <readline/readline.h>
307 #elif defined(HAVE_READLINE_H)
308 #include <readline.h>
309 #elif defined(HAVE_EDITLINE_READLINE_H)
310 #include <editline/readline.h>
312 ],-ledit,,, READLINE,, [readline.h readline/readline.h editline/readline.h])
314 AC_CONFIG_SUBDIRS([lib/libedit])
321 dnl Checks for typedefs, structures, and compiler characteristics.
324 AC_CHECK_TYPE_EXTRA(mode_t, unsigned short, [])
325 AC_CHECK_TYPE_EXTRA(sig_atomic_t, int, [#include <signal.h>])
326 AC_HAVE_TYPE([long long])
330 dnl Checks for header files.
334 CommonCrypto/CommonDigest.h \
335 CommonCrypto/CommonCryptor.h \
349 netinet/in6_machtypes.h \
388 dnl On Solaris 8 there's a compilation warning for term.h because
389 dnl it doesn't define `bool'.
390 AC_CHECK_HEADERS(term.h, , , -)
392 dnl aix have asl.h (A/IX screen library) that we don't want
393 AC_CHECK_HEADERS(asl.h, , , [
395 #ifndef ASL_STRING_EMERG
396 #error ASL_STRING_EMERG missing
399 AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT
400 #if HAVE_SYS_SOCKET_H
401 #include <sys/socket.h>
404 AC_CHECK_HEADERS(sys/ptyvar.h, , , [AC_INCLUDES_DEFAULT
409 AC_CHECK_HEADERS(sys/strtty.h, , , [AC_INCLUDES_DEFAULT
413 #if HAVE_SYS_STREAM_H
414 #include <sys/stream.h>
417 AC_CHECK_HEADERS(sys/ucred.h, , , [AC_INCLUDES_DEFAULT
419 #include <sys/types.h>
422 #include <sys/param.h>
425 AC_CHECK_HEADERS(security/pam_modules.h, , , [AC_INCLUDES_DEFAULT
426 #include <security/pam_appl.h>
430 rk_WIN32_EXPORT(BUILD_KRB5_LIB, KRB5_LIB)
431 rk_WIN32_EXPORT(BUILD_ROKEN_LIB, ROKEN_LIB)
432 rk_WIN32_EXPORT(BUILD_GSSAPI_LIB, GSSAPI_LIB)
434 dnl Checks for libraries.
436 AC_FIND_FUNC_NO_LIBS(logwtmp, util,[
441 AC_FIND_FUNC_NO_LIBS(logout, util,[
446 AC_FIND_FUNC_NO_LIBS(openpty, util,[
452 AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses,[
453 #ifdef HAVE_TERMCAP_H
461 dnl Checks for library functions.
497 yp_get_default_domain \
500 AC_MSG_CHECKING([checking for __sync_add_and_fetch])
501 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]],
502 [[unsigned int foo, bar; bar = __sync_add_and_fetch(&foo, 1);]])],
503 [ac_rk_have___sync_add_and_fetch=yes], [ac_rk_have___sync_add_and_fetch=no])
504 if test "$ac_rk_have___sync_add_and_fetch" = "yes" ; then
505 AC_DEFINE_UNQUOTED(HAVE___SYNC_ADD_AND_FETCH, 1, [have __sync_add_and_fetch])
507 AC_MSG_RESULT($ac_rk_have___sync_add_and_fetch)
514 AC_CHECK_GETPWNAM_R_POSIX
516 dnl detect doors on solaris
517 if test "$enable_pthread_support" != no; then
519 LIBS="$LIBS $PTHREADS_LIBS"
520 AC_FIND_FUNC_NO_LIBS(door_create, door)
525 AS_HELP_STRING([--enable-kcm],[enable Kerberos Credentials Manager]),
528 if test "$enable_kcm" = yes ; then
529 if test "$ac_cv_header_sys_un_h" != yes -a "$ac_cv_funclib_door_create" != yes ; then
533 if test "$enable_kcm" = yes; then
534 AC_DEFINE(HAVE_KCM, 1,
535 [Define if you want to use the Kerberos Credentials Manager.])
537 AM_CONDITIONAL(KCM, test "$enable_kcm" = yes)
542 AC_CHECK_FUNCS(getudbnam setlim)
544 dnl AC_KRB_FUNC_GETCWD_BROKEN
546 AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t,
547 u_int8_t, u_int16_t, u_int32_t, u_int64_t,
548 uint8_t, uint16_t, uint32_t, uint64_t],,,[
549 #ifdef HAVE_INTTYPES_H
550 #include <inttypes.h>
552 #ifdef HAVE_SYS_TYPES_H
553 #include <sys/types.h>
555 #ifdef HAVE_SYS_BITYPES_H
556 #include <sys/bitypes.h>
558 #ifdef HAVE_BIND_BITYPES_H
559 #include <bind/bitypes.h>
561 #ifdef HAVE_NETINET_IN6_MACHTYPES_H
562 #include <netinet/in6_machtypes.h>
566 rk_FRAMEWORK_SECURITY
572 dnl Some operating systems already have com_err and compile_et
575 rk_AUTH_MODULES([sia afskauthlib])
579 rk_WFLAGS([-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs])
582 AH_BOTTOM([#ifdef __APPLE__
583 #include <AvailabilityMacros.h>
586 AH_BOTTOM([#ifdef ROKEN_RENAME
587 #include "roken_rename.h"
590 AC_ARG_ENABLE(heimdal-documentation,
591 AS_HELP_STRING([--disable-heimdal-documentation],
592 [if you want disable to heimdal documentation]))
593 AM_CONDITIONAL(HEIMDAL_DOCUMENTATION, test "$enable_heimdal_documentation" != no)
595 AC_CONFIG_FILES(Makefile \
598 include/gssapi/Makefile \
599 include/hcrypto/Makefile \
600 include/kadm5/Makefile \
604 lib/com_err/Makefile \
605 lib/hcrypto/Makefile \
607 lib/gssapi/Makefile \
618 lib/sqlite/Makefile \
629 appl/afsutil/Makefile \
630 appl/dbutils/Makefile \
631 appl/gssmask/Makefile \
636 appl/dceutils/Makefile \
642 tests/ldap/Makefile \
644 tests/java/Makefile \
645 tests/plugin/Makefile \
647 packages/mac/Makefile \
655 dnl This is the release version name-number[beta]
658 cat > include/newversion.h.in <<EOF
659 #ifndef VERSION_HIDDEN
660 #define VERSION_HIDDEN
662 VERSION_HIDDEN const char *heimdal_long_version = "@([#])\$Version: $PACKAGE_STRING by @USER@ on @HOST@ ($host) @DATE@ \$";
663 VERSION_HIDDEN const char *heimdal_version = "AC_PACKAGE_STRING";
666 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
667 echo "include/version.h is unchanged"
668 rm -f include/newversion.h.in
670 echo "creating include/version.h"
671 User=${USER-${LOGNAME}}
672 Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
674 mv -f include/newversion.h.in include/version.h.in
675 sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h