This commit was manufactured by cvs2svn to create tag
[heimdal.git] / configure.in
blobe9b93c1629ebda4e3c71a69c0b26f3de8db2eab0
1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION($Revision$)
3 AC_PREREQ([2.59])
4 test -z "$CFLAGS" && CFLAGS="-g"
5 AC_INIT([Heimdal],[0.7.2],[heimdal-bugs@pdc.kth.se])
6 AC_CONFIG_SRCDIR([kuser/kinit.c])
7 AC_CONFIG_HEADERS(include/config.h)
9 dnl Checks for programs.
10 AC_PROG_CC
11 AC_PROG_CPP
13 AM_INIT_AUTOMAKE([foreign no-dependencies 1.8])
14 AM_MAINTAINER_MODE
16 AC_PREFIX_DEFAULT(/usr/heimdal)
18 test "$sysconfdir" = '${prefix}/etc' && sysconfdir='/etc'
19 test "$localstatedir" = '${prefix}/var' && localstatedir='/var/heimdal'
21 AC_CANONICAL_HOST
22 CANONICAL_HOST=$host
23 AC_SUBST(CANONICAL_HOST)
25 rk_SYS_LARGEFILE
27 dnl
28 dnl this is needed to run the configure tests against glibc
29 dnl
30 AC_DEFINE([_GNU_SOURCE], 1,
31         [Define to enable extensions on glibc-based systems such as Linux.])
33 if test -f $srcdir/lib/asn1/pkcs12.asn1 ; then
34         AC_DEFINE([PKINIT], 1, [Define to enable PKINIT.])
37 AC_OBJEXT
38 AC_EXEEXT
40 dnl AC_KRB_PROG_YACC
41 AC_PROG_YACC
42 AM_PROG_LEX
43 dnl AC_PROG_RANLIB
44 AC_PROG_AWK
45 AC_KRB_PROG_LN_S
47 AC_MIPS_ABI
48 CC="$CC $abi"
49 libdir="$libdir$abilibdirext"
51 AC_C___ATTRIBUTE__
53 AC_ENABLE_SHARED(no)
54 AC_PROG_LIBTOOL
56 rk_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
58 rk_TEST_PACKAGE(openldap,
59 [#include <lber.h>
60 #include <ldap.h>],
61 [-lldap -llber],,,OPENLDAP)
63 AC_ARG_ENABLE(hdb-openldap-module, 
64         AS_HELP_STRING([--enable-hdb-openldap-module],
65                 [if you want support to build openldap hdb as shared object]))
66 if test "$enable_hdb_openldap_module" = yes -a "$with_openldap" = yes; then
67     AC_DEFINE(OPENLDAP_MODULE, 1, [Define if you want support for hdb ldap module])
69 AM_CONDITIONAL(OPENLDAP_MODULE, test "$enable_hdb_openldap_module" = yes -a "$with_openldap" = yes)
71 rk_TEST_PACKAGE(krb4,[#include <krb.h>],-lkrb,-ldes,/usr/athena, KRB4, krb4-config)
73 LIB_kdb=
74 if test "$with_krb4" != "no"; then
75         save_CFLAGS="$CFLAGS"
76         CFLAGS="$CFLAGS $INCLUDE_krb4"
77         save_LIBS="$LIBS"
78         LIBS="$LIB_krb4 $LIBS"
79         EXTRA_LIB45=lib45.a
80         AC_SUBST(EXTRA_LIB45)
81         AC_CACHE_CHECK(for four valued krb_put_int, ac_cv_func_krb_put_int_four,
82                 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>]], [[
83                 char tmp[4];
84                 krb_put_int(17, tmp, 4, sizeof(tmp));]])],
85                 [ac_cv_func_krb_put_int_four=yes],
86                 [ac_cv_func_krb_put_int_four=no])
87         ])
88         if test "$ac_cv_func_krb_put_int_four" = yes; then
89                 AC_DEFINE(HAVE_FOUR_VALUED_KRB_PUT_INT, 1,
90                         [define if krb_put_int takes four arguments.])
91         fi
92         AH_BOTTOM([#if defined(HAVE_FOUR_VALUED_KRB_PUT_INT) || !defined(KRB4)
93 #define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (L), (S))
94 #else
95 #define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (S))
96 #endif
98         AC_CACHE_CHECK(for KRB_VERIFY_SECURE, ac_cv_func_krb_verify_secure,
99                 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>]], [[
100                 int x = KRB_VERIFY_SECURE]])],
101                 [ac_cv_func_krb_verify_secure=yes],
102                 [ac_cv_func_krb_verify_secure=no])
103         ])
104         if test "$ac_cv_func_krb_verify_secure" != yes; then
105                 AC_DEFINE(KRB_VERIFY_SECURE, 1,
106                         [Define to one if your krb.h doesn't])
107                 AC_DEFINE(KRB_VERIFY_SECURE_FAIL, 2,
108                         [Define to two if your krb.h doesn't])
109         fi
110         AC_CACHE_CHECK(for KRB_VERIFY_NOT_SECURE,
111                 ac_cv_func_krb_verify_not_secure,
112                 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>]], [[
113                 int x = KRB_VERIFY_NOT_SECURE]])],
114                 [ac_cv_func_krb_verify_not_secure=yes],
115                 [ac_cv_func_krb_verify_not_secure=no])
116         ])
117         if test "$ac_cv_func_krb_verify_not_secure" != yes; then
118                 AC_DEFINE(KRB_VERIFY_NOT_SECURE, 0,
119                         [Define to zero if your krb.h doesn't])
120         fi
121         AC_FIND_FUNC(krb_enable_debug)
122         AC_FIND_FUNC(krb_disable_debug)
123         AC_FIND_FUNC(krb_get_our_ip_for_realm)
124         AC_FIND_FUNC(krb_kdctimeofday)
125         AH_BOTTOM(
126         [#ifndef HAVE_KRB_KDCTIMEOFDAY
127 #define krb_kdctimeofday(X) gettimeofday((X), NULL)
128 #endif])
129         AC_FIND_FUNC(krb_get_kdc_time_diff)
130         AH_BOTTOM(
131         [#ifndef HAVE_KRB_GET_KDC_TIME_DIFF
132 #define krb_get_kdc_time_diff() (0)
133 #endif])
134         AC_CACHE_CHECK([for KRB_SENDAUTH_VERS],
135                 ac_cv_func_krb_sendauth_vers,
136                 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>
137                         #include <prot.h>]], [[
138                 char *x = KRB_SENDAUTH_VERS]])],
139                 [ac_cv_func_krb_sendauth_vers=yes],
140                 [ac_cv_func_krb_sendauth_vers=no])
141         ])
142         if test "$ac_cv_func_krb_sendauth_vers" != yes; then
143                 AC_DEFINE(KRB_SENDAUTH_VERS, ["AUTHV0.1"],
144                         [This is the krb4 sendauth version.])
145         fi
146         AC_CACHE_CHECK(for krb_mk_req with const arguments,
147                 ac_cv_func_krb_mk_req_const,
148                 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>
149                 int krb_mk_req(KTEXT a, const char *s, const char *i,
150                                const char *r, int32_t checksum)
151                 { return 17; }]], [[]])],
152                 [ac_cv_func_krb_mk_req_const=yes],
153                 [ac_cv_func_krb_mk_req_const=no])
154         ])
155         if test "$ac_cv_func_krb_mk_req_const" = "yes"; then
156                 AC_DEFINE(KRB_MK_REQ_CONST, 1,
157                         [Define if krb_mk_req takes const char *])
158         fi
160         LIBS="$save_LIBS"
161         CFLAGS="$save_CFLAGS"
162         LIB_kdb="-lkdb -lkrb"
164 AM_CONDITIONAL(KRB4, test "$with_krb4" != "no")
165 AM_CONDITIONAL(KRB5, true)
166 AM_CONDITIONAL(do_roken_rename, true)
168 AC_DEFINE(KRB5, 1, [Enable Kerberos 5 support in applications.])dnl
169 AC_SUBST(LIB_kdb)dnl
171 KRB_CRYPTO
173 KRB_PTHREADS
175 AC_ARG_ENABLE(dce, 
176         AS_HELP_STRING([--enable-dce],[if you want support for DCE/DFS PAG's]))
177 if test "$enable_dce" = yes; then
178     AC_DEFINE(DCE, 1, [Define if you want support for DCE/DFS PAG's.])
180 AM_CONDITIONAL(DCE, test "$enable_dce" = yes)
182 ## XXX quite horrible:
183 if test -f /etc/ibmcxx.cfg; then
184         dpagaix_ldadd=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/libraries/{;s/^[[^=]]*=\(.*\)/\1/;s/,/ /gp;}'`
185         dpagaix_cflags=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/options/{;s/^[[^=]]*=\(.*\)/\1/;s/-q[^,]*//;s/,/ /gp;}'`
186         dpagaix_ldflags=
187 else
188         dpagaix_cflags="-D_THREAD_SAFE -D_AIX_PTHREADS_D7 -D_AIX32_THREADS=1 -D_AES_SOURCE -D_AIX41 -I/usr/include/dce"
189         dpagaix_ldadd="-L/usr/lib/threads -ldcelibc_r -ldcepthreads -lpthreads_compat lpthreads -lc_r"
190         dpagaix_ldflags="-Wl,-bI:dfspag.exp"
192 AC_SUBST(dpagaix_cflags)
193 AC_SUBST(dpagaix_ldadd)
194 AC_SUBST(dpagaix_ldflags)
196 rk_DB
198 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])
200 rk_ROKEN(lib/roken)
201 LIB_roken="\$(top_builddir)/lib/vers/libvers.la $LIB_roken"
203 rk_OTP
205 AC_CHECK_OSFC2
207 AC_ARG_ENABLE(mmap,
208         AS_HELP_STRING([--disable-mmap],[disable use of mmap]))
209 if test "$enable_mmap" = "no"; then
210         AC_DEFINE(NO_MMAP, 1, [Define if you don't want to use mmap.])
213 rk_CHECK_MAN
215 rk_TEST_PACKAGE(readline,
216 [#include <stdio.h>
217  #include <readline.h>],-lreadline,,, READLINE)
219 rk_TEST_PACKAGE(hesiod,[#include <hesiod.h>],-lhesiod,,, HESIOD)
221 KRB_C_BIGENDIAN
222 AC_C_INLINE
224 rk_AIX
225 rk_IRIX
226 rk_SUNOS
228 KRB_CHECK_X
230 AM_CONDITIONAL(HAVE_X, test "$no_x" != yes)
232 AC_CHECK_XAU
234 dnl AM_C_PROTOTYPES
236 dnl Checks for typedefs, structures, and compiler characteristics.
237 AC_C_CONST
238 AC_TYPE_OFF_T
239 AC_CHECK_TYPE_EXTRA(mode_t, unsigned short, [])
240 AC_CHECK_TYPE_EXTRA(sig_atomic_t, int, [#include <signal.h>])
241 AC_HAVE_TYPE([long long])
242 AC_HEADER_TIME
243 AC_STRUCT_TM
245 dnl Checks for header files.
246 AC_HEADER_STDC
248 AC_CHECK_HEADERS([\
249         arpa/ftp.h                              \
250         arpa/telnet.h                           \
251         bind/bitypes.h                          \
252         bsdsetjmp.h                             \
253         curses.h                                \
254         dlfcn.h                                 \
255         fnmatch.h                               \
256         inttypes.h                              \
257         io.h                                    \
258         libutil.h                               \
259         limits.h                                \
260         maillock.h                              \
261         netgroup.h                              \
262         netinet/in6_machtypes.h                 \
263         netinfo/ni.h                            \
264         pthread.h                               \
265         pty.h                                   \
266         sac.h                                   \
267         sgtty.h                                 \
268         siad.h                                  \
269         signal.h                                \
270         stropts.h                               \
271         sys/bitypes.h                           \
272         sys/category.h                          \
273         sys/file.h                              \
274         sys/filio.h                             \
275         sys/ioccom.h                            \
276         sys/mman.h                              \
277         sys/pty.h                               \
278         sys/ptyio.h                             \
279         sys/select.h                            \
280         sys/socket.h                            \
281         sys/str_tty.h                           \
282         sys/stream.h                            \
283         sys/stropts.h                           \
284         sys/syscall.h                           \
285         sys/termio.h                            \
286         sys/timeb.h                             \
287         sys/times.h                             \
288         sys/un.h                                \
289         sys/ucred.h                             \
290         termcap.h                               \
291         termio.h                                \
292         termios.h                               \
293         time.h                                  \
294         tmpdir.h                                \
295         udb.h                                   \
296         utmp.h                                  \
297         utmpx.h                                 \
300 dnl On Solaris 8 there's a compilation warning for term.h because
301 dnl it doesn't define `bool'.
302 AC_CHECK_HEADERS(term.h, , , -)
304 AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT
305 #if HAVE_SYS_SOCKET_H
306 #include <sys/socket.h>
307 #endif])
309 AC_CHECK_HEADERS(sys/ptyvar.h, , , [AC_INCLUDES_DEFAULT
310 #if HAVE_SYS_TTY_H
311 #include <sys/tty.h>
312 #endif])
314 AC_CHECK_HEADERS(sys/strtty.h, , , [AC_INCLUDES_DEFAULT
315 #if HAVE_TERMIOS_H
316 #include <termios.h>
317 #endif
318 #if HAVE_SYS_STREAM_H
319 #include <sys/stream.h>
320 #endif])
322 AC_CHECK_HEADERS(security/pam_modules.h, , , [AC_INCLUDES_DEFAULT
323 #include <security/pam_appl.h>
326 AC_ARG_ENABLE(netinfo,
327         AS_HELP_STRING([--enable-netinfo],[enable netinfo for configuration lookup]))
329 if test "$ac_cv_header_netinfo_ni_h" = yes -a "$enable_netinfo" = yes; then
330        AC_DEFINE(HAVE_NETINFO, 1,
331                [Define if you want to use Netinfo instead of krb5.conf.])
334 AC_ARG_ENABLE(kcm,
335         AC_HELP_STRING([--enable-kcm],[enable Kerberos Credentials Manager]))
337 if test "$ac_cv_header_sys_un_h" = yes -a "$enable_kcm" = yes; then
338        AC_DEFINE(HAVE_KCM, 1,
339                [Define if you want to use the Kerberos Credentials Manager.])
341 AM_CONDITIONAL(KCM, test "$enable_kcm" = yes)
343 dnl export symbols
344 rk_WIN32_EXPORT(BUILD_KRB5_LIB, KRB5_LIB_FUNCTION)
345 rk_WIN32_EXPORT(BUILD_ROKEN_LIB, ROKEN_LIB_FUNCTION)
347 dnl Checks for libraries.
349 AC_FIND_FUNC_NO_LIBS(logwtmp, util)
350 AC_FIND_FUNC_NO_LIBS(logout, util)
351 AC_FIND_FUNC_NO_LIBS(openpty, util)
352 AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses)
354 dnl Checks for library functions.
356 AC_CHECK_FUNCS([                                \
357         _getpty                                 \
358         _scrsize                                \
359         fcntl                                   \
360         getpeereid                              \
361         getpeerucred                            \
362         grantpt                                 \
363         mktime                                  \
364         ptsname                                 \
365         rand                                    \
366         revoke                                  \
367         select                                  \
368         setitimer                               \
369         setpcred                                \
370         setpgid                                 \
371         setproctitle                            \
372         setregid                                \
373         setresgid                               \
374         setresuid                               \
375         setreuid                                \
376         setsid                                  \
377         setutent                                \
378         sigaction                               \
379         strstr                                  \
380         timegm                                  \
381         ttyname                                 \
382         ttyslot                                 \
383         umask                                   \
384         unlockpt                                \
385         vhangup                                 \
386         yp_get_default_domain                   \
389 AC_FUNC_MMAP
391 KRB_CAPABILITIES
393 AC_CHECK_GETPWNAM_R_POSIX
395 dnl detect doors on solaris
396 if test "$enable_pthread_support" != no; then
397    saved_LIBS="$LIBS"
398    LIBS="$LIBS $PTHREADS_LIBS"
399    AC_FIND_FUNC_NO_LIBS(door_create, door)
400    LIBS="$saved_LIBS"
403 dnl Cray stuff
404 AC_CHECK_FUNCS(getudbnam setlim)
406 dnl AC_KRB_FUNC_GETCWD_BROKEN
409 dnl Check for fields in struct utmp
412 AC_HAVE_STRUCT_FIELD(struct utmp, ut_addr, [#include <utmp.h>])
413 AC_HAVE_STRUCT_FIELD(struct utmp, ut_host, [#include <utmp.h>])
414 AC_HAVE_STRUCT_FIELD(struct utmp, ut_id, [#include <utmp.h>])
415 AC_HAVE_STRUCT_FIELD(struct utmp, ut_pid, [#include <utmp.h>])
416 AC_HAVE_STRUCT_FIELD(struct utmp, ut_type, [#include <utmp.h>])
417 AC_HAVE_STRUCT_FIELD(struct utmp, ut_user, [#include <utmp.h>])
418 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_exit, [#include <utmpx.h>])
419 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_syslen, [#include <utmpx.h>])
421 AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, 
422         u_int8_t, u_int16_t, u_int32_t, u_int64_t,
423         uint8_t, uint16_t, uint32_t, uint64_t],,,[
424 #ifdef HAVE_INTTYPES_H
425 #include <inttypes.h>
426 #endif
427 #ifdef HAVE_SYS_TYPES_H
428 #include <sys/types.h>
429 #endif
430 #ifdef HAVE_SYS_BITYPES_H
431 #include <sys/bitypes.h>
432 #endif
433 #ifdef HAVE_BIND_BITYPES_H
434 #include <bind/bitypes.h>
435 #endif
436 #ifdef HAVE_NETINET_IN6_MACHTYPES_H
437 #include <netinet/in6_machtypes.h>
438 #endif
441 KRB_READLINE
443 rk_TELNET
445 dnl Some operating systems already have com_err and compile_et
446 CHECK_COMPILE_ET
448 rk_AUTH_MODULES([sia afskauthlib])
450 rk_DESTDIRS
452 AH_BOTTOM([#ifdef ROKEN_RENAME
453 #include "roken_rename.h"
454 #endif])
456 AC_CONFIG_FILES(Makefile                \
457         include/Makefile                \
458         include/kadm5/Makefile          \
459         lib/Makefile                    \
460         lib/45/Makefile                 \
461         lib/auth/Makefile               \
462         lib/auth/afskauthlib/Makefile   \
463         lib/auth/pam/Makefile           \
464         lib/auth/sia/Makefile           \
465         lib/asn1/Makefile               \
466         lib/com_err/Makefile            \
467         lib/des/Makefile                \
468         lib/editline/Makefile           \
469         lib/gssapi/Makefile             \
470         lib/hdb/Makefile                \
471         lib/kadm5/Makefile              \
472         lib/kafs/Makefile               \
473         lib/kdfs/Makefile               \
474         lib/krb5/Makefile               \
475         lib/otp/Makefile                \
476         lib/roken/Makefile              \
477         lib/sl/Makefile                 \
478         lib/vers/Makefile               \
479         kuser/Makefile                  \
480         kpasswd/Makefile                \
481         kadmin/Makefile                 \
482         admin/Makefile                  \
483         kcm/Makefile                    \
484         kdc/Makefile                    \
485         appl/Makefile                   \
486         appl/afsutil/Makefile           \
487         appl/ftp/Makefile               \
488         appl/ftp/common/Makefile        \
489         appl/ftp/ftp/Makefile           \
490         appl/ftp/ftpd/Makefile          \
491         appl/kx/Makefile                \
492         appl/login/Makefile             \
493         appl/otp/Makefile               \
494         appl/popper/Makefile            \
495         appl/push/Makefile              \
496         appl/rsh/Makefile               \
497         appl/rcp/Makefile               \
498         appl/su/Makefile                \
499         appl/xnlock/Makefile            \
500         appl/telnet/Makefile            \
501         appl/telnet/libtelnet/Makefile  \
502         appl/telnet/telnet/Makefile     \
503         appl/telnet/telnetd/Makefile    \
504         appl/test/Makefile              \
505         appl/kf/Makefile                \
506         appl/dceutils/Makefile          \
507         doc/Makefile                    \
508         tools/Makefile                  \
511 AC_OUTPUT
514 dnl This is the release version name-number[beta]
517 cat > include/newversion.h.in <<EOF
518 const char *heimdal_long_version = "@([#])\$Version: $PACKAGE_STRING by @USER@ on @HOST@ ($host) @DATE@ \$";
519 const char *heimdal_version = "AC_PACKAGE_STRING";
522 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
523         echo "include/version.h is unchanged"
524         rm -f include/newversion.h.in
525 else
526         echo "creating include/version.h"
527         User=${USER-${LOGNAME}}
528         Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
529         Date=`date`
530         mv -f include/newversion.h.in include/version.h.in
531         sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h