]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - crypto/kerberosIV/configure.in
This commit was generated by cvs2svn to compensate for changes in r52750,
[FreeBSD/FreeBSD.git] / crypto / kerberosIV / configure.in
1 dnl
2 dnl *** PLEASE NOTE ***
3 dnl *** PLEASE NOTE ***
4 dnl *** PLEASE NOTE ***
5 dnl
6 dnl Update $VERSION before making a new release
7 dnl
8
9 dnl Process this file with autoconf to produce a configure script.
10 dnl
11 AC_REVISION($Revision: 1.415.2.9 $)
12 AC_INIT(lib/krb/getrealm.c)
13 AC_CONFIG_HEADER(include/config.h)
14
15 dnl
16 dnl definitions
17 dnl
18
19 PACKAGE=krb4
20 AC_SUBST(PACKAGE)dnl
21 VERSION=0.10.1
22 AC_SUBST(VERSION)dnl
23 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])dnl
24 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])dnl
25
26 # This may be overridden using --prefix=/usr to configure
27 AC_PREFIX_DEFAULT(/usr/athena)
28
29 AC_CANONICAL_HOST
30 CANONICAL_HOST=$host
31 AC_SUBST(CANONICAL_HOST)
32
33 dnl OS specific defines
34
35 sunos=no
36 case "$host" in 
37 *-*-sunos4*)
38         sunos=40
39         ;;
40 *-*-solaris2.7)
41         sunos=57
42         ;;
43 *-*-solaris2*)
44         sunos=50
45         ;;
46 esac
47 if test "$sunos" != no; then
48         AC_DEFINE_UNQUOTED(SunOS, $sunos, 
49                 [Define to what version of SunOS you are running.])
50 fi
51
52 AC_PROG_MAKE_SET
53 AC_ARG_PROGRAM
54
55 # We want these before the checks, so the checks can modify their values.
56 test -z "$LDFLAGS" && LDFLAGS=-g
57
58 dnl
59 dnl check for programs
60 dnl
61
62 AC_KRB_PROG_LN_S
63 AC_PROG_CC
64 AC_PROG_CPP
65 AC_ISC_POSIX
66 AC_KRB_PROG_YACC
67 AC_PROG_LEX
68 AC_PROG_RANLIB
69 AC_PROG_INSTALL
70 dnl AC_PROG_AWK
71 dnl mawk seems to mishandle \# in lib/roken/roken.awk
72 AC_CHECK_PROGS(AWK, gawk nawk awk, )
73 AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, :)
74
75 dnl Use make Wall or make WFLAGS=".."
76 WFLAGS=""
77 WFLAGS_NOUNUSED=""
78 WFLAGS_NOIMPLICITINT=""
79 AC_SUBST(WFLAGS) dnl
80 AC_SUBST(WFLAGS_NOUNUSED) dnl
81 AC_SUBST(WFLAGS_NOIMPLICITINT) dnl
82
83 dnl
84 dnl check for build options
85 dnl
86
87 AC_TEST_PACKAGE_NEW(socks,[#include <socks.h>],-lsocks5)
88 CFLAGS="$INCLUDE_socks $CFLAGS"
89 LIBS="$LIB_socks $LIBS"
90
91 AC_ARG_ENABLE(legacy-kdestroy,
92 [  --enable-legacy-kdestroy    kdestroy doesn't destroy tokens by default],[
93 if test "$enableval" = "yes"; then
94         AC_DEFINE(LEGACY_KDESTROY,1, [Define to enable old kdestroy behavior.])
95 fi
96 ])
97
98 AC_ARG_ENABLE(match-subdomains,
99 [  --enable-match-subdomains    match realm in subdomains],
100 [if test "$enableval" = "yes"; then
101         AC_DEFINE(MATCH_SUBDOMAINS,1, [Define if you want to match subdomains.])
102 fi
103 ])
104
105 AC_ARG_WITH(ld-flags,
106 [  --with-ld-flags=flags   what flags use when linking])
107
108 AC_ARG_WITH(cracklib,
109 [  --with-cracklib=dir     use the cracklib.a in dir],
110 )
111
112 AC_ARG_WITH(dictpath,
113 [  --with-dictpath=path    use this dictionary with cracklib]
114 )
115
116 (test -z "$with_cracklib" && test -n "$with_dictpath") ||
117 (test -n "$with_cracklib" && test -z "$with_dictpath") &&
118 AC_MSG_ERROR(--with-cracklib requires --with-dictpath and vice versa)
119 test -n "$with_cracklib" &&
120 CRACKLIB="-L$with_cracklib -lcrack" &&
121 AC_MSG_RESULT(Using cracklib in $with_cracklib)
122 AC_SUBST(CRACKLIB)dnl
123 test -n "$with_dictpath" &&
124 AC_MSG_RESULT(Using dictpath=$with_dictpath) &&
125 AC_DEFINE_UNQUOTED(DICTPATH,"$with_dictpath", [Define this to be the directory where the 
126         dictionary for cracklib resides.])
127
128 AC_ARG_WITH(mailspool,
129 [  --with-mailspool=dir    this is the mail spool directory]
130 )
131
132 test -n "$with_mailspool" &&
133 AC_DEFINE_UNQUOTED(KRB4_MAILDIR, "$with_mailspool", [Define this to the path of the mail spool directory.])
134
135 AC_ARG_WITH(db-dir,
136 [  --with-db-dir=dir       this is the database directory (default /var/kerberos)])
137
138 test -n "$with_db_dir" &&
139 AC_DEFINE_UNQUOTED(DB_DIR, "$with_db_dir", [Define this to the kerberos database directory.])
140
141 AC_ARG_ENABLE(random-mkey,
142 [  --enable-random-mkey    use new code for master keys],[
143 if test "$enableval" = "yes"; then
144         AC_DEFINE(RANDOM_MKEY,1, [Define to enable new master key code.])
145 fi
146 ])
147
148 AC_ARG_WITH(mkey,
149 [  --with-mkey=file        where to put the master key],[
150 if test -n "$withval"; then
151         AC_DEFINE_UNQUOTED(MKEYFILE,"$withval", [Define this to the location of the master key.])
152 fi
153 ])
154
155 otp=yes
156 AC_ARG_ENABLE(otp,
157 [  --disable-otp           if you don't want OTP support],
158 [
159 if test "$enableval" = "no"; then
160         otp=no
161 fi
162 ])
163
164 if test "$otp" = "yes"; then
165         AC_DEFINE(OTP)
166         LIB_otp='-L$(top_builddir)/lib/otp -lotp'
167         OTP_dir=otp
168         LIB_SUBDIRS="$LIB_SUBDIRS otp"
169 fi
170 AC_SUBST(LIB_otp)
171 AC_SUBST(OTP_dir)
172
173 AC_CHECK_OSFC2
174
175 mmap=yes
176 AC_ARG_ENABLE(mmap,
177 [  --disable-mmap          disable use of mmap],
178 [
179 if test "$enableval" = "no"; then
180         mmap=no
181 fi
182 ])
183 if test "$mmap" = "no"; then
184         AC_DEFINE(NO_MMAP, 1, [Define if you don't want to use mmap.])
185 fi
186
187 aix_dynamic_afs=yes
188 AC_ARG_ENABLE(dynamic-afs,
189 [  --disable-dynamic-afs   don't use loaded AFS library with AIX],[
190 if test "$enableval" = "no"; then
191         aix_dynamic_afs=no
192 fi
193 ])
194
195 berkeley_db=db
196 AC_ARG_WITH(berkeley-db,
197 [  --without-berkeley-db   if you don't want berkeley db],[
198 if test "$withval" = no; then
199         berkeley_db=""
200 fi
201 ])
202
203 afs_support=yes
204 AC_ARG_WITH(afs-support,
205 [  --without-afs-support   if you don't want support for afs],[
206 if test "$withval" = no; then
207         AC_DEFINE(NO_AFS, 1, [Define if you don't wan't support for AFS.])
208         afs_support=no
209 fi
210 ])
211
212 des_quad=guess
213 AC_ARG_WITH(des-quad-checksum,
214 [  --with-des-quad-checksum=kind
215                            default checksum to use (new, old, or guess)],[
216 des_quad="$withval"
217 ])
218 if test "$des_quad" = "new"; then
219         ac_x=DES_QUAD_NEW
220 elif test "$des_quad" = "old"; then
221         ac_x=DES_QUAD_OLD
222 else
223         ac_x=DES_QUAD_GUESS
224 fi      
225 AC_DEFINE_UNQUOTED(DES_QUAD_DEFAULT,$ac_x, 
226         [Set this to the type of des-quad-cheksum to use.])
227
228 AC_ARG_WITH(afsws,
229 [  --with-afsws=dir        use AFS includes and libraries from dir=/usr/afsws],
230 AFSWS=$withval,
231 AFSWS=/usr/afsws
232 )
233 test "$AFSWS" = "yes" && AFSWS=/usr/afsws
234 AC_SUBST(AFSWS)
235
236 AC_ARG_ENABLE(rxkad,
237 [  --enable-rxkad           build rxkad library],,[
238 test -f $AFSWS/include/rx/rx.h && enable_rxkad=yes
239 ])
240
241 if test "$afs_support" = yes -a "$enable_rxkad" = yes; then
242         LIB_SUBDIRS="$LIB_SUBDIRS rxkad"
243 fi
244 AC_SUBST(LIB_SUBDIRS)
245
246 AC_ARG_ENABLE(cat-manpages,
247 [  --disable-cat-manpages   don't install any preformatted manpages],
248 [
249 if test "$enableval" = "no"; then
250         disable_cat_manpages=yes
251 fi
252 ])
253
254 AC_SUBST(disable_cat_manpages)dnl
255
256 AC_TEST_PACKAGE_NEW(readline,[
257 #include <stdio.h>
258 #include <readline.h>
259 ],-lreadline)
260
261 AC_MIPS_ABI
262
263 AC_TEST_PACKAGE_NEW(hesiod,[#include <hesiod.h>],-lhesiod)
264
265 AC_SHARED_LIBS
266
267 dnl
268 dnl Check for endian-ness, this breaks cross compilation
269 dnl
270 AC_C_BIGENDIAN
271
272 dnl
273 dnl Check for constness
274 dnl
275 AC_C_CONST
276
277 dnl
278 dnl Check for inline keyword
279 dnl
280 AC_C_INLINE
281
282 dnl
283 dnl Check for __attribute__
284 dnl
285 AC_C___ATTRIBUTE__
286
287 dnl
288 dnl Check for strange operating systems that you need to handle differently
289 dnl
290
291 AC_KRB_SYS_NEXTSTEP
292 AC_KRB_SYS_AIX
293
294 if test "$krb_cv_sys_aix" = yes ;then
295         if test "$aix_dynamic_afs" = yes; then
296                 AFS_EXTRA_OBJS=
297                 AFS_EXTRA_LIBS=afslib.so
298                 # this works differently in AIX <=3 and 4
299                 if test `uname -v` = 4 ; then
300                         AFS_EXTRA_LD="-bnoentry"
301                 else
302                         AFS_EXTRA_LD="-e _nostart"
303                 fi
304                 AFS_EXTRA_DEFS=
305                 AC_FIND_FUNC_NO_LIBS(dlopen, dl)
306                 if test "$ac_cv_funclib_dlopen" = yes; then
307                         AIX_EXTRA_KAFS=
308                 elif test "$ac_cv_funclib_dlopen" != no; then
309                         AIX_EXTRA_KAFS="$ac_cv_funclib_dlopen"
310                 else
311                         AFS_EXTRA_OBJS="$AFS_EXTRA_OBJS dlfcn.o"
312                         AIX_EXTRA_KAFS=-lld
313                 fi
314         else
315                 AFS_EXTRA_OBJS='$(srcdir)/afsl.exp afslib.o'
316                 AFS_EXTRA_LIBS=
317                 AFS_EXTRA_DEFS='-DSTATIC_AFS_SYSCALLS'
318                 AIX_EXTRA_KAFS=
319         fi
320         AC_SUBST(AFS_EXTRA_OBJS)dnl
321         AC_SUBST(AFS_EXTRA_LIBS)dnl
322         AC_SUBST(AFS_EXTRA_LD)dnl
323         AC_SUBST(AFS_EXTRA_DEFS)dnl
324         AC_SUBST(AIX_EXTRA_KAFS)dnl
325 fi
326
327 #
328 # AIX needs /lib/pse.exp for getmsg, but alas that file is broken in
329 # AIX414
330 #
331
332 if test -f /lib/pse.exp ;then
333         LIBS="$LIBS -Wl,-bnolibpath -Wl,-bI:/lib/pse.exp"
334 fi
335
336 dnl
337 dnl Various checks for headers and their contents
338 dnl
339
340 AC_HEADER_STDC
341
342 AC_CHECK_HEADERS([arpa/ftp.h                    \
343         arpa/inet.h                             \
344         arpa/nameser.h                          \
345         arpa/telnet.h                           \
346         bsd/bsd.h                               \
347         bsdsetjmp.h                             \
348         capability.h                            \
349         crypt.h                                 \
350         curses.h                                \
351         db.h                                    \
352         dbm.h                                   \
353         dirent.h                                \
354         err.h                                   \
355         errno.h                                 \
356         fcntl.h                                 \
357         fnmatch.h                               \
358         grp.h                                   \
359         inttypes.h                              \
360         io.h                                    \
361         lastlog.h                               \
362         libutil.h                               \
363         limits.h                                \
364         login.h                                 \
365         maillock.h                              \
366         ndbm.h                                  \
367         net/if.h                                \
368         net/if_tun.h                            \
369         net/if_var.h                            \
370         netdb.h                                 \
371         netinet/in.h                            \
372         netinet/in6_machtypes.h                 \
373         netinet/in_systm.h                      \
374         paths.h                                 \
375         pty.h                                   \
376         pwd.h                                   \
377         resolv.h                                \
378         rpcsvc/dbm.h                            \
379         rpcsvc/ypclnt.h                         \
380         sac.h                                   \
381         security/pam_modules.h                  \
382         shadow.h                                \
383         siad.h                                  \
384         signal.h                                \
385         stropts.h                               \
386         sys/bitypes.h                           \
387         sys/capability.h                        \
388         sys/category.h                          \
389         sys/file.h                              \
390         sys/filio.h                             \
391         sys/ioccom.h                            \
392         sys/ioctl.h                             \
393         sys/locking.h                           \
394         sys/mman.h                              \
395         sys/param.h                             \
396         sys/proc.h                              \
397         sys/pty.h                               \
398         sys/ptyio.h                             \
399         sys/ptyvar.h                            \
400         sys/resource.h                          \
401         sys/select.h                            \
402         sys/socket.h                            \
403         sys/sockio.h                            \
404         sys/stat.h                              \
405         sys/str_tty.h                           \
406         sys/stream.h                            \
407         sys/stropts.h                           \
408         sys/strtty.h                            \
409         sys/syscall.h                           \
410         sys/sysctl.h                            \
411         sys/termio.h                            \
412         sys/time.h                              \
413         sys/timeb.h                             \
414         sys/times.h                             \
415         sys/tty.h                               \
416         sys/types.h                             \
417         sys/uio.h                               \
418         sys/un.h                                \
419         sys/utsname.h                           \
420         sys/wait.h                              \
421         syslog.h                                \
422         term.h                                  \
423         termcap.h                               \
424         termio.h                                \
425         termios.h                               \
426         tmpdir.h                                \
427         ttyent.h                                \
428         udb.h                                   \
429         ulimit.h                                \
430         unistd.h                                \
431         userpw.h                                \
432         usersec.h                               \
433         util.h                                  \
434         utime.h                                 \
435         utmp.h                                  \
436         utmpx.h                                 \
437         wait.h])
438
439 AC_HEADER_TIME
440 AC_DECL_SYS_SIGLIST
441
442 CHECK_NETINET_IP_AND_TCP
443
444 EXTRA_LOCL_HEADERS=
445 EXTRA_HEADERS=
446 if test "$ac_cv_header_err_h" != yes; then
447         EXTRA_HEADERS="$EXTRA_HEADERS err.h"
448 fi
449 if test "$ac_cv_header_fnmatch_h" != yes; then
450         EXTRA_LOCL_HEADERS="$EXTRA_LOCL_HEADERS fnmatch.h"
451 fi
452 AC_SUBST(EXTRA_HEADERS)
453 AC_SUBST(EXTRA_LOCL_HEADERS)
454
455 AC_GROK_TYPES(int8_t int16_t int32_t int64_t)
456 AC_GROK_TYPES(u_int8_t u_int16_t u_int32_t u_int64_t)
457
458 AC_MSG_CHECKING(for strange sys/bitypes.h)
459 AC_CACHE_VAL(krb_cv_int8_t_ifdef, [
460 AC_TRY_COMPILE([
461 #ifdef HAVE_SYS_TYPES_H
462 #include <sys/types.h>
463 #endif
464 #ifdef HAVE_SYS_BITYPES_H
465 #include <sys/bitypes.h>
466 #endif
467 #ifdef HAVE_NETINET_IN6_MACHTYPES_H
468 #include <netinet/in6_machtypes.h>
469 #endif
470 ],
471 int8_t x;
472 ,
473 krb_cv_int8_t_ifdef=no,
474 krb_cv_int8_t_ifdef=yes)])
475 AC_MSG_RESULT($krb_cv_int8_t_ifdef)
476 if test "$krb_cv_int8_t_ifdef" = "yes"; then
477   AC_DEFINE(HAVE_STRANGE_INT8_T, 1, [Huh?])dnl
478 fi
479
480 dnl
481 dnl Various checks for libraries and their contents
482 dnl
483
484 AC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl
485
486 dnl
487 dnl System V is have misplaced the socket routines, should really be in libc
488 dnl
489
490 AC_FIND_FUNC(socket, socket,
491 [#ifdef HAVE_SYS_TYPES_H
492 #include <sys/types.h>
493 #endif
494 #ifdef HAVE_SYS_SOCKET_H
495 #include <sys/socket.h>
496 #endif],
497 [0,0,0])
498 AC_FIND_FUNC(gethostbyname, nsl,
499 [#ifdef HAVE_SYS_TYPES_H
500 #include <sys/types.h>
501 #endif
502 #ifdef HAVE_SYS_SOCKET_H
503 #include <sys/socket.h>
504 #endif],
505 "foo")
506
507 dnl
508 dnl Horror AIX needs -lodm -lcfg to link login
509 dnl
510
511 AC_FIND_FUNC(odm_initialize, odm)
512 AC_FIND_FUNC(getattr, cfg)
513 AC_FIND_FUNC(setpcred, s)
514 AC_FIND_FUNC(logwtmp, util)
515
516 AC_FIND_FUNC(logout, util)
517 AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses)
518         
519 dnl 
520 dnl See if there is any X11 present
521 dnl
522 KRB_CHECK_X
523 if test "$no_x" = "yes" ; then
524         MAKE_X_PROGS_BIN=""
525         MAKE_X_PROGS_LIBEXEC=""
526 else
527         MAKE_X_PROGS_BIN='$(X_PROGS_BIN)'
528         MAKE_X_PROGS_LIBEXEC='$(X_PROGS_LIBEXEC)'
529 fi
530 AC_SUBST(MAKE_X_PROGS_BIN)dnl
531 AC_SUBST(MAKE_X_PROGS_LIBEXEC)dnl
532
533 AC_CHECK_XAU
534
535 dnl
536 dnl Look for berkeley db, gdbm, and ndbm in that order.
537 dnl
538
539 KRB_FIND_DB("" $berkeley_db gdbm ndbm)
540
541 AC_FIND_FUNC(syslog, syslog)
542
543 AC_BROKEN_SNPRINTF
544 AC_BROKEN_GLOB
545
546 if test "$ac_cv_func_glob_working" != yes; then
547         EXTRA_LOCL_HEADERS="$EXTRA_LOCL_HEADERS glob.h"
548         LIBOBJS="$LIBOBJS glob.o"
549 fi
550
551 AC_CHECK_FUNCS(asnprintf asprintf vasprintf vasnprintf vsnprintf)
552
553 AC_CHECK_FUNCS(atexit _getpty _scrsize _setsid _stricmp chroot fattach fchmod)
554 AC_CHECK_FUNCS(fcntl forkpty frevoke getlogin getpriority)
555 AC_CHECK_FUNCS(getrlimit getservbyname getspnam getspuid gettimeofday)
556 AC_CHECK_FUNCS(gettosbyname getuid grantpt mktime parsetos ptsname)
557 AC_CHECK_FUNCS(rand random revoke setitimer setlogin setpgid setpriority)
558 AC_CHECK_FUNCS(setproctitle setregid setresgid setresuid setreuid setsid)
559 AC_CHECK_FUNCS(setutent sigaction sysconf sysctl ttyname ttyslot)
560 AC_CHECK_FUNCS(ulimit uname unlockpt vhangup yp_get_default_domain)
561 AC_CHECK_FUNCS(on_exit sgi_getcapabilitybyname cap_set_proc)
562
563 AC_CHECK_GETPWNAM_R_POSIX
564
565 AC_FIND_FUNC_NO_LIBS(getsockopt, ,
566 [#ifdef HAVE_SYS_TYPES_H
567 #include <sys/types.h>
568 #endif
569 #ifdef HAVE_SYS_SOCKET_H
570 #include <sys/socket.h>
571 #endif],
572 [0,0,0,0,0])
573 AC_FIND_FUNC_NO_LIBS(setsockopt, ,
574 [#ifdef HAVE_SYS_TYPES_H
575 #include <sys/types.h>
576 #endif
577 #ifdef HAVE_SYS_SOCKET_H
578 #include <sys/socket.h>
579 #endif],
580 [0,0,0,0,0])
581
582 dnl Cray stuff
583 AC_CHECK_FUNCS(getudbnam setlim)
584
585 AC_FIND_FUNC(res_search, resolv,
586 [
587 #include <stdio.h>
588 #ifdef HAVE_SYS_TYPES_H
589 #include <sys/types.h>
590 #endif
591 #ifdef HAVE_NETINET_IN_H
592 #include <netinet/in.h>
593 #endif
594 #ifdef HAVE_ARPA_NAMESER_H
595 #include <arpa/nameser.h>
596 #endif
597 #ifdef HAVE_RESOLV_H
598 #include <resolv.h>
599 #endif
600 ],
601 [0,0,0,0,0])
602
603 AC_FIND_FUNC(dn_expand, resolv,
604 [
605 #include <stdio.h>
606 #ifdef HAVE_SYS_TYPES_H
607 #include <sys/types.h>
608 #endif
609 #ifdef HAVE_NETINET_IN_H
610 #include <netinet/in.h>
611 #endif
612 #ifdef HAVE_ARPA_NAMESER_H
613 #include <arpa/nameser.h>
614 #endif
615 #ifdef HAVE_RESOLV_H
616 #include <resolv.h>
617 #endif
618 ],
619 [0,0,0,0,0])
620
621 AC_SUBST(LIB_res_search)dnl
622 AC_SUBST(LIB_dn_expand)dnl
623
624 AC_FUNC_MMAP
625 AC_FUNC_ALLOCA
626
627 #
628 # Test for POSIX (broken) getlogin
629 #
630
631 if test "$ac_cv_func_getlogin" = yes; then
632 AC_CACHE_CHECK(if getlogin is posix, ac_cv_func_getlogin_posix, [
633 if test "$ac_cv_func_getlogin" = yes -a "$ac_cv_func_setlogin" = yes; then
634         ac_cv_func_getlogin_posix=no
635 else
636         ac_cv_func_getlogin_posix=yes
637 fi
638 ])
639 if test "$ac_cv_func_getlogin_posix" = yes; then
640         AC_DEFINE(POSIX_GETLOGIN, 1, [Define if getlogin has POSIX flavour (and not BSD).])
641 fi
642 fi
643
644 AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
645 [#ifdef HAVE_NETDB_H
646 #include <netdb.h>
647 #endif],
648 17)
649 if test "$ac_cv_func_hstrerror" = yes; then
650 AC_NEED_PROTO([
651 #ifdef HAVE_NETDB_H
652 #include <netdb.h>
653 #endif],
654 hstrerror)
655 fi
656
657 AC_BROKEN(chown daemon err errx fchown flock fnmatch)
658 AC_BROKEN(getcwd getdtablesize gethostname geteuid getgid getegid)
659 AC_BROKEN(getopt getusershell inet_aton initgroups innetgr iruserok lstat)
660 AC_BROKEN(memmove mkstemp putenv rcmd readv setegid setenv seteuid)
661 AC_BROKEN(strcasecmp strncasecmp strdup strerror strftime strlwr)
662 AC_BROKEN(strndup strnlen strsep strtok_r strupr)
663 AC_BROKEN(swab unsetenv verr verrx vsyslog)
664 AC_BROKEN(vwarn vwarnx warn warnx writev)
665
666 if test "$ac_cv_func_gethostname" = "yes"; then
667 AC_NEED_PROTO([
668 #include <unistd.h>],
669 gethostname)
670 fi
671
672 if test "$ac_cv_func_mkstemp" = "yes"; then
673 AC_NEED_PROTO([
674 #include <unistd.h>],
675 mkstemp)
676 fi
677
678 if test "$ac_cv_func_inet_aton" = "yes"; then
679 AC_NEED_PROTO([
680 #ifdef HAVE_SYS_TYPES_H
681 #include <sys/types.h>
682 #endif
683 #ifdef HAVE_SYS_SOCKET_H
684 #include <sys/socket.h>
685 #endif
686 #ifdef HAVE_NETINET_IN_H
687 #include <netinet/in.h>
688 #endif
689 #ifdef HAVE_ARPA_INET_H
690 #include <arpa/inet.h>
691 #endif],
692 inet_aton)
693 fi
694
695 AC_CACHE_CHECK(if realloc is broken, ac_cv_func_realloc_broken, [
696 ac_cv_func_realloc_broken=no
697 AC_TRY_RUN([
698 #include <stddef.h>
699 #include <stdlib.h>
700
701 int main()
702 {
703         return realloc(NULL, 17) == NULL;
704 }
705 ],:, ac_cv_func_realloc_broken=yes, :)
706 ])
707 if test "$ac_cv_func_realloc_broken" = yes ; then
708         AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL, X) doesn't work.])
709 fi
710
711 AC_KRB_FUNC_GETCWD_BROKEN
712
713 dnl
714 dnl Figure what authentication modules should be built
715 dnl
716
717 AC_MSG_CHECKING(which authentication modules should be built)
718
719 LIB_AUTH_SUBDIRS=
720
721 if test "$ac_cv_header_siad_h" = yes; then
722         LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS sia"
723 fi
724
725 if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_shared" = yes; then
726         LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS pam"
727 fi
728
729 case "${host}" in
730 changequote(,)dnl
731 *-*-irix[56]*) LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS afskauthlib" ;;
732 changequote([,])dnl
733 esac
734
735 AC_MSG_RESULT($LIB_AUTH_SUBDIRS)
736
737 AC_SUBST(LIB_AUTH_SUBDIRS)dnl
738
739 dnl
740 dnl Figure out if we have tunnels
741 dnl
742
743 AC_MSG_CHECKING(for tunnel devices)
744
745 APPL_KIP_DIR=
746
747 if test "$ac_cv_header_net_if_tun_h" = "yes"; then
748         APPL_KIP_DIR=kip
749 fi
750
751 AC_MSG_RESULT($ac_cv_header_net_if_tun_h)
752
753 AC_SUBST(APPL_KIP_DIR)dnl
754
755 dnl
756 dnl Checks for prototypes and declarations
757 dnl
758
759 AC_PROTO_COMPAT([
760 #ifdef HAVE_SYS_TYPES_H
761 #include <sys/types.h>
762 #endif
763 #ifdef HAVE_SYS_SOCKET_H
764 #include <sys/socket.h>
765 #endif
766 #ifdef HAVE_NETINET_IN_H
767 #include <netinet/in.h>
768 #endif
769 #ifdef HAVE_ARPA_INET_H
770 #include <arpa/inet.h>
771 #endif
772 #ifdef HAVE_NETDB_H
773 #include <netdb.h>
774 #endif
775 ],
776 gethostbyname, struct hostent *gethostbyname(const char *))
777
778 AC_PROTO_COMPAT([
779 #ifdef HAVE_SYS_TYPES_H
780 #include <sys/types.h>
781 #endif
782 #ifdef HAVE_SYS_SOCKET_H
783 #include <sys/socket.h>
784 #endif
785 #ifdef HAVE_NETINET_IN_H
786 #include <netinet/in.h>
787 #endif
788 #ifdef HAVE_ARPA_INET_H
789 #include <arpa/inet.h>
790 #endif
791 #ifdef HAVE_NETDB_H
792 #include <netdb.h>
793 #endif
794 ],
795 gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
796
797 AC_PROTO_COMPAT([
798 #ifdef HAVE_SYS_TYPES_H
799 #include <sys/types.h>
800 #endif
801 #ifdef HAVE_SYS_SOCKET_H
802 #include <sys/socket.h>
803 #endif
804 #ifdef HAVE_NETINET_IN_H
805 #include <netinet/in.h>
806 #endif
807 #ifdef HAVE_ARPA_INET_H
808 #include <arpa/inet.h>
809 #endif
810 #ifdef HAVE_NETDB_H
811 #include <netdb.h>
812 #endif
813 ],
814 getservbyname, struct servent *getservbyname(const char *, const char *))
815
816 AC_PROTO_COMPAT([
817 #ifdef HAVE_SYSLOG_H
818 #include <syslog.h>
819 #endif
820 ],
821 openlog, void openlog(const char *, int, int))
822
823 AC_NEED_PROTO([
824 #ifdef HAVE_CRYPT_H
825 #include <crypt.h>
826 #endif
827 #ifdef HAVE_UNISTD_H
828 #include <unistd.h>
829 #endif
830 ],
831 crypt)
832
833 AC_NEED_PROTO([
834 #include <stdio.h>
835 ],
836 fclose)
837
838 AC_NEED_PROTO([
839 #include <string.h>
840 ],
841 strtok_r)
842
843 AC_NEED_PROTO([
844 #include <string.h>
845 ],
846 strsep)
847
848 AC_NEED_PROTO([
849 #include <unistd.h>
850 ],
851 getusershell)
852
853 AC_NEED_PROTO([
854 #ifdef HAVE_UTIME_H
855 #include <utime.h>
856 #endif
857 ],
858 utime)
859
860 AC_CHECK_VAR([#ifdef HAVE_SYS_TYPES_H
861 #include <sys/types.h>
862 #endif
863 #ifdef HAVE_NETDB_H
864 #include <netdb.h>
865 #endif],
866 h_errno)
867
868 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
869 #include <netdb.h>
870 #endif],
871 h_errlist)
872
873 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
874 #include <netdb.h>
875 #endif],
876 h_nerr)
877
878 AC_CHECK_VAR([#ifdef HAVE_ERR_H
879 #include <err.h>
880 #endif],[__progname])
881
882 AC_CHECK_DECLARATION([#include <stdlib.h>], optarg)
883 AC_CHECK_DECLARATION([#include <stdlib.h>], optind)
884 AC_CHECK_DECLARATION([#include <stdlib.h>], opterr)
885 AC_CHECK_DECLARATION([#include <stdlib.h>], optopt)
886
887 AC_CHECK_DECLARATION([#include <stdlib.h>], environ)
888
889 dnl
890 dnl According to ANSI you are explicitly allowed to cast to void,
891 dnl but the standard fails to say what should happen. Some compilers
892 dnl think this is illegal:
893 dnl
894 dnl void foo(void)
895 dnl {
896 dnl   return (void)0;
897 dnl }
898 dnl
899 dnl Thus explicitly test for void
900 dnl
901 AC_TYPE_SIGNAL
902 if test "$ac_cv_type_signal" = "void" ; then
903         AC_DEFINE(VOID_RETSIGTYPE, 1, [Define if RETSIGTYPE == void.])
904 fi
905
906 dnl
907 dnl Check for fields in struct utmp
908 dnl
909
910 AC_HAVE_STRUCT_FIELD(struct utmp, ut_addr,
911 [#include <sys/types.h>
912  #include <utmp.h>])
913 AC_HAVE_STRUCT_FIELD(struct utmp, ut_host,
914 [#include <sys/types.h>
915  #include <utmp.h>])
916 AC_HAVE_STRUCT_FIELD(struct utmp, ut_id,
917 [#include <sys/types.h>
918  #include <utmp.h>])
919 AC_HAVE_STRUCT_FIELD(struct utmp, ut_pid,
920 [#include <sys/types.h>
921  #include <utmp.h>])
922 AC_HAVE_STRUCT_FIELD(struct utmp, ut_type,
923 [#include <sys/types.h>
924  #include <utmp.h>])
925 AC_HAVE_STRUCT_FIELD(struct utmp, ut_user,
926 [#include <sys/types.h>
927  #include <utmp.h>])
928 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_exit,
929 [#include <sys/types.h>
930  #include <utmp.h>])
931 AC_HAVE_STRUCT_FIELD(struct utmpx, ut_syslen,
932 [#include <sys/types.h>
933  #include <utmp.h>])
934
935 AC_KRB_STRUCT_SPWD
936
937 AC_STRUCT_ST_BLKSIZE
938
939 dnl
940 dnl Check for struct winsize
941 dnl
942
943 AC_KRB_STRUCT_WINSIZE
944
945 dnl
946 dnl Check for some common types
947 dnl
948
949 AC_TYPE_PID_T
950 AC_TYPE_UID_T
951 AC_TYPE_OFF_T
952 AC_TYPE_SIZE_T
953
954 AC_CHECK_TYPE_EXTRA(ssize_t, int, [
955 #ifdef HAVE_UNISTD_H
956 #include <unistd.h>
957 #endif])
958
959 dnl
960 dnl Check for broken ultrix sys/socket.h
961 dnl
962
963 AC_MSG_CHECKING(for broken sys/socket.h)
964 AC_CACHE_VAL(krb_cv_header_sys_socket_h_broken, [
965 AC_TRY_COMPILE(
966 [#include <sys/types.h>
967 #include <sys/socket.h>
968 #include <sys/socket.h>],[],
969 krb_cv_header_sys_socket_h_broken=no,
970 krb_cv_header_sys_socket_h_broken=yes)])
971 AC_MSG_RESULT($krb_cv_header_sys_socket_h_broken)
972 AC_SUBST(krb_cv_header_sys_socket_h_broken)
973
974 dnl
975 dnl Check for sa_len in sys/socket.h
976 dnl
977
978 AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
979 #include <sys/socket.h>])
980
981 dnl
982 dnl Check for ouid in sys/siad.h
983 dnl
984
985 if test "$ac_cv_header_siad_h" = yes; then
986 AC_HAVE_STRUCT_FIELD(SIAENTITY, ouid, [#include <siad.h>])
987 fi
988
989 dnl
990 dnl you can link with getmsg on AIX 3.2 but you cannot run the program
991 dnl
992
993 AC_CHECK_FUNCS(getmsg)
994
995 if test "$ac_cf_func_getmsg" = "yes"; then
996
997 AC_CACHE_CHECK(for working getmsg, ac_cv_func_getmsg,
998 AC_TRY_RUN(
999 [
1000 #include <stdio.h>
1001
1002 int main()
1003 {
1004   getmsg(open("/dev/null", 0), NULL, NULL, NULL);
1005   return 0;
1006 }
1007 ], ac_cv_func_getmsg=yes, ac_cv_func_getmsg=no, ac_cv_func_getmsg=no))
1008 test "$ac_cv_func_getmsg" = "yes" &&
1009 AC_DEFINE(HAVE_GETMSG, 1, [Define if you have a working getmsg.])
1010
1011 fi
1012
1013 dnl
1014 dnl Tests for editline
1015 dnl
1016
1017 dnl el_init
1018
1019 AC_FIND_FUNC_NO_LIBS(el_init, edit)
1020 if test "$ac_cv_func_el_init" = yes ; then
1021         AC_CACHE_CHECK(for four argument el_init, ac_cv_func_el_init_four,[
1022                 AC_TRY_COMPILE([#include <stdio.h>
1023                         #include <histedit.h>],
1024                         [el_init("", NULL, NULL, NULL);],
1025                         ac_cv_func_el_init_four=yes,
1026                         ac_cv_func_el_init_four=no)])
1027         if test "$ac_cv_func_el_init_four" = yes; then
1028                 AC_DEFINE(HAVE_FOUR_VALUED_EL_INIT, 1, [Define if el_init takes four arguments.])
1029         fi
1030 fi
1031
1032 dnl readline
1033
1034 save_LIBS="$LIBS"
1035 LIBS="$LIB_tgetent $LIBS"
1036 AC_FIND_FUNC_NO_LIBS(readline, edit readline)
1037 LIBS="$save_LIBS"
1038 el_yes="# "
1039 if test "$with_readline" -a "$with_readline" != "no"; then
1040         :
1041 elif test "$ac_cv_func_readline" = yes; then
1042         INCLUDE_readline=
1043 elif test "$ac_cv_func_el_init" = yes; then
1044         el_yes=
1045         LIB_readline="-L\$(top_builddir)/lib/editline -lel_compat $LIB_el_init"
1046         INCLUDE_readline='-I$(top_srcdir)/lib/editline'
1047 else
1048         LIB_readline='-L$(top_builddir)/lib/editline -leditline'
1049         INCLUDE_readline='-I$(top_srcdir)/lib/editline'
1050 fi
1051 LIB_readline="$LIB_readline \$(LIB_tgetent)"
1052 AC_DEFINE(HAVE_READLINE, 1, [Define if you have a readline function.])dnl XXX
1053 AC_SUBST(LIB_readline)
1054 AC_SUBST(INCLUDE_readline)
1055 AC_SUBST(el_yes)
1056
1057 dnl telnet muck --------------------------------------------------
1058
1059 AC_DEFINE(AUTHENTICATION)dnl
1060 AC_DEFINE(KRB4)dnl
1061 AC_DEFINE(ENCRYPTION)dnl
1062 AC_DEFINE(DES_ENCRYPTION)dnl
1063 AC_DEFINE(DIAGNOSTICS)dnl
1064 AC_DEFINE(OLD_ENVIRON)dnl
1065
1066 # Simple test for streamspty, based on the existance of getmsg(), alas
1067 # this breaks on SunOS4 which have streams but BSD-like ptys
1068 #
1069 # And also something wierd has happend with dec-osf1, fallback to bsd-ptys
1070
1071 AC_MSG_CHECKING(for streamspty)
1072 case "`uname -sr`" in
1073 SunOS\ 4*|OSF1*|IRIX\ 4*|HP-UX\ ?.10.*)
1074         krb_cv_sys_streamspty=no
1075         ;;
1076 AIX*)
1077         os_rel=`uname -v`.`uname -r`
1078         if expr "$os_rel" : "3*" >/dev/null 2>&1; then
1079                 krb_cv_sys_streamspty=no
1080         else
1081                 krb_cv_sys_streamspty="$ac_cv_func_getmsg"
1082         fi
1083         ;;
1084 *)
1085         krb_cv_sys_streamspty="$ac_cv_func_getmsg"
1086         ;;
1087 esac
1088 if test "$krb_cv_sys_streamspty" = yes; then
1089         AC_DEFINE(STREAMSPTY, 1, [Define if you have working stream ptys.])
1090 fi
1091 dnl AC_SUBST(STREAMSPTY)
1092 AC_MSG_RESULT($krb_cv_sys_streamspty)
1093
1094 AC_MSG_CHECKING([if /bin/ls takes -A])
1095 if /bin/ls -A > /dev/null 2>&1 ;then
1096         AC_DEFINE(HAVE_LS_A, 1, [Define if /bin/ls has a \`-A' flag.])
1097         krb_ls_a=yes
1098 else
1099         krb_ls_a=no
1100 fi
1101 AC_MSG_RESULT($krb_ls_a)
1102         
1103 dnl ------------------------------------------------------------
1104 AC_CACHE_CHECK(for suffix of preformatted manual pages, krb_cv_sys_cat_suffix,
1105 if grep _version /etc/man.conf > /dev/null 2>&1; then
1106         krb_cv_sys_cat_suffix=0
1107 else
1108         krb_cv_sys_cat_suffix=number
1109 fi)
1110 if test "$krb_cv_sys_cat_suffix" = number; then
1111                 CATSUFFIX='$$s'
1112 else
1113                 CATSUFFIX=0
1114 fi
1115 AC_SUBST(CATSUFFIX)
1116
1117 dnl ------------------------------------------------------------
1118
1119 KRB_KAFS_LIB="-L\$(top_builddir)/lib/kafs -lkafs $AIX_EXTRA_KAFS"
1120 AC_SUBST(KRB_KAFS_LIB)dnl
1121
1122 dnl ------------------------------------------------------------
1123
1124
1125 dnl This is done by AC_OUTPUT but we need the result here.
1126
1127 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1128 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1129
1130 for i in bin lib libexec sbin; do
1131         i=${i}dir
1132         foo=`echo $i | tr 'xindiscernible' 'XINDISCERNIBLE'`
1133         x="\$${i}"
1134         eval y="$x"
1135         while test "x$y" != "x$x"; do
1136                 x="$y"
1137                 eval y="$x"
1138         done
1139         AC_DEFINE_UNQUOTED($foo,"$x")
1140 done
1141
1142 dnl
1143 dnl We are all set to emit the Makefiles and config.h
1144 dnl
1145 AC_OUTPUT(                                      \
1146 Makefile                                        \
1147 include/Makefile                                \
1148 include/sys/Makefile                            \
1149                                                 \
1150 man/Makefile                                    \
1151                                                 \
1152 lib/Makefile                                    \
1153 lib/com_err/Makefile                            \
1154 lib/des/Makefile                                \
1155 lib/krb/Makefile                                \
1156 lib/kdb/Makefile                                \
1157 lib/kadm/Makefile                               \
1158 lib/acl/Makefile                                \
1159 lib/kafs/Makefile                               \
1160 lib/roken/Makefile                              \
1161 lib/otp/Makefile                                \
1162 lib/sl/Makefile                                 \
1163 lib/editline/Makefile                           \
1164 lib/rxkad/Makefile                              \
1165 lib/auth/Makefile                               \
1166 lib/auth/pam/Makefile                           \
1167 lib/auth/sia/Makefile                           \
1168 lib/auth/afskauthlib/Makefile                   \
1169                                                 \
1170 kuser/Makefile                                  \
1171 server/Makefile                                 \
1172 slave/Makefile                                  \
1173 admin/Makefile                                  \
1174 kadmin/Makefile                                 \
1175                                                 \
1176 appl/Makefile                                   \
1177                                                 \
1178 appl/afsutil/Makefile                           \
1179 appl/ftp/Makefile                               \
1180 appl/ftp/common/Makefile                        \
1181 appl/ftp/ftp/Makefile                           \
1182 appl/ftp/ftpd/Makefile                          \
1183 appl/telnet/Makefile                            \
1184 appl/telnet/libtelnet/Makefile                  \
1185 appl/telnet/telnet/Makefile                     \
1186 appl/telnet/telnetd/Makefile                    \
1187 appl/bsd/Makefile                               \
1188 appl/kauth/Makefile                             \
1189 appl/popper/Makefile                            \
1190 appl/movemail/Makefile                          \
1191 appl/push/Makefile                              \
1192 appl/sample/Makefile                            \
1193 appl/xnlock/Makefile                            \
1194 appl/kx/Makefile                                \
1195 appl/kip/Makefile                               \
1196 appl/otp/Makefile                               \
1197 doc/Makefile                                    \
1198 ) dnl end of AC_OUTPUT
1199
1200 AC_KRB_VERSION