]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - crypto/heimdal/configure.in
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / crypto / heimdal / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION($Revision: 1.331.2.8 $)
3 AC_PREREQ(2.53)
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)
8
9 dnl Checks for programs.
10 AC_PROG_CC
11 AC_PROG_CPP
12 AC_PROG_CC_STDC
13
14 AM_INIT_AUTOMAKE([foreign no-dependencies 1.7])
15 AM_MAINTAINER_MODE
16
17 AC_PREFIX_DEFAULT(/usr/heimdal)
18
19 test "$sysconfdir" = '${prefix}/etc' && sysconfdir='/etc'
20 test "$localstatedir" = '${prefix}/var' && localstatedir='/var/heimdal'
21
22 AC_CANONICAL_HOST
23 CANONICAL_HOST=$host
24 AC_SUBST(CANONICAL_HOST)
25
26 AC_SYS_LARGEFILE
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"
31 fi
32
33 dnl
34 dnl this is needed to run the configure tests against glibc
35 dnl
36 AC_DEFINE([_GNU_SOURCE], 1,
37         [Define to enable extensions on glibc-based systems such as Linux.])
38
39 AC_OBJEXT
40 AC_EXEEXT
41
42 dnl AC_KRB_PROG_YACC
43 AC_PROG_YACC
44 AM_PROG_LEX
45 dnl AC_PROG_RANLIB
46 AC_PROG_AWK
47 AC_KRB_PROG_LN_S
48
49 AC_MIPS_ABI
50 CC="$CC $abi"
51 libdir="$libdir$abilibdirext"
52
53 AC_C___ATTRIBUTE__
54
55 AC_ENABLE_SHARED(no)
56 AC_PROG_LIBTOOL
57
58 AC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
59
60 rk_TEST_PACKAGE(openldap,
61 [#include <lber.h>
62 #include <ldap.h>],
63 [-lldap -llber],,,OPENLDAP)
64
65 rk_TEST_PACKAGE(krb4,[#include <krb.h>],-lkrb,-ldes,/usr/athena, KRB4, krb4-config)
66
67 LIB_kdb=
68 if test "$with_krb4" != "no"; then
69         save_CFLAGS="$CFLAGS"
70         CFLAGS="$CFLAGS $INCLUDE_krb4"
71         save_LIBS="$LIBS"
72         LIBS="$LIB_krb4 $LIBS"
73         EXTRA_LIB45=lib45.a
74         AC_SUBST(EXTRA_LIB45)
75         AC_CACHE_CHECK(for four valued krb_put_int, ac_cv_func_krb_put_int_four,
76                 [AC_TRY_COMPILE([#include <krb.h>],[
77                 char tmp[4];
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)
81         ])
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.])
85         fi
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))
88 #else
89 #define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (S))
90 #endif
91 ])
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)
97         ])
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])
103         fi
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)
110         ])
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])
114         fi
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)
119         AH_BOTTOM(
120         [#ifndef HAVE_KRB_KDCTIMEOFDAY
121 #define krb_kdctimeofday(X) gettimeofday((X), NULL)
122 #endif])
123         AC_FIND_FUNC(krb_get_kdc_time_diff)
124         AH_BOTTOM(
125         [#ifndef HAVE_KRB_GET_KDC_TIME_DIFF
126 #define krb_get_kdc_time_diff() (0)
127 #endif])
128         AC_CACHE_CHECK([for KRB_SENDAUTH_VERS],
129                 ac_cv_func_krb_sendauth_vers,
130                 [AC_TRY_COMPILE([#include <krb.h>
131                         #include <prot.h>],[
132                 char *x = KRB_SENDAUTH_VERS],
133                 ac_cv_func_krb_sendauth_vers=yes,
134                 ac_cv_func_krb_sendauth_vers=no)
135         ])
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.])
139         fi
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)
145                 { return 17; }], [],
146                 ac_cv_func_krb_mk_req_const=yes,
147                 ac_cv_func_krb_mk_req_const=no)
148         ])
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 *])
152         fi
153
154         LIBS="$save_LIBS"
155         CFLAGS="$save_CFLAGS"
156         LIB_kdb="-lkdb -lkrb"
157 fi
158 AM_CONDITIONAL(KRB4, test "$with_krb4" != "no")
159 AM_CONDITIONAL(KRB5, true)
160 AM_CONDITIONAL(do_roken_rename, true)
161
162 AC_DEFINE(KRB5, 1, [Enable Kerberos 5 support in applications.])dnl
163 AC_SUBST(LIB_kdb)dnl
164
165 KRB_CRYPTO
166
167 AC_ARG_ENABLE(dce, 
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.])
171 fi
172 AM_CONDITIONAL(DCE, test "$enable_dce" = yes)
173
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;}'`
178         dpagaix_ldflags=
179 else
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"
183 fi
184 AC_SUBST(dpagaix_cflags)
185 AC_SUBST(dpagaix_ldadd)
186 AC_SUBST(dpagaix_ldflags)
187
188 rk_DB
189
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])
191
192 rk_ROKEN(lib/roken)
193 LIB_roken="\$(top_builddir)/lib/vers/libvers.la $LIB_roken"
194
195 rk_OTP
196
197 AC_CHECK_OSFC2
198
199 AC_ARG_ENABLE(mmap,
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.])
203 fi
204
205 rk_CHECK_MAN
206
207 rk_TEST_PACKAGE(readline,
208 [#include <stdio.h>
209  #include <readline.h>],-lreadline,,, READLINE)
210
211 rk_TEST_PACKAGE(hesiod,[#include <hesiod.h>],-lhesiod,,, HESIOD)
212
213 KRB_C_BIGENDIAN
214 AC_C_INLINE
215
216 rk_AIX
217 rk_IRIX
218 rk_SUNOS
219
220 KRB_CHECK_X
221
222 AM_CONDITIONAL(HAVE_X, test "$no_x" != yes)
223
224 AC_CHECK_XAU
225
226 dnl AM_C_PROTOTYPES
227
228 dnl Checks for typedefs, structures, and compiler characteristics.
229 AC_C_CONST
230 AC_TYPE_OFF_T
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])
234 AC_HEADER_TIME
235 AC_STRUCT_TM
236
237 dnl Checks for header files.
238 AC_HEADER_STDC
239
240 AC_CHECK_HEADERS([\
241         arpa/ftp.h                              \
242         arpa/telnet.h                           \
243         bind/bitypes.h                          \
244         bsdsetjmp.h                             \
245         curses.h                                \
246         dlfcn.h                                 \
247         fnmatch.h                               \
248         inttypes.h                              \
249         io.h                                    \
250         libutil.h                               \
251         limits.h                                \
252         maillock.h                              \
253         netgroup.h                              \
254         netinet/in6_machtypes.h                 \
255         netinfo/ni.h                            \
256         pthread.h                               \
257         pty.h                                   \
258         sac.h                                   \
259         security/pam_modules.h                  \
260         sgtty.h                                 \
261         siad.h                                  \
262         signal.h                                \
263         stropts.h                               \
264         sys/bitypes.h                           \
265         sys/category.h                          \
266         sys/file.h                              \
267         sys/filio.h                             \
268         sys/ioccom.h                            \
269         sys/mman.h                              \
270         sys/pty.h                               \
271         sys/ptyio.h                             \
272         sys/ptyvar.h                            \
273         sys/select.h                            \
274         sys/str_tty.h                           \
275         sys/stream.h                            \
276         sys/stropts.h                           \
277         sys/strtty.h                            \
278         sys/syscall.h                           \
279         sys/termio.h                            \
280         sys/timeb.h                             \
281         sys/times.h                             \
282         sys/un.h                                \
283         term.h                                  \
284         termcap.h                               \
285         termio.h                                \
286         time.h                                  \
287         tmpdir.h                                \
288         udb.h                                   \
289         utmp.h                                  \
290         utmpx.h                                 \
291 ])
292
293 AC_ARG_ENABLE(netinfo,
294         AC_HELP_STRING([--enable-netinfo],[enable netinfo for configuration lookup]))
295
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.])
299 fi
300
301 dnl Checks for libraries.
302
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)
307
308 dnl Checks for library functions.
309
310 AC_CHECK_FUNCS([                                \
311         _getpty                                 \
312         _scrsize                                \
313         fcntl                                   \
314         grantpt                                 \
315         mktime                                  \
316         ptsname                                 \
317         rand                                    \
318         revoke                                  \
319         select                                  \
320         setitimer                               \
321         setpcred                                \
322         setpgid                                 \
323         setproctitle                            \
324         setregid                                \
325         setresgid                               \
326         setresuid                               \
327         setreuid                                \
328         setsid                                  \
329         setutent                                \
330         sigaction                               \
331         strstr                                  \
332         timegm                                  \
333         ttyname                                 \
334         ttyslot                                 \
335         umask                                   \
336         unlockpt                                \
337         vhangup                                 \
338         yp_get_default_domain                   \
339 ])
340
341 AC_FUNC_MMAP
342
343 KRB_CAPABILITIES
344
345 AC_CHECK_GETPWNAM_R_POSIX
346
347 dnl Cray stuff
348 AC_CHECK_FUNCS(getudbnam setlim)
349
350 dnl AC_KRB_FUNC_GETCWD_BROKEN
351
352 dnl
353 dnl Check for fields in struct utmp
354 dnl
355
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>])
364
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>
370 #endif
371 #ifdef HAVE_SYS_TYPES_H
372 #include <sys/types.h>
373 #endif
374 #ifdef HAVE_SYS_BITYPES_H
375 #include <sys/bitypes.h>
376 #endif
377 #ifdef HAVE_BIND_BITYPES_H
378 #include <bind/bitypes.h>
379 #endif
380 #ifdef HAVE_NETINET_IN6_MACHTYPES_H
381 #include <netinet/in6_machtypes.h>
382 #endif
383 ])
384
385 KRB_READLINE
386
387 rk_TELNET
388
389 dnl Some operating systems already have com_err and compile_et
390 CHECK_COMPILE_ET
391
392 rk_AUTH_MODULES([sia afskauthlib])
393
394 rk_DESTDIRS
395
396 LTLIBOBJS=`echo "$LIB@&t@OBJS" |
397         sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
398 AC_SUBST(LTLIBOBJS)
399
400 AH_BOTTOM([#ifdef ROKEN_RENAME
401 #include "roken_rename.h"
402 #endif])
403
404 AC_CONFIG_FILES(Makefile                \
405         include/Makefile                \
406         include/kadm5/Makefile          \
407         lib/Makefile                    \
408         lib/45/Makefile                 \
409         lib/auth/Makefile               \
410         lib/auth/afskauthlib/Makefile   \
411         lib/auth/pam/Makefile           \
412         lib/auth/sia/Makefile           \
413         lib/asn1/Makefile               \
414         lib/com_err/Makefile            \
415         lib/des/Makefile                \
416         lib/editline/Makefile           \
417         lib/gssapi/Makefile             \
418         lib/hdb/Makefile                \
419         lib/kadm5/Makefile              \
420         lib/kafs/Makefile               \
421         lib/kdfs/Makefile               \
422         lib/krb5/Makefile               \
423         lib/otp/Makefile                \
424         lib/roken/Makefile              \
425         lib/sl/Makefile                 \
426         lib/vers/Makefile               \
427         kuser/Makefile                  \
428         kpasswd/Makefile                \
429         kadmin/Makefile                 \
430         admin/Makefile                  \
431         kdc/Makefile                    \
432         appl/Makefile                   \
433         appl/afsutil/Makefile           \
434         appl/ftp/Makefile               \
435         appl/ftp/common/Makefile        \
436         appl/ftp/ftp/Makefile           \
437         appl/ftp/ftpd/Makefile          \
438         appl/kx/Makefile                \
439         appl/login/Makefile             \
440         appl/otp/Makefile               \
441         appl/popper/Makefile            \
442         appl/push/Makefile              \
443         appl/rsh/Makefile               \
444         appl/rcp/Makefile               \
445         appl/su/Makefile                \
446         appl/xnlock/Makefile            \
447         appl/telnet/Makefile            \
448         appl/telnet/libtelnet/Makefile  \
449         appl/telnet/telnet/Makefile     \
450         appl/telnet/telnetd/Makefile    \
451         appl/test/Makefile              \
452         appl/kf/Makefile                \
453         appl/dceutils/Makefile          \
454         doc/Makefile                    \
455         tools/Makefile                  \
456 )
457
458 AC_OUTPUT
459
460 dnl
461 dnl This is the release version name-number[beta]
462 dnl
463
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";
467 EOF
468
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
472 else
473         echo "creating include/version.h"
474         User=${USER-${LOGNAME}}
475         Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
476         Date=`date`
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
479 fi