]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - crypto/kerberosIV/configure.in
This commit was generated by cvs2svn to compensate for changes in r48146,
[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.285 $)
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.9.6
22 AC_SUBST(VERSION)dnl
23 # This may be overridden using --prefix=/usr to configure
24 AC_PREFIX_DEFAULT(/usr/athena)
25
26 AC_CANONICAL_HOST
27 AC_PROG_MAKE_SET
28 AC_ARG_PROGRAM
29
30 # We want these before the checks, so the checks can modify their values.
31 test -z "$LDFLAGS" && LDFLAGS=-g
32
33 dnl
34 dnl check for programs
35 dnl
36
37 AC_KRB_PROG_LN_S
38 AC_PROG_CC
39 AC_PROG_CPP
40 AC_ISC_POSIX
41 AC_KRB_PROG_YACC
42 AC_PROG_LEX
43 AC_PROG_RANLIB
44 AC_PROG_INSTALL
45 AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, :)
46
47 dnl
48 dnl check for build options
49 dnl
50
51 AC_TEST_PACKAGE(socks,socks.h,libsocks5.a,-lsocks5)
52 CFLAGS="$SOCKSINCLUDE $CFLAGS"
53 LIBS="$SOCKSLIB $LIBS"
54
55 dnl Check if we want to use shared libraries
56 AC_ARG_WITH(shared,
57 [  --with-shared           create shared libraries for Kerberos])
58
59 AC_ARG_WITH(cracklib,
60 [  --with-cracklib=dir     use the cracklib.a in dir],
61 )
62
63 AC_ARG_WITH(dictpath,
64 [  --with-dictpath=path    use this dictionary with cracklib]
65 )
66
67 (test -z "$with_cracklib" && test -n "$with_dictpath") ||
68 (test -n "$with_cracklib" && test -z "$with_dictpath") &&
69 AC_MSG_ERROR(--with-cracklib requires --with-dictpath and vice versa)
70 test -n "$with_cracklib" &&
71 CRACKLIB="-L$with_cracklib -lcrack" &&
72 AC_MSG_RESULT(Using cracklib in $with_cracklib)
73 AC_SUBST(CRACKLIB)dnl
74 test -n "$with_dictpath" &&
75 AC_MSG_RESULT(Using dictpath=$with_dictpath) &&
76 AC_DEFINE_UNQUOTED(DICTPATH,"$with_dictpath")
77
78 AC_ARG_WITH(mailspool,
79 [  --with-mailspool=dir    this is the mail spool directory]
80 )
81
82 test -n "$with_mailspool" &&
83 AC_DEFINE_UNQUOTED(KRB4_MAILDIR, "$with_mailspool")
84
85 AC_ARG_ENABLE(random-mkey,
86 [  --enable-random-mkey    use new code for master keys],[
87 if test "$enableval" = "yes"; then
88         AC_DEFINE(RANDOM_MKEY,1)
89 fi
90 ])
91
92 AC_ARG_WITH(mkey,
93 [  --with-mkey=file        where to put the master key],[
94 if test -n "$withval"; then
95         AC_DEFINE_UNQUOTED(MKEYFILE,"$withval")
96 fi
97 ])
98
99 berkeley_db=db
100 AC_ARG_WITH(berkeley-db,
101 [  --without-berkeley-db   if you don't want berkeley db],[
102 if test "$withval" = no; then
103         berkeley_db=""
104 fi
105 ])
106
107 afs_support=yes
108 AC_ARG_WITH(afs-support,
109 [  --without-afs-support   if you don't want support for afs],[
110 if test "$withval" = no; then
111         AC_DEFINE(NO_AFS)
112         afs_support=no
113 fi
114 ])
115
116 des_quad=guess
117 AC_ARG_WITH(des-quad-checksum,
118 [  --with-des-quad-checksum=kind
119                            default checksum to use (new, old, or guess)],[
120 des_quad="$withval"
121 ])
122 if test "$des_quad" = "new"; then
123         AC_DEFINE(DES_QUAD_DEFAULT,DES_QUAD_NEW)
124 elif test "$des_quad" = "old"; then
125         AC_DEFINE(DES_QUAD_DEFAULT,DES_QUAD_OLD)
126 else
127         AC_DEFINE(DES_QUAD_DEFAULT,DES_QUAD_GUESS)
128 fi      
129
130 AC_TEST_PACKAGE(readline,readline.h,libreadline.a,-lreadline)
131
132 dnl
133 dnl Shared library stuff has to be different everywhere
134 dnl
135
136 AC_SUBST(CFLAGS)dnl
137 AC_SUBST(LDFLAGS)dnl
138
139 case ${with_shared} in
140   yes ) with_shared=yes;;
141   no  ) with_shared=no;;
142   *   ) with_shared=no;;
143 esac
144
145 # NOTE: Building shared libraries may not work if you do not use gcc!
146 #
147 # OS            $SHLIBEXT
148 # HP-UX         sl
149 # Linux         so
150 # NetBSD        so
151 # FreeBSD       so
152 # OSF           so
153 # SunOS5        so
154 # SunOS4        so.0.5
155 # Irix          so
156 #
157 # LIBEXT is the extension we should build (.a or $SHLIBEXT)
158 REAL_PICFLAGS="-fpic"
159 LDSHARED='$(CC) $(PICFLAGS) -shared'
160 LIBPREFIX=lib
161 REAL_SHLIBEXT=so
162 changequote({,})dnl
163 SHLIB_VERSION=`echo $VERSION | sed 's/\([0-9.]*\).*/\1/'`
164 changequote([,])dnl
165 case "${host}" in
166 *-*-hpux*)
167         REAL_SHLIBEXT=sl
168         REAL_LD_FLAGS='-Wl,+b$(libdir)'
169         if test -z "$GCC"; then
170                 LDSHARED="ld -b"
171                 REAL_PICFLAGS="+z"
172         fi
173         ;;
174 *-*-linux*)
175         REAL_LD_FLAGS='-Wl,-rpath,$(libdir)'
176         ;;
177 *-*-*bsd*)
178         REAL_SHLIBEXT=so.$SHLIB_VERSION
179         LDSHARED='ld -Bshareable'
180         REAL_LD_FLAGS='-Wl,-R$(libdir)'
181         ;;
182 *-*-osf*)
183         REAL_LD_FLAGS='-Wl,-rpath,$(libdir)'
184         REAL_PICFLAGS=
185         LDSHARED='ld -shared -expect_unresolved \*'
186         ;;
187 *-*-solaris2*)
188         REAL_LD_FLAGS='-Wl,-R$(libdir)'
189         if test -z "$GCC"; then
190                 LDSHARED='$(CC) -G'
191                 REAL_PICFLAGS="-Kpic"
192         fi
193         ;;
194 *-*-sunos*)
195         REAL_SHLIBEXT=so.$SHLIB_VERSION
196         REAL_LD_FLAGS='-Wl,-L$(libdir)'
197         ;;
198 *-*-irix*)
199         REAL_LD_FLAGS='-Wl,-rpath,$(libdir)'
200         REAL_PICFLAGS=
201         ;;
202 *-*-os2_emx*)
203         LD_FLAGS='-Zexe'
204         LIBPREFIX=
205         EXECSUFFIX='.exe'
206         RANLIB=EMXOMF
207         REAL_SHLIBEXT=nobuild
208         ;;
209 *-*-cygwin32*)
210         EXECSUFFIX='.exe'
211         REAL_SHLIBEXT=nobuild
212         ;;
213 *)      REAL_SHLIBEXT=nobuild
214         REAL_PICFLAGS= 
215         ;;
216 esac
217
218 if test "${with_shared}" != "yes" ; then 
219  PICFLAGS=""
220  SHLIBEXT="nobuild"
221  LIBEXT="a"
222 else
223  PICFLAGS="$REAL_PICFLAGS"
224  SHLIBEXT="$REAL_SHLIBEXT"
225  LIBEXT="$SHLIBEXT"
226  LD_FLAGS="$REAL_LD_FLAGS"
227 fi
228
229 AC_SUBST(REAL_PICFLAGS) dnl
230 AC_SUBST(REAL_SHLIBEXT) dnl
231 AC_SUBST(REAL_LD_FLAGS) dnl
232
233 AC_SUBST(PICFLAGS) dnl
234 AC_SUBST(SHLIBEXT) dnl
235 AC_SUBST(LDSHARED) dnl
236 AC_SUBST(LD_FLAGS) dnl
237 AC_SUBST(LIBEXT) dnl
238 AC_SUBST(LIBPREFIX) dnl
239 AC_SUBST(EXECSUFFIX) dnl
240
241 dnl
242 dnl Check if we need to use weak-stuff
243 dnl
244
245 AC_HAVE_PRAGMA_WEAK
246
247 dnl
248 dnl Check for endian-ness, this breaks cross compilation
249 dnl
250 AC_C_BIGENDIAN
251
252 dnl
253 dnl Check for constness
254 dnl
255 AC_C_CONST
256
257 dnl
258 dnl Check for strange operating systems that you need to handle differently
259 dnl
260
261 AC_KRB_SYS_NEXTSTEP
262 AC_KRB_SYS_AIX
263
264 if test "$krb_cv_sys_aix" = yes ;then
265         AFS_EXTRA_OBJS='$(srcdir)/afsl.exp dlfcn.o'
266         AC_SUBST(AFS_EXTRA_OBJS)
267         AFS_EXTRA_LIBS=afslib.so
268         AC_SUBST(AFS_EXTRA_LIBS)
269 fi
270
271 #
272 # AIX needs /lib/pse.exp for getmsg, but alas that file is broken in
273 # AIX414
274 #
275
276 if test -f /lib/pse.exp ;then
277         LIBS="$LIBS -Wl,-bI:/lib/pse.exp"
278 fi
279
280 dnl
281 dnl Various checks for headers and their contents
282 dnl
283
284 AC_HEADER_STDC
285
286 AC_CHECK_HEADERS(arpa/ftp.h arpa/inet.h arpa/nameser.h)
287 AC_CHECK_HEADERS(arpa/telnet.h bind/bitypes.h bsd/bsd.h bsdsetjmp.h)
288 AC_CHECK_HEADERS(crypt.h dbm.h dirent.h err.h fcntl.h grp.h io.h)
289 AC_CHECK_HEADERS(lastlog.h login.h maillock.h ndbm.h net/if.h)
290 AC_CHECK_HEADERS(net/if_tun.h net/if_var.h netdb.h netinet/in.h)
291 AC_CHECK_HEADERS(netinet/in6_machtypes.h netinet/in_systm.h)
292 AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h paths.h pty.h pwd.h)
293 AC_CHECK_HEADERS(resolv.h rpcsvc/dbm.h sac.h security/pam_modules.h)
294 AC_CHECK_HEADERS(shadow.h siad.h signal.h stropts.h sys/bitypes.h)
295 AC_CHECK_HEADERS(sys/category.h sys/cdefs.h sys/file.h sys/filio.h)
296 AC_CHECK_HEADERS(sys/ioccom.h sys/ioctl.h sys/locking.h sys/mman.h)
297 AC_CHECK_HEADERS(sys/param.h sys/proc.h sys/ptyio.h sys/ptyvar.h)
298 AC_CHECK_HEADERS(sys/resource.h sys/select.h sys/socket.h)
299 AC_CHECK_HEADERS(sys/sockio.h sys/stat.h sys/str_tty.h sys/stream.h)
300 AC_CHECK_HEADERS(sys/stropts.h sys/strtty.h sys/syscall.h)
301 AC_CHECK_HEADERS(sys/sysctl.h sys/termio.h sys/time.h sys/timeb.h)
302 AC_CHECK_HEADERS(sys/times.h sys/tty.h sys/types.h sys/uio.h)
303 AC_CHECK_HEADERS(sys/un.h sys/utsname.h sys/wait.h syslog.h)
304 AC_CHECK_HEADERS(termio.h termios.h tmpdir.h ttyent.h udb.h ulimit.h)
305 AC_CHECK_HEADERS(unistd.h userpw.h usersec.h util.h utime.h utmp.h)
306 AC_CHECK_HEADERS(utmpx.h wait.h winsock.h)
307
308 AC_HEADER_TIME
309 AC_DECL_SYS_SIGLIST
310 AC_SUBST(ac_cv_header_sys_cdefs_h)dnl
311 AC_SUBST(ac_cv_header_err_h)dnl
312
313 AC_GROK_TYPES(int8_t int16_t int32_t int64_t)
314 AC_GROK_TYPES(u_int8_t u_int16_t u_int32_t u_int64_t)
315
316 dnl
317 dnl Various checks for libraries and their contents
318 dnl
319
320 dnl
321 dnl System V is have misplaced the socket routines, should really be in libc
322 dnl
323
324 AC_FIND_FUNC(socket, socket,
325 [#ifdef HAVE_SYS_TYPES_H
326 #include <sys/types.h>
327 #endif
328 #ifdef HAVE_SYS_SOCKET_H
329 #include <sys/socket.h>
330 #endif],
331 [0,0,0])
332 AC_FIND_FUNC(gethostbyname, nsl,
333 [#ifdef HAVE_SYS_TYPES_H
334 #include <sys/types.h>
335 #endif
336 #ifdef HAVE_SYS_SOCKET_H
337 #include <sys/socket.h>
338 #endif],
339 "foo")
340
341 dnl
342 dnl Horror AIX needs -lodm -lcfg to link login
343 dnl
344
345 AC_FIND_FUNC(odm_initialize, odm)
346 AC_FIND_FUNC(getattr, cfg)
347 AC_FIND_FUNC(setpcred, s)
348 AC_FIND_FUNC(logwtmp, util)
349
350 AC_FIND_FUNC(logout, util)
351 AC_FIND_FUNC_NO_LIBS(tgetent, termcap)
352         
353 dnl 
354 dnl See if there is any X11 present
355 dnl
356 AC_PATH_XTRA
357 if test "$no_x" = "yes" ; then
358         MAKE_X_PROGS_BIN=""
359         MAKE_X_PROGS_LIBEXEC=""
360 else
361         MAKE_X_PROGS_BIN='$(X_PROGS_BIN)'
362         MAKE_X_PROGS_LIBEXEC='$(X_PROGS_LIBEXEC)'
363 fi
364 AC_SUBST(MAKE_X_PROGS_BIN)dnl
365 AC_SUBST(MAKE_X_PROGS_LIBEXEC)dnl
366
367 save_CFLAGS="$CFLAGS"
368 CFLAGS="$X_CFLAGS $CFLAGS"
369 save_LIBS="$LIBS"
370 dnl LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
371 LIBS="$X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
372 save_LDFLAGS="$LDFLAGS"
373 LDFLAGS="$LDFLAGS $X_LIBS"
374
375 AC_FIND_FUNC_NO_LIBS(XauReadAuth, Xau X11)
376 ac_xxx="$LIBS"
377 LIBS="$LIB_XauReadAuth $LIBS"
378 AC_CHECK_FUNCS(XauWriteAuth)
379 if test "$ac_cv_func_XauWriteAuth" != "yes"; then
380   XauWriteAuth_c=writeauth.c
381   XauWriteAuth_o=writeauth.o
382 fi
383 AC_SUBST(XauWriteAuth_c)dnl
384 AC_SUBST(XauWriteAuth_o)dnl
385 LIBS="$ac_xxx"
386
387 CFLAGS=$save_CFLAGS
388 LIBS=$save_LIBS
389 LDFLAGS=$save_LDFLAGS
390
391 dnl
392 dnl Look for berkeley db, gdbm, and ndbm in that order.
393 dnl
394
395 save_LIBS="$LIBS"
396 AC_FIND_FUNC_NO_LIBS(dbopen, $berkeley_db)
397 LIBS="$LIB_dbopen $LIBS"
398 AC_FIND_FUNC_NO_LIBS(dbm_firstkey, $berkeley_db gdbm ndbm)
399 if test -n "$LIB_dbopen"; then
400   LIB_DBM="$LIB_dbopen"
401 else
402   LIB_DBM="$LIB_dbm_firstkey"
403 fi
404 AC_SUBST(LIB_DBM)dnl
405 LIBS="$save_LIBS"
406
407 AC_FIND_FUNC(syslog, syslog)
408
409 AC_CACHE_CHECK(for working snprintf,ac_cv_func_snprintf_working,
410 ac_cv_func_snprintf_working=yes
411 AC_TRY_RUN([
412 #include <stdio.h>
413 #include <string.h>
414 int main()
415 {
416 changequote(`,')dnl
417         char foo[3];
418 changequote([,])dnl
419         snprintf(foo, 2, "12");
420         return strcmp(foo, "1");
421 }],:,ac_cv_func_snprintf_working=no,:))
422 : << END
423 @@@funcs="$funcs snprintf"@@@
424 END
425 if test "$ac_cv_func_snprintf_working" = yes; then
426         foo=HAVE_SNPRINTF
427         AC_DEFINE_UNQUOTED($foo)
428 fi
429
430 AC_CHECK_FUNCS(asnprintf asprintf vasprintf vasnprintf vsnprintf)
431
432
433 AC_CHECK_FUNCS(_getpty _scrsize _setsid _stricmp fchmod fcntl flock)
434 AC_CHECK_FUNCS(forkpty frevoke gethostname getlogin getpriority getservbyname)
435 AC_CHECK_FUNCS(getspnam getspuid gettimeofday getuid grantpt)
436 AC_CHECK_FUNCS(innetgr iruserok mktime ptsname rand random)
437 AC_CHECK_FUNCS(revoke setitimer setlogin setpgid setpriority)
438 AC_CHECK_FUNCS(setproctitle setregid setresgid setresuid setreuid setsid)
439 AC_CHECK_FUNCS(setutent swab ttyname ttyslot ulimit uname)
440 AC_CHECK_FUNCS(unlockpt vhangup yp_get_default_domain)
441 AC_FIND_FUNC_NO_LIBS(getpwnam_r,c_r)
442 if test "$ac_cv_func_getpwnam_r" = yes; then
443         AC_CACHE_CHECK(if getpwnam_r is posix,ac_cv_func_getpwnam_r_posix,
444         ac_libs="$LIBS"
445         LIBS="$LIBS $LIB_getpwnam_r"
446         AC_TRY_RUN([
447 #include <pwd.h>
448 int main()
449 {
450         struct passwd pw, *pwd;
451         return getpwnam_r("", &pw, NULL, 0, &pwd) < 0;
452 }
453 ],ac_cv_func_getpwnam_r_posix=yes,ac_cv_func_getpwnam_r_posix=no,:)
454 LIBS="$ac_libs")
455 if test "$ac_cv_func_getpwnam_r_posix" = yes; then
456         AC_DEFINE(POSIX_GETPWNAM_R)
457 fi
458 fi
459
460 AC_FIND_FUNC_NO_LIBS(getsockopt, ,
461 [#ifdef HAVE_SYS_TYPES_H
462 #include <sys/types.h>
463 #endif
464 #ifdef HAVE_SYS_SOCKET_H
465 #include <sys/socket.h>
466 #endif],
467 [0,0,0,0,0])
468 AC_FIND_FUNC_NO_LIBS(setsockopt, ,
469 [#ifdef HAVE_SYS_TYPES_H
470 #include <sys/types.h>
471 #endif
472 #ifdef HAVE_SYS_SOCKET_H
473 #include <sys/socket.h>
474 #endif],
475 [0,0,0,0,0])
476
477 dnl Cray stuff
478 AC_CHECK_FUNCS(getudbnam setlim)
479
480 AC_FIND_FUNC(res_search, resolv,
481 [
482 #include <stdio.h>
483 #ifdef HAVE_SYS_TYPES_H
484 #include <sys/types.h>
485 #endif
486 #ifdef HAVE_NETINET_IN_H
487 #include <netinet/in.h>
488 #endif
489 #ifdef HAVE_ARPA_NAMESER_H
490 #include <arpa/nameser.h>
491 #endif
492 #ifdef HAVE_RESOLV_H
493 #include <resolv.h>
494 #endif
495 ],
496 [0,0,0,0,0])
497
498 AC_FIND_FUNC(dn_expand, resolv,
499 [
500 #include <stdio.h>
501 #ifdef HAVE_SYS_TYPES_H
502 #include <sys/types.h>
503 #endif
504 #ifdef HAVE_NETINET_IN_H
505 #include <netinet/in.h>
506 #endif
507 #ifdef HAVE_ARPA_NAMESER_H
508 #include <arpa/nameser.h>
509 #endif
510 #ifdef HAVE_RESOLV_H
511 #include <resolv.h>
512 #endif
513 ],
514 [0,0,0,0,0])
515
516
517 AC_FUNC_MMAP
518 AC_FUNC_ALLOCA
519
520 #
521 # Test for POSIX (broken) getlogin
522 #
523
524 if test "$ac_cv_func_getlogin" = yes; then
525 AC_CACHE_CHECK(if getlogin is posix, ac_cv_func_getlogin_posix, [
526 if test "$ac_cv_func_getlogin" = yes -a "$ac_cv_func_setlogin" = yes; then
527         ac_cv_func_getlogin_posix=no
528 else
529         ac_cv_func_getlogin_posix=yes
530 fi
531 ])
532 if test "$ac_cv_func_getlogin_posix" = yes; then
533         AC_DEFINE(POSIX_GETLOGIN, 1)
534 fi
535 fi
536
537 AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
538 [#ifdef HAVE_NETDB_H
539 #include <netdb.h>
540 #endif],
541 17)
542
543 AC_BROKEN(chown daemon err errx fchown getcwd getdtablesize getopt)
544 AC_BROKEN(getusershell inet_aton initgroups lstat memmove mkstemp)
545 AC_BROKEN(putenv rcmd setegid setenv seteuid strcasecmp strdup)
546 AC_BROKEN(strerror strftime strlwr strnlen strtok_r strupr unsetenv)
547 AC_BROKEN(verr verrx vwarn vwarnx warn warnx)
548
549 AC_KRB_FUNC_GETCWD_BROKEN
550
551 dnl
552 dnl Figure what authentication modules should be built
553 dnl
554
555 AC_MSG_CHECKING(which authentication modules should be built)
556
557 LIB_AUTH_SUBDIRS=
558
559 if test "$ac_cv_header_siad_h" = yes; then
560         LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS sia"
561 fi
562
563 if test "$ac_cv_header_security_pam_modules_h" = yes; then
564         LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS pam"
565 fi
566
567 case "${host}" in
568 changequote(,)dnl
569 *-*-irix[56]*) LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS afskauthlib" ;;
570 changequote([,])dnl
571 esac
572
573 AC_MSG_RESULT($LIB_AUTH_SUBDIRS)
574
575 AC_SUBST(LIB_AUTH_SUBDIRS)dnl
576
577 dnl
578 dnl Figure out if we have tunnels
579 dnl
580
581 AC_MSG_CHECKING(for tunnel devices)
582
583 APPL_KIP_DIR=
584
585 if test "$ac_cv_header_net_if_tun_h" = "yes"; then
586         APPL_KIP_DIR=kip
587 fi
588
589 AC_MSG_RESULT($ac_cv_header_net_if_tun_h)
590
591 AC_SUBST(APPL_KIP_DIR)dnl
592
593 dnl
594 dnl Checks for prototypes and declarations
595 dnl
596
597 AC_NEED_PROTO([
598 #ifdef HAVE_CRYPT_H
599 #include <crypt.h>
600 #endif
601 #ifdef HAVE_UNISTD_H
602 #include <unistd.h>
603 #endif
604 ],
605 crypt)
606
607 AC_NEED_PROTO([
608 #include <string.h>
609 ],
610 strtok_r)
611
612 AC_CHECK_VAR([#ifdef HAVE_SYS_TYPES_H
613 #include <sys/types.h>
614 #endif
615 #ifdef HAVE_NETDB_H
616 #include <netdb.h>
617 #endif],
618 h_errno)
619
620 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
621 #include <netdb.h>
622 #endif],
623 h_errlist)
624
625 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
626 #include <netdb.h>
627 #endif],
628 h_nerr)
629
630 AC_CHECK_VAR([#ifdef HAVE_ERR_H
631 #include <err.h>
632 #endif],[__progname])
633
634 AC_CHECK_DECLARATION([#include <stdlib.h>], optarg)
635 AC_CHECK_DECLARATION([#include <stdlib.h>], optind)
636 AC_CHECK_DECLARATION([#include <stdlib.h>], opterr)
637 AC_CHECK_DECLARATION([#include <stdlib.h>], optopt)
638
639 dnl
640 dnl According to ANSI you are explicitly allowed to cast to void,
641 dnl but the standard fails to say what should happen. Some compilers
642 dnl think this is illegal:
643 dnl
644 dnl void foo(void)
645 dnl {
646 dnl   return (void)0;
647 dnl }
648 dnl
649 dnl Thus explicitly test for void
650 dnl
651 AC_TYPE_SIGNAL
652 if test "$ac_cv_type_signal" = "void" ; then
653         AC_DEFINE(VOID_RETSIGTYPE, 1)
654 fi
655
656 dnl
657 dnl Check for fields in struct utmp
658 dnl
659 AC_EGREP_HEADER(ut_user, utmp.h, AC_DEFINE(HAVE_UT_USER))
660 AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE(HAVE_UT_HOST))
661 AC_EGREP_HEADER(ut_addr, utmp.h, AC_DEFINE(HAVE_UT_ADDR))
662 AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE(HAVE_UT_TYPE))
663 AC_EGREP_HEADER(ut_pid, utmp.h, AC_DEFINE(HAVE_UT_PID))
664 AC_EGREP_HEADER(ut_id, utmp.h, AC_DEFINE(HAVE_UT_ID))
665 AC_EGREP_HEADER(ut_syslen, utmpx.h, AC_DEFINE(HAVE_UT_SYSLEN))
666
667 AC_STRUCT_ST_BLKSIZE
668
669 dnl
670 dnl Check for struct winsize
671 dnl
672
673 AC_KRB_STRUCT_WINSIZE
674
675 dnl
676 dnl Check for some common types
677 dnl
678
679 AC_TYPE_PID_T
680 AC_TYPE_UID_T
681 AC_TYPE_OFF_T
682 AC_TYPE_SIZE_T
683
684 dnl
685 dnl Check for sa_len in sys/socket.h
686 dnl
687
688 AC_MSG_CHECKING(for sa_len in struct sockaddr)
689 AC_CACHE_VAL(krb_cv_struct_sockaddr_sa_len, [
690 AC_TRY_COMPILE(
691 [#include <sys/types.h>
692 #include <sys/socket.h>],
693 [struct sockaddr sa;
694 int foo = sa.sa_len;],
695 krb_cv_struct_sockaddr_sa_len=yes,
696 krb_cv_struct_sockaddr_sa_len=no)
697 ])
698 AC_MSG_RESULT($krb_cv_struct_sockaddr_sa_len)
699 if test "$krb_cv_struct_sockaddr_sa_len" = yes; then
700         AC_DEFINE(SOCKADDR_HAS_SA_LEN)
701 fi
702
703 dnl
704 dnl Check for ouid in sys/siad.h
705 dnl
706
707 if test "$ac_cv_header_siad_h" = yes; then
708 AC_MSG_CHECKING(for ouid in struct siaentity)
709 AC_CACHE_VAL(krb_cv_struct_siaentity_ouid, [
710 AC_TRY_COMPILE(
711 [#include <siad.h>
712 ],
713 [SIAENTITY e;
714 int foo = e.ouid;],
715 krb_cv_struct_siaentity_ouid=yes,
716 krb_cv_struct_siaentity_ouid=no)
717 ])
718 AC_MSG_RESULT($krb_cv_struct_siaentity_ouid)
719 if test "$krb_cv_struct_siaentity_ouid" = yes; then
720         AC_DEFINE(SIAENTITY_HAS_OUID)
721 fi
722 fi
723
724 dnl
725 dnl you can link with getmsg on AIX 3.2 but you cannot run the program
726 dnl
727
728 AC_CACHE_CHECK(for working getmsg, ac_cv_func_getmsg,
729 AC_TRY_RUN(
730 [
731 #include <stdio.h>
732
733 int main()
734 {
735   getmsg(open("/dev/null", 0), NULL, NULL, NULL);
736   return 0;
737 }
738 ], ac_cv_func_getmsg=yes, ac_cv_func_getmsg=no, ac_cv_func_getmsg=no))
739 test "$ac_cv_func_getmsg" = "yes" &&
740 AC_DEFINE(HAVE_GETMSG)
741
742 dnl
743 dnl Test if we are using berkeley db
744 dnl
745
746 save_LIBS="$LIBS"
747 LIBS="$LIB_DBM $LIBS"
748 AC_CACHE_CHECK(for berkeley db, krb_cv_lib_berkeleydb,
749 AC_TRY_RUN(
750 [
751 #include <unistd.h>
752 #include <fcntl.h>
753 #include <ndbm.h>
754 int main()
755 {
756   DBM *d;
757
758   d = dbm_open("conftest", O_RDWR | O_CREAT, 0666);
759   if(d == NULL)
760     return 1;
761   dbm_close(d);
762   return access("conftest.db", F_OK) != 0;
763 }], krb_cv_lib_berkeleydb=yes, krb_cv_lib_berkeleydb=no,
764 krb_cv_lib_berkeleydb=no))
765 test "$krb_cv_lib_berkeleydb" = "yes" &&
766 AC_DEFINE(HAVE_NEW_DB)
767 LIBS="$save_LIBS"
768
769 dnl
770 dnl Tests for editline
771 dnl
772
773 AC_FIND_FUNC_NO_LIBS(el_init, edit)
774 AC_FIND_FUNC_NO_LIBS(readline, readline)
775
776 if test "$with_readline"; then
777         AC_DEFINE(HAVE_READLINE, 1)
778         editline_OBJS=
779         LIB_readline="$READLINELIB "'$(LIB_tgetent)'
780         INCLUDE_readline="$READLINEINCLUDE"
781 elif test "$ac_cv_func_el_init" = yes; then
782         AC_DEFINE(HAVE_READLINE, 1)
783
784         editline_OBJS=edit_compat.o
785         LIB_readline='-L$(topdir)/lib/editline -leditline '"$LIB_el_init"' $(LIB_tgetent)'
786
787         INCLUDE_readline='-I$(topdir)/lib/editline -I$(top_srcdir)/lib/editline'
788 elif test "$ac_cv_func_readline" = yes; then
789         AC_DEFINE(HAVE_READLINE, 1)
790         editline_OBJS=
791         LIB_readline='-lreadline $(LIB_tgetent)'
792         INCLUDE_readline=
793 else
794         AC_DEFINE(HAVE_READLINE, 1)
795         editline_OBJS="editline.o complete.o sysunix.o"
796         LIB_readline='-L$(topdir)/lib/editline -leditline $(LIB_tgetent)'
797         INCLUDE_readline='-I$(topdir)/lib/editline -I$(top_srcdir)/lib/editline'
798 fi
799 AC_SUBST(LIB_readline)
800 AC_SUBST(INCLUDE_readline)
801 AC_SUBST(editline_OBJS)
802
803 dnl telnet muck --------------------------------------------------
804
805 AC_DEFINE(AUTHENTICATION)dnl
806 AC_DEFINE(KRB4)dnl
807 AC_DEFINE(ENCRYPTION)dnl
808 AC_DEFINE(DES_ENCRYPTION)dnl
809 AC_DEFINE(DIAGNOSTICS)dnl
810 AC_DEFINE(OLD_ENVIRON)dnl
811
812 # Simple test for streamspty, based on the existance of getmsg(), alas
813 # this breaks on SunOS4 which have streams but BSD-like ptys
814 #
815 # And also something wierd has happend with dec-osf1, fallback to bsd-ptys
816
817 AC_MSG_CHECKING(for streamspty)
818 case "`uname -sr`" in
819 SunOS\ 4*|OSF1*|IRIX\ 4*|HP-UX\ ?.10.*)
820         krb_cv_sys_streamspty=no
821         ;;
822 AIX*)
823         os_rel=`uname -v`.`uname -r`
824         if expr "$os_rel" : "3*" >/dev/null 2>&1; then
825                 krb_cv_sys_streamspty=no
826         else
827                 krb_cv_sys_streamspty="$ac_cv_func_getmsg"
828         fi
829         ;;
830 *)
831         krb_cv_sys_streamspty="$ac_cv_func_getmsg"
832         ;;
833 esac
834 if test "$krb_cv_sys_streamspty" = yes; then
835         AC_DEFINE(STREAMSPTY)
836 fi
837 dnl AC_SUBST(STREAMSPTY)
838 AC_MSG_RESULT($krb_cv_sys_streamspty)
839
840 AC_MSG_CHECKING([if /bin/ls takes -A])
841 if /bin/ls -A > /dev/null 2>&1 ;then
842         AC_DEFINE(HAVE_LS_A)
843         krb_ls_a=yes
844 else
845         krb_ls_a=no
846 fi
847 AC_MSG_RESULT($krb_ls_a)
848         
849 dnl ------------------------------------------------------------
850 AC_CACHE_CHECK(for suffix of preformatted manual pages, krb_cv_sys_cat_suffix,
851 if grep _version /etc/man.conf > /dev/null 2>&1; then
852         krb_cv_sys_cat_suffix=0
853 else
854         krb_cv_sys_cat_suffix=number
855 fi)
856 if test "$krb_cv_sys_cat_suffix" = number; then
857                 CATSUFFIX='$$s'
858 else
859                 CATSUFFIX=0
860 fi
861 AC_SUBST(CATSUFFIX)
862
863 dnl ------------------------------------------------------------
864
865 KRB_KAFS_LIB='-L$(topdir)/lib/kafs -lkafs'
866 if test "$krb_cv_sys_aix" = yes; then
867         KRB_KAFS_LIB="$KRB_KAFS_LIB -lld"
868 fi
869 AC_SUBST(KRB_KAFS_LIB)dnl
870
871 dnl ------------------------------------------------------------
872
873
874 dnl This is done by AC_OUTPUT but we need the result here.
875
876 test "x$prefix" = xNONE && prefix=$ac_default_prefix
877 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
878
879 for i in bin lib libexec sbin; do
880         i=${i}dir
881         foo=`echo $i | tr 'xindiscernible' 'XINDISCERNIBLE'`
882         x="\$${i}"
883         eval y="$x"
884         while test "x$y" != "x$x"; do
885                 x="$y"
886                 eval y="$x"
887         done
888         AC_DEFINE_UNQUOTED($foo,"$x")
889 done
890
891 dnl
892 dnl We are all set to emit the Makefiles and config.h
893 dnl
894 AC_OUTPUT(                                      \
895 Makefile                                        \
896 include/Makefile                                \
897 include/sys/Makefile                            \
898                                                 \
899 util/Makefile                                   \
900 util/et/Makefile                                \
901                                                 \
902 man/Makefile                                    \
903                                                 \
904 lib/Makefile                                    \
905 lib/des/Makefile                                \
906 lib/krb/Makefile                                \
907 lib/kdb/Makefile                                \
908 lib/kadm/Makefile                               \
909 lib/acl/Makefile                                \
910 lib/kafs/Makefile                               \
911 lib/roken/Makefile                              \
912 lib/otp/Makefile                                \
913 lib/sl/Makefile                                 \
914 lib/editline/Makefile                           \
915 lib/auth/Makefile                               \
916 lib/auth/pam/Makefile                           \
917 lib/auth/sia/Makefile                           \
918 lib/auth/afskauthlib/Makefile                   \
919                                                 \
920 kuser/Makefile                                  \
921 server/Makefile                                 \
922 slave/Makefile                                  \
923 admin/Makefile                                  \
924 kadmin/Makefile                                 \
925                                                 \
926 appl/Makefile                                   \
927                                                 \
928 appl/afsutil/Makefile                           \
929 appl/ftp/Makefile                               \
930 appl/ftp/common/Makefile                        \
931 appl/ftp/ftp/Makefile                           \
932 appl/ftp/ftpd/Makefile                          \
933 appl/telnet/Makefile                            \
934 appl/telnet/libtelnet/Makefile                  \
935 appl/telnet/telnet/Makefile                     \
936 appl/telnet/telnetd/Makefile                    \
937 appl/bsd/Makefile                               \
938 appl/kauth/Makefile                             \
939 appl/kpopper/Makefile                           \
940 appl/movemail/Makefile                          \
941 appl/sample/Makefile                            \
942 appl/xnlock/Makefile                            \
943 appl/kx/Makefile                                \
944 appl/kip/Makefile                               \
945 appl/otp/Makefile                               \
946 doc/Makefile                                    \
947 ) dnl end of AC_OUTPUT
948
949 dnl
950 dnl This is the release version name-number[beta]
951 dnl Update before making a new release
952 dnl
953 KRB4VERSION="$PACKAGE-$VERSION"
954
955 cat > include/newversion.h.in <<EOF
956 char *krb4_long_version = "@(#)\$Version: $KRB4VERSION by @USER@ on @HOST@ ($host) @DATE@ \$";
957 char *krb4_version = "$KRB4VERSION";
958 EOF
959
960 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
961         echo "include/version.h is unchanged"
962         rm -f include/newversion.h.in
963 else
964         echo "creating include/version.h"
965         User=${USER-${LOGNAME}}
966         Host=`(hostname || uname -n) 2>/dev/null | sed 1q`
967         Date=`date`
968         mv -f include/newversion.h.in include/version.h.in
969         sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h
970 fi