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