1 dnl aclocal.m4 generated automatically by aclocal 1.4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 dnl $Id: acinclude.m4,v 1.2 1999/03/01 13:06:21 joda Exp $
15 dnl Only put things that for some reason can't live in the `cf'
16 dnl directory in this file.
19 dnl $xId: misc.m4,v 1.1 1997/12/14 15:59:04 joda Exp $
21 define(upcase,`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`)dnl
23 dnl $Id: krb-prog-ln-s.m4,v 1.1 1997/12/14 15:59:01 joda Exp $
26 dnl Better test for ln -s, ln or cp
29 AC_DEFUN(AC_KRB_PROG_LN_S,
30 [AC_MSG_CHECKING(for ln -s or something else)
31 AC_CACHE_VAL(ac_cv_prog_LN_S,
33 if ln -s X conftestdata 2>/dev/null
36 ac_cv_prog_LN_S="ln -s"
39 if ln conftestdata1 conftestdata2; then
46 LN_S="$ac_cv_prog_LN_S"
47 AC_MSG_RESULT($ac_cv_prog_LN_S)
52 dnl $Id: krb-prog-yacc.m4,v 1.1 1997/12/14 15:59:02 joda Exp $
55 dnl We prefer byacc or yacc because they do not use `alloca'
58 AC_DEFUN(AC_KRB_PROG_YACC,
59 [AC_CHECK_PROGS(YACC, byacc yacc 'bison -y')])
61 dnl $Id: test-package.m4,v 1.7 1999/04/19 13:33:05 assar Exp $
63 dnl AC_TEST_PACKAGE_NEW(package,headers,libraries,extra libs,default locations)
65 AC_DEFUN(AC_TEST_PACKAGE,[AC_TEST_PACKAGE_NEW($1,[#include <$2>],$4,,$5)])
67 AC_DEFUN(AC_TEST_PACKAGE_NEW,[
69 [ --with-$1=dir use $1 in dir])
71 [ --with-$1-lib=dir use $1 libraries in dir],
72 [if test "$withval" = "yes" -o "$withval" = "no"; then
73 AC_MSG_ERROR([No argument for --with-$1-lib])
74 elif test "X$with_$1" = "X"; then
77 AC_ARG_WITH($1-include,
78 [ --with-$1-include=dir use $1 headers in dir],
79 [if test "$withval" = "yes" -o "$withval" = "no"; then
80 AC_MSG_ERROR([No argument for --with-$1-include])
81 elif test "X$with_$1" = "X"; then
85 AC_MSG_CHECKING(for $1)
91 *) if test "$with_$1_include" = ""; then
92 with_$1_include="$with_$1/include"
94 if test "$with_$1_lib" = ""; then
95 with_$1_lib="$with_$1/lib$abilibdirext"
103 header_dirs="$header_dirs $i/include"
104 lib_dirs="$lib_dirs $i/lib$abilibdirext"
107 case "$with_$1_include" in
110 *) header_dirs="$with_$1_include $header_dirs";;
112 case "$with_$1_lib" in
115 *) lib_dirs="$with_$1_lib $lib_dirs";;
118 save_CFLAGS="$CFLAGS"
121 for i in $header_dirs; do
122 CFLAGS="-I$i $save_CFLAGS"
123 AC_TRY_COMPILE([$2],,ires=$i;break)
125 for i in $lib_dirs; do
126 LIBS="-L$i $3 $4 $save_LIBS"
127 AC_TRY_LINK([$2],,lres=$i;break)
129 CFLAGS="$save_CFLAGS"
132 if test "$ires" -a "$lres" -a "$with_$1" != "no"; then
133 $1_includedir="$ires"
135 INCLUDE_$1="-I$$1_includedir"
136 LIB_$1="-L$$1_libdir $3"
137 AC_DEFINE_UNQUOTED(upcase($1),1,[Define if you have the $1 package.])
139 AC_MSG_RESULT([headers $ires, libraries $lres])
144 AC_MSG_RESULT($with_$1)
150 dnl $Id: osfc2.m4,v 1.2 1999/03/27 17:28:16 joda Exp $
152 dnl enable OSF C2 stuff
154 AC_DEFUN(AC_CHECK_OSFC2,[
156 [ --enable-osfc2 enable some OSF C2 support])
158 if test "$enable_osfc2" = yes; then
159 AC_DEFINE(HAVE_OSFC2, 1, [Define to enable basic OSF C2 support.])
160 LIB_security=-lsecurity
162 AC_SUBST(LIB_security)
165 dnl $Id: mips-abi.m4,v 1.4 1998/05/16 20:44:15 joda Exp $
168 dnl Check for MIPS/IRIX ABI flags. Sets $abi and $abilibdirext to some
171 AC_DEFUN(AC_MIPS_ABI, [
172 AC_ARG_WITH(mips_abi,
173 [ --with-mips-abi=abi ABI to use for IRIX (32, n32, or 64)])
177 with_mips_abi="${with_mips_abi:-yes}"
178 if test -n "$GCC"; then
180 # GCC < 2.8 only supports the O32 ABI. GCC >= 2.8 has a flag to select
181 # which ABI to use, but only supports (as of 2.8.1) the N32 and 64 ABIs.
183 # Default to N32, but if GCC doesn't grok -mabi=n32, we assume an old
184 # GCC and revert back to O32. The same goes if O32 is asked for - old
185 # GCCs doesn't like the -mabi option, and new GCCs can't output O32.
187 # Don't you just love *all* the different SGI ABIs?
189 case "${with_mips_abi}" in
190 32|o32) abi='-mabi=32'; abilibdirext='' ;;
191 n32|yes) abi='-mabi=n32'; abilibdirext='32' ;;
192 64) abi='-mabi=64'; abilibdirext='64' ;;
193 no) abi=''; abilibdirext='';;
194 *) AC_ERROR("Invalid ABI specified") ;;
196 if test -n "$abi" ; then
197 ac_foo=krb_cv_gcc_`echo $abi | tr =- __`
199 dnl can't use AC_CACHE_CHECK here, since it doesn't quote CACHE-ID to
202 AC_MSG_CHECKING([if $CC supports the $abi option])
203 AC_CACHE_VAL($ac_foo, [
204 save_CFLAGS="$CFLAGS"
205 CFLAGS="$CFLAGS $abi"
206 AC_TRY_COMPILE(,int x;, eval $ac_foo=yes, eval $ac_foo=no)
207 CFLAGS="$save_CFLAGS"
209 ac_res=`eval echo \\\$$ac_foo`
210 AC_MSG_RESULT($ac_res)
211 if test $ac_res = no; then
212 # Try to figure out why that failed...
215 save_CFLAGS="$CFLAGS"
216 CFLAGS="$CFLAGS -mabi=n32"
217 AC_TRY_COMPILE(,int x;, ac_res=yes, ac_res=no)
219 if test $ac_res = yes; then
221 AC_ERROR([$CC does not support the $with_mips_abi ABI])
228 if test $with_mips_abi = yes; then
229 # Old GCC, default to O32
234 AC_ERROR([$CC does not support the $with_mips_abi ABI])
238 fi #if test $ac_res = no; then
239 fi #if test -n "$abi" ; then
241 case "${with_mips_abi}" in
242 32|o32) abi='-32'; abilibdirext='' ;;
243 n32|yes) abi='-n32'; abilibdirext='32' ;;
244 64) abi='-64'; abilibdirext='64' ;;
245 no) abi=''; abilibdirext='';;
246 *) AC_ERROR("Invalid ABI specified") ;;
248 fi #if test -n "$GCC"; then
254 dnl $Id: shared-libs.m4,v 1.4.14.3 2000/12/07 18:03:00 bg Exp $
256 dnl Shared library stuff has to be different everywhere
259 AC_DEFUN(AC_SHARED_LIBS, [
261 dnl Check if we want to use shared libraries
262 AC_ARG_ENABLE(shared,
263 [ --enable-shared create shared libraries for Kerberos])
268 case ${enable_shared} in
269 yes ) enable_shared=yes;;
270 no ) enable_shared=no;;
271 * ) enable_shared=no;;
274 # NOTE: Building shared libraries may not work if you do not use gcc!
286 # LIBEXT is the extension we should build (.a or $SHLIBEXT)
290 REAL_PICFLAGS="-fpic"
291 LDSHARED='$(CC) $(PICFLAGS) -shared'
293 build_symlink_command=@true
294 install_symlink_command=@true
295 install_symlink_command2=@true
298 SHLIB_VERSION=`echo $VERSION | sed 's/\([0-9.]*\).*/\1/'`
299 SHLIB_SONAME=`echo $VERSION | sed 's/\([0-9]*\).*/\1/'`
304 REAL_LD_FLAGS='-Wl,+b$(libdir)'
305 if test -z "$GCC"; then
312 LDSHARED='$(CC) -shared -Wl,-soname,$(LIBNAME).so.'"${SHLIB_SONAME}"
313 REAL_LD_FLAGS='-Wl,-rpath,$(libdir)'
314 REAL_SHLIBEXT=so.$SHLIB_VERSION
315 build_symlink_command='$(LN_S) -f [$][@] $(LIBNAME).so'
316 install_symlink_command='$(LN_S) -f $(LIB) $(DESTDIR)$(libdir)/$(LIBNAME).so.'"${SHLIB_SONAME}"';$(LN_S) -f $(LIB) $(DESTDIR)$(libdir)/$(LIBNAME).so'
317 install_symlink_command2='$(LN_S) -f $(LIB2) $(DESTDIR)$(libdir)/$(LIBNAME2).so.'"${SHLIB_SONAME}"';$(LN_S) -f $(LIB2) $(DESTDIR)$(libdir)/$(LIBNAME2).so'
320 *-*-freebsd[345]* | *-*-freebsdelf[345]*)
322 REAL_SHLIBEXT=so.$SHLIB_VERSION
323 REAL_LD_FLAGS='-Wl,-R$(libdir)'
324 build_symlink_command='$(LN_S) -f [$][@] $(LIBNAME).so'
325 install_symlink_command='$(LN_S) -f $(LIB) $(DESTDIR)$(libdir)/$(LIBNAME).so'
326 install_symlink_command2='$(LN_S) -f $(LIB2) $(DESTDIR)$(libdir)/$(LIBNAME2).so'
329 REAL_SHLIBEXT=so.$SHLIB_VERSION
330 LDSHARED='ld -Bshareable'
331 REAL_LD_FLAGS='-Wl,-R$(libdir)'
334 REAL_LD_FLAGS='-Wl,-rpath,$(libdir)'
336 LDSHARED='ld -shared -expect_unresolved \*'
339 LDSHARED='$(CC) -shared -Wl,-h$(LIBNAME).so.'"${SHLIB_SONAME}"
340 REAL_SHLIBEXT=so.$SHLIB_VERSION
341 build_symlink_command='$(LN_S) [$][@] $(LIBNAME).so'
342 install_symlink_command='$(LN_S) $(LIB) $(DESTDIR)$(libdir)/$(LIBNAME).so.'"${SHLIB_SONAME}"';$(LN_S) $(LIB) $(DESTDIR)$(libdir)/$(LIBNAME).so'
343 install_symlink_command2='$(LN_S) $(LIB2) $(DESTDIR)$(libdir)/$(LIBNAME2).so.'"${SHLIB_SONAME}"';$(LN_S) $(LIB2) $(DESTDIR)$(libdir)/$(LIBNAME2).so'
344 REAL_LD_FLAGS='-Wl,-R$(libdir)'
345 if test -z "$GCC"; then
346 LDSHARED='$(CC) -G -h$(LIBNAME).so.'"${SHLIB_SONAME}"
347 REAL_PICFLAGS="-Kpic"
351 REAL_LD_FLAGS='' # really: LD_RUN_PATH=$(libdir) cc -o ...
352 REAL_LINK='LD_RUN_PATH=$(libdir) $(CC)'
354 REAL_PICFLAGS="-Kpic"
355 lib_deps=no # fails in mysterious ways
358 REAL_SHLIBEXT=so.$SHLIB_VERSION
359 REAL_LD_FLAGS='-Wl,-L$(libdir)'
363 libdir="${libdir}${abilibdirext}"
364 REAL_LD_FLAGS="${abi} -Wl,-rpath,\$(libdir)"
365 LD_FLAGS="${abi} -Wl,-rpath,\$(libdir)"
366 LDSHARED="\$(CC) -shared ${abi}"
368 CFLAGS="${abi} ${CFLAGS}"
375 REAL_SHLIBEXT=nobuild
379 REAL_SHLIBEXT=nobuild
381 *) REAL_SHLIBEXT=nobuild
386 if test "${enable_shared}" != "yes" ; then
390 build_symlink_command=@true
391 install_symlink_command=@true
392 install_symlink_command2=@true
394 PICFLAGS="$REAL_PICFLAGS"
395 SHLIBEXT="$REAL_SHLIBEXT"
397 AC_MSG_CHECKING(whether to use -rpath)
399 /lib | /usr/lib | /usr/local/lib)
405 LD_FLAGS="$REAL_LD_FLAGS"
406 test "$REAL_LINK" && LINK="$REAL_LINK"
407 AC_MSG_RESULT($LD_FLAGS)
412 if test "$lib_deps" = yes; then
419 AC_SUBST(lib_deps_yes)
420 AC_SUBST(lib_deps_no)
422 # use supplied ld-flags, or none if `no'
423 if test "$with_ld_flags" = no; then
425 elif test -n "$with_ld_flags"; then
426 LD_FLAGS="$with_ld_flags"
429 AC_SUBST(REAL_PICFLAGS) dnl
430 AC_SUBST(REAL_SHLIBEXT) dnl
431 AC_SUBST(REAL_LD_FLAGS) dnl
433 AC_SUBST(PICFLAGS) dnl
434 AC_SUBST(SHLIBEXT) dnl
435 AC_SUBST(LDSHARED) dnl
436 AC_SUBST(LD_FLAGS) dnl
438 AC_SUBST(LIBPREFIX) dnl
439 AC_SUBST(EXECSUFFIX) dnl
441 AC_SUBST(build_symlink_command)dnl
442 AC_SUBST(install_symlink_command)dnl
443 AC_SUBST(install_symlink_command2)dnl
447 dnl $Id: c-attribute.m4,v 1.2 1999/03/01 09:52:23 joda Exp $
451 dnl Test for __attribute__
454 AC_DEFUN(AC_C___ATTRIBUTE__, [
455 AC_MSG_CHECKING(for __attribute__)
456 AC_CACHE_VAL(ac_cv___attribute__, [
461 static void foo(void) __attribute__ ((noreturn));
469 ac_cv___attribute__=yes,
470 ac_cv___attribute__=no)])
471 if test "$ac_cv___attribute__" = "yes"; then
472 AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
474 AC_MSG_RESULT($ac_cv___attribute__)
478 dnl $Id: krb-sys-nextstep.m4,v 1.2 1998/06/03 23:48:40 joda Exp $
481 dnl NEXTSTEP is not posix compliant by default,
482 dnl you need a switch -posix to the compiler
485 AC_DEFUN(AC_KRB_SYS_NEXTSTEP, [
486 AC_MSG_CHECKING(for NEXTSTEP)
487 AC_CACHE_VAL(krb_cv_sys_nextstep,
489 [#if defined(NeXT) && !defined(__APPLE__)
492 ], krb_cv_sys_nextstep=yes, krb_cv_sys_nextstep=no) )
493 if test "$krb_cv_sys_nextstep" = "yes"; then
494 CFLAGS="$CFLAGS -posix"
497 AC_MSG_RESULT($krb_cv_sys_nextstep)
500 dnl $Id: krb-sys-aix.m4,v 1.1 1997/12/14 15:59:02 joda Exp $
503 dnl AIX have a very different syscall convention
505 AC_DEFUN(AC_KRB_SYS_AIX, [
506 AC_MSG_CHECKING(for AIX)
507 AC_CACHE_VAL(krb_cv_sys_aix,
512 ], krb_cv_sys_aix=yes, krb_cv_sys_aix=no) )
513 AC_MSG_RESULT($krb_cv_sys_aix)
516 dnl $Id: find-func-no-libs.m4,v 1.5 1999/10/30 21:08:18 assar Exp $
519 dnl Look for function in any of the specified libraries
522 dnl AC_FIND_FUNC_NO_LIBS(func, libraries, includes, arguments, extra libs, extra args)
523 AC_DEFUN(AC_FIND_FUNC_NO_LIBS, [
524 AC_FIND_FUNC_NO_LIBS2([$1], ["" $2], [$3], [$4], [$5], [$6])])
526 dnl $Id: find-func-no-libs2.m4,v 1.3 1999/10/30 21:09:53 assar Exp $
529 dnl Look for function in any of the specified libraries
532 dnl AC_FIND_FUNC_NO_LIBS2(func, libraries, includes, arguments, extra libs, extra args)
533 AC_DEFUN(AC_FIND_FUNC_NO_LIBS2, [
535 AC_MSG_CHECKING([for $1])
536 AC_CACHE_VAL(ac_cv_funclib_$1,
538 if eval "test \"\$ac_cv_func_$1\" != yes" ; then
541 if test -n "$ac_lib"; then
546 LIBS="$6 $ac_lib $5 $ac_save_LIBS"
547 AC_TRY_LINK([$3],[$1($4)],eval "if test -n \"$ac_lib\";then ac_cv_funclib_$1=$ac_lib; else ac_cv_funclib_$1=yes; fi";break)
549 eval "ac_cv_funclib_$1=\${ac_cv_funclib_$1-no}"
554 eval "ac_res=\$ac_cv_funclib_$1"
556 dnl autoheader tricks *sigh*
558 @@@funcs="$funcs $1"@@@
559 @@@libs="$libs $2"@@@
563 eval "ac_tr_func=HAVE_[]upcase($1)"
564 eval "ac_tr_lib=HAVE_LIB[]upcase($ac_res | sed -e 's/-l//')"
565 eval "LIB_$1=$ac_res"
569 eval "ac_cv_func_$1=yes"
571 AC_DEFINE_UNQUOTED($ac_tr_func)
575 eval "ac_cv_func_$1=no"
580 eval "ac_cv_func_$1=yes"
581 eval "ac_cv_lib_`echo "$ac_res" | sed 's/-l//'`=yes"
582 AC_DEFINE_UNQUOTED($ac_tr_func)
583 AC_DEFINE_UNQUOTED($ac_tr_lib)
584 AC_MSG_RESULT([yes, in $ac_res])
591 dnl $Id: check-netinet-ip-and-tcp.m4,v 1.2 1999/05/14 13:15:40 assar Exp $
594 dnl extra magic check for netinet/{ip.h,tcp.h} because on irix 6.5.3
595 dnl you have to include standards.h before including these files
597 AC_DEFUN(CHECK_NETINET_IP_AND_TCP,
599 AC_CHECK_HEADERS(standards.h)
600 for i in netinet/ip.h netinet/tcp.h; do
602 cv=`echo "$i" | sed 'y%./+-%__p_%'`
604 AC_MSG_CHECKING([for $i])
605 AC_CACHE_VAL([ac_cv_header_$cv],
607 #ifdef HAVE_STANDARDS_H
608 #include <standards.h>
612 eval "ac_cv_header_$cv=yes",
613 eval "ac_cv_header_$cv=no")])
614 AC_MSG_RESULT(`eval echo \\$ac_cv_header_$cv`)
616 if test `eval echo \\$ac_cv_header_$cv` = yes; then
617 ac_tr_hdr=HAVE_`echo $i | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
619 AC_DEFINE_UNQUOTED($ac_tr_hdr, 1)
622 dnl autoheader tricks *sigh*
624 @@@headers="$headers netinet/ip.h netinet/tcp.h"@@@
629 dnl $Id: grok-type.m4,v 1.4 1999/11/29 11:16:48 joda Exp $
631 AC_DEFUN(AC_GROK_TYPE, [
632 AC_CACHE_VAL(ac_cv_type_$1,
634 #ifdef HAVE_INTTYPES_H
635 #include <inttypes.h>
637 #ifdef HAVE_SYS_TYPES_H
638 #include <sys/types.h>
640 #ifdef HAVE_SYS_BITYPES_H
641 #include <sys/bitypes.h>
643 #ifdef HAVE_BIND_BITYPES_H
644 #include <bind/bitypes.h>
646 #ifdef HAVE_NETINET_IN6_MACHTYPES_H
647 #include <netinet/in6_machtypes.h>
652 eval ac_cv_type_$1=yes,
653 eval ac_cv_type_$1=no))])
655 AC_DEFUN(AC_GROK_TYPES, [
657 AC_MSG_CHECKING(for $i)
659 eval ac_res=\$ac_cv_type_$i
660 if test "$ac_res" = yes; then
661 type=HAVE_[]upcase($i)
662 AC_DEFINE_UNQUOTED($type)
664 AC_MSG_RESULT($ac_res)
668 dnl $Id: find-func.m4,v 1.1 1997/12/14 15:58:58 joda Exp $
670 dnl AC_FIND_FUNC(func, libraries, includes, arguments)
671 AC_DEFUN(AC_FIND_FUNC, [
672 AC_FIND_FUNC_NO_LIBS([$1], [$2], [$3], [$4])
673 if test -n "$LIB_$1"; then
679 dnl See if there is any X11 present
681 dnl $Id: check-x.m4,v 1.2 1999/11/05 04:25:23 assar Exp $
683 AC_DEFUN(KRB_CHECK_X,[
686 # try to figure out if we need any additional ld flags, like -R
687 # and yes, the autoconf X test is utterly broken
688 if test "$no_x" != yes; then
689 AC_CACHE_CHECK(for special X linker flags,krb_cv_sys_x_libs_rpath,[
691 ac_save_cflags="$CFLAGS"
692 CFLAGS="$CFLAGS $X_CFLAGS"
693 krb_cv_sys_x_libs_rpath=""
695 for rflag in "" "-R" "-R " "-rpath "; do
696 if test "$rflag" = ""; then
700 for flag in $X_LIBS; do
703 foo="$foo $flag `echo $flag | sed \"s/-L/$rflag/\"`"
711 LIBS="$ac_save_libs $foo $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
713 #include <X11/Xlib.h>
722 ], krb_cv_sys_x_libs_rpath="$rflag"; krb_cv_sys_x_libs="$foo"; break,:)
725 CFLAGS="$ac_save_cflags"
727 X_LIBS="$krb_cv_sys_x_libs"
731 dnl $Id: check-xau.m4,v 1.3 1999/05/14 01:17:06 assar Exp $
733 dnl check for Xau{Read,Write}Auth and XauFileName
735 AC_DEFUN(AC_CHECK_XAU,[
736 save_CFLAGS="$CFLAGS"
737 CFLAGS="$X_CFLAGS $CFLAGS"
739 dnl LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
740 LIBS="$X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
741 save_LDFLAGS="$LDFLAGS"
742 LDFLAGS="$LDFLAGS $X_LIBS"
745 AC_FIND_FUNC_NO_LIBS(XauWriteAuth, X11 Xau)
747 LIBS="$LIB_XauWriteAuth $LIBS"
748 AC_FIND_FUNC_NO_LIBS(XauReadAuth, X11 Xau)
749 LIBS="$LIB_XauReadAauth $LIBS"
750 AC_FIND_FUNC_NO_LIBS(XauFileName, X11 Xau)
753 case "$ac_cv_funclib_XauWriteAuth" in
756 *) if test "$ac_cv_funclib_XauReadAuth" = yes; then
757 if test "$ac_cv_funclib_XauFileName" = yes; then
758 LIB_XauReadAuth="$LIB_XauWriteAuth"
760 LIB_XauReadAuth="$LIB_XauWriteAuth $LIB_XauFileName"
763 if test "$ac_cv_funclib_XauFileName" = yes; then
764 LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth"
766 LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth $LIB_XauFileName"
772 if test "$AUTOMAKE" != ""; then
773 AM_CONDITIONAL(NEED_WRITEAUTH, test "$ac_cv_func_XauWriteAuth" != "yes")
775 AC_SUBST(NEED_WRITEAUTH_TRUE)
776 AC_SUBST(NEED_WRITEAUTH_FALSE)
777 if test "$ac_cv_func_XauWriteAuth" != "yes"; then
779 NEED_WRITEAUTH_FALSE='#'
781 NEED_WRITEAUTH_TRUE='#'
782 NEED_WRITEAUTH_FALSE=
787 LDFLAGS=$save_LDFLAGS
790 # Define a conditional.
792 AC_DEFUN(AM_CONDITIONAL,
803 dnl $Id: krb-find-db.m4,v 1.5.16.1 2000/08/16 04:11:57 assar Exp $
805 dnl find a suitable database library
807 dnl AC_FIND_DB(libraries)
808 AC_DEFUN(KRB_FIND_DB, [
823 AC_MSG_CHECKING(for dbm_open in $m)
824 AC_CACHE_VAL(ac_cv_krb_dbm_open_$m, [
831 #if defined(HAVE_NDBM_H)
833 #elif defined(HAVE_GDBM_NDBM_H)
834 #include <gdbm/ndbm.h>
835 #elif defined(HAVE_DBM_H)
837 #elif defined(HAVE_RPCSVC_DBM_H)
838 #include <rpcsvc/dbm.h>
839 #elif defined(HAVE_DB_H)
840 #define DB_DBM_HSEARCH 1
847 d = dbm_open("conftest", O_RDWR | O_CREAT, 0666);
853 if test -f conftest.db; then
857 fi], ac_res=no, ac_res=no)
861 eval ac_cv_krb_dbm_open_$m=$ac_res])
862 eval ac_res=\$ac_cv_krb_dbm_open_$m
863 AC_MSG_RESULT($ac_res)
865 if test "$lib_dbm" = no -a $ac_res = dbm; then
867 elif test "$lib_db" = no -a $ac_res = db; then
873 AC_MSG_CHECKING(for NDBM library)
875 if test "$lib_db" != no; then
878 AC_DEFINE(HAVE_NEW_DB, 1, [Define if NDBM really is DB (creates files ending in .db).])
879 if test "$LIB_DBM"; then
880 ac_res="yes, $LIB_DBM"
884 elif test "$lib_dbm" != no; then
887 if test "$LIB_DBM"; then
888 ac_res="yes, $LIB_DBM"
896 test "$ac_ndbm" = yes && AC_DEFINE(NDBM, 1, [Define if you have NDBM (and not DBM)])dnl
900 AC_MSG_RESULT($ac_res)
904 dnl $Id: broken-snprintf.m4,v 1.3 1999/03/01 09:52:22 joda Exp $
906 AC_DEFUN(AC_BROKEN_SNPRINTF, [
907 AC_CACHE_CHECK(for working snprintf,ac_cv_func_snprintf_working,
908 ac_cv_func_snprintf_working=yes
917 snprintf(foo, 2, "12");
918 return strcmp(foo, "1");
919 }],:,ac_cv_func_snprintf_working=no,:))
921 if test "$ac_cv_func_snprintf_working" = yes; then
922 AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [define if you have a working snprintf])
924 if test "$ac_cv_func_snprintf_working" = yes; then
925 AC_NEED_PROTO([#include <stdio.h>],snprintf)
929 AC_DEFUN(AC_BROKEN_VSNPRINTF,[
930 AC_CACHE_CHECK(for working vsnprintf,ac_cv_func_vsnprintf_working,
931 ac_cv_func_vsnprintf_working=yes
937 int foo(int num, ...)
944 vsnprintf(bar, 2, "%s", arg);
946 return strcmp(bar, "1");
953 }],:,ac_cv_func_vsnprintf_working=no,:))
955 if test "$ac_cv_func_vsnprintf_working" = yes; then
956 AC_DEFINE_UNQUOTED(HAVE_VSNPRINTF, 1, [define if you have a working vsnprintf])
958 if test "$ac_cv_func_vsnprintf_working" = yes; then
959 AC_NEED_PROTO([#include <stdio.h>],vsnprintf)
963 dnl $Id: need-proto.m4,v 1.2 1999/03/01 09:52:24 joda Exp $
966 dnl Check if we need the prototype for a function
969 dnl AC_NEED_PROTO(includes, function)
971 AC_DEFUN(AC_NEED_PROTO, [
972 if test "$ac_cv_func_$2+set" != set -o "$ac_cv_func_$2" = yes; then
973 AC_CACHE_CHECK([if $2 needs a prototype], ac_cv_func_$2_noproto,
975 [struct foo { int foo; } xx;
976 extern int $2 (struct foo*);
979 eval "ac_cv_func_$2_noproto=yes",
980 eval "ac_cv_func_$2_noproto=no"))
981 define([foo], [NEED_]translit($2, [a-z], [A-Z])[_PROTO])
982 if test "$ac_cv_func_$2_noproto" = yes; then
983 AC_DEFINE(foo, 1, [define if the system is missing a prototype for $2()])
989 dnl $Id: broken-glob.m4,v 1.2 1999/03/01 09:52:15 joda Exp $
991 dnl check for glob(3)
993 AC_DEFUN(AC_BROKEN_GLOB,[
994 AC_CACHE_CHECK(for working glob, ac_cv_func_glob_working,
995 ac_cv_func_glob_working=yes
999 glob(NULL, GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE, NULL, NULL);
1000 ],:,ac_cv_func_glob_working=no,:))
1002 if test "$ac_cv_func_glob_working" = yes; then
1003 AC_DEFINE(HAVE_GLOB, 1, [define if you have a glob() that groks
1004 GLOB_BRACE, GLOB_NOCHECK, GLOB_QUOTE, and GLOB_TILDE])
1006 if test "$ac_cv_func_glob_working" = yes; then
1007 AC_NEED_PROTO([#include <stdio.h>
1008 #include <glob.h>],glob)
1013 dnl $Id: capabilities.m4,v 1.2 1999/09/01 11:02:26 joda Exp $
1017 dnl Test SGI capabilities
1020 AC_DEFUN(KRB_CAPABILITIES,[
1022 AC_CHECK_HEADERS(capability.h sys/capability.h)
1024 AC_CHECK_FUNCS(sgi_getcapabilitybyname cap_set_proc)
1027 dnl $Id: check-getpwnam_r-posix.m4,v 1.2 1999/03/23 16:47:31 joda Exp $
1029 dnl check for getpwnam_r, and if it's posix or not
1031 AC_DEFUN(AC_CHECK_GETPWNAM_R_POSIX,[
1032 AC_FIND_FUNC_NO_LIBS(getpwnam_r,c_r)
1033 if test "$ac_cv_func_getpwnam_r" = yes; then
1034 AC_CACHE_CHECK(if getpwnam_r is posix,ac_cv_func_getpwnam_r_posix,
1036 LIBS="$LIBS $LIB_getpwnam_r"
1041 struct passwd pw, *pwd;
1042 return getpwnam_r("", &pw, NULL, 0, &pwd) < 0;
1044 ],ac_cv_func_getpwnam_r_posix=yes,ac_cv_func_getpwnam_r_posix=no,:)
1046 if test "$ac_cv_func_getpwnam_r_posix" = yes; then
1047 AC_DEFINE(POSIX_GETPWNAM_R, 1, [Define if getpwnam_r has POSIX flavour.])
1052 dnl $Id: krb-func-getlogin.m4,v 1.1 1999/07/13 17:45:30 assar Exp $
1054 dnl test for POSIX (broken) getlogin
1058 AC_DEFUN(AC_FUNC_GETLOGIN, [
1059 AC_CHECK_FUNCS(getlogin setlogin)
1060 if test "$ac_cv_func_getlogin" = yes; then
1061 AC_CACHE_CHECK(if getlogin is posix, ac_cv_func_getlogin_posix, [
1062 if test "$ac_cv_func_getlogin" = yes -a "$ac_cv_func_setlogin" = yes; then
1063 ac_cv_func_getlogin_posix=no
1065 ac_cv_func_getlogin_posix=yes
1068 if test "$ac_cv_func_getlogin_posix" = yes; then
1069 AC_DEFINE(POSIX_GETLOGIN, 1, [Define if getlogin has POSIX flavour (and not BSD).])
1074 dnl $Id: find-if-not-broken.m4,v 1.2 1998/03/16 22:16:27 joda Exp $
1077 dnl Mix between AC_FIND_FUNC and AC_BROKEN
1080 AC_DEFUN(AC_FIND_IF_NOT_BROKEN,
1081 [AC_FIND_FUNC([$1], [$2], [$3], [$4])
1082 if eval "test \"$ac_cv_func_$1\" != yes"; then
1083 LIBOBJS[]="$LIBOBJS $1.o"
1085 AC_SUBST(LIBOBJS)dnl
1088 dnl $Id: broken.m4,v 1.3 1998/03/16 22:16:19 joda Exp $
1091 dnl Same as AC _REPLACE_FUNCS, just define HAVE_func if found in normal
1097 AC_CHECK_FUNC($ac_func, [
1098 ac_tr_func=HAVE_[]upcase($ac_func)
1099 AC_DEFINE_UNQUOTED($ac_tr_func)],[LIBOBJS[]="$LIBOBJS ${ac_func}.o"])
1100 dnl autoheader tricks *sigh*
1102 @@@funcs="$funcs $1"@@@
1105 AC_SUBST(LIBOBJS)dnl
1108 dnl $Id: krb-func-getcwd-broken.m4,v 1.2 1999/03/01 13:03:32 joda Exp $
1111 dnl test for broken getcwd in (SunOS braindamage)
1114 AC_DEFUN(AC_KRB_FUNC_GETCWD_BROKEN, [
1115 if test "$ac_cv_func_getcwd" = yes; then
1116 AC_MSG_CHECKING(if getcwd is broken)
1117 AC_CACHE_VAL(ac_cv_func_getcwd_broken, [
1118 ac_cv_func_getcwd_broken=no
1122 char *getcwd(char*, int);
1124 void *popen(char *cmd, char *mode)
1133 ret = getcwd(0, 1024);
1134 if(ret == 0 && errno == ENOTTY)
1138 ], ac_cv_func_getcwd_broken=yes,:,:)
1140 if test "$ac_cv_func_getcwd_broken" = yes; then
1141 AC_DEFINE(BROKEN_GETCWD, 1, [Define if getcwd is broken (like in SunOS 4).])dnl
1142 LIBOBJS="$LIBOBJS getcwd.o"
1143 AC_SUBST(LIBOBJS)dnl
1144 AC_MSG_RESULT($ac_cv_func_getcwd_broken)
1146 AC_MSG_RESULT([seems ok])
1151 dnl $Id: proto-compat.m4,v 1.3 1999/03/01 13:03:48 joda Exp $
1154 dnl Check if the prototype of a function is compatible with another one
1157 dnl AC_PROTO_COMPAT(includes, function, prototype)
1159 AC_DEFUN(AC_PROTO_COMPAT, [
1160 AC_CACHE_CHECK([if $2 is compatible with system prototype],
1161 ac_cv_func_$2_proto_compat,
1162 AC_TRY_COMPILE([$1],
1164 eval "ac_cv_func_$2_proto_compat=yes",
1165 eval "ac_cv_func_$2_proto_compat=no"))
1166 define([foo], translit($2, [a-z], [A-Z])[_PROTO_COMPATIBLE])
1167 if test "$ac_cv_func_$2_proto_compat" = yes; then
1168 AC_DEFINE(foo, 1, [define if prototype of $2 is compatible with
1173 dnl $Id: check-var.m4,v 1.2 1999/03/01 09:52:23 joda Exp $
1175 dnl AC_CHECK_VAR(includes, variable)
1176 AC_DEFUN(AC_CHECK_VAR, [
1177 AC_MSG_CHECKING(for $2)
1178 AC_CACHE_VAL(ac_cv_var_$2, [
1179 AC_TRY_LINK([extern int $2;
1180 int foo() { return $2; }],
1182 ac_cv_var_$2=yes, ac_cv_var_$2=no)
1184 define([foo], [HAVE_]translit($2, [a-z], [A-Z]))
1186 AC_MSG_RESULT(`eval echo \\$ac_cv_var_$2`)
1187 if test `eval echo \\$ac_cv_var_$2` = yes; then
1188 AC_DEFINE_UNQUOTED(foo, 1, [define if you have $2])
1189 AC_CHECK_DECLARATION([$1],[$2])
1194 dnl $Id: check-declaration.m4,v 1.3 1999/03/01 13:03:08 joda Exp $
1197 dnl Check if we need the declaration of a variable
1200 dnl AC_HAVE_DECLARATION(includes, variable)
1201 AC_DEFUN(AC_CHECK_DECLARATION, [
1202 AC_MSG_CHECKING([if $2 is properly declared])
1203 AC_CACHE_VAL(ac_cv_var_$2_declaration, [
1205 extern struct { int foo; } $2;],
1207 eval "ac_cv_var_$2_declaration=no",
1208 eval "ac_cv_var_$2_declaration=yes")
1211 define(foo, [HAVE_]translit($2, [a-z], [A-Z])[_DECLARATION])
1213 AC_MSG_RESULT($ac_cv_var_$2_declaration)
1214 if eval "test \"\$ac_cv_var_$2_declaration\" = yes"; then
1215 AC_DEFINE(foo, 1, [define if your system declares $2])
1220 dnl $Id: have-struct-field.m4,v 1.6 1999/07/29 01:44:32 assar Exp $
1222 dnl check for fields in a structure
1224 dnl AC_HAVE_STRUCT_FIELD(struct, field, headers)
1226 AC_DEFUN(AC_HAVE_STRUCT_FIELD, [
1227 define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_]))
1228 AC_CACHE_CHECK([for $2 in $1], cache_val,[
1229 AC_TRY_COMPILE([$3],[$1 x; x.$2;],
1232 if test "$cache_val" = yes; then
1233 define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_]))
1234 AC_DEFINE(foo, 1, [Define if $1 has field $2.])
1237 undefine([cache_val])
1240 dnl $Id: have-type.m4,v 1.4 1999/07/24 19:23:01 assar Exp $
1242 dnl check for existance of a type
1244 dnl AC_HAVE_TYPE(TYPE,INCLUDES)
1245 AC_DEFUN(AC_HAVE_TYPE, [
1246 cv=`echo "$1" | sed 'y%./+- %__p__%'`
1247 AC_MSG_CHECKING(for $1)
1248 AC_CACHE_VAL([ac_cv_type_$cv],
1250 [#include <sys/types.h>
1257 eval "ac_cv_type_$cv=yes",
1258 eval "ac_cv_type_$cv=no"))dnl
1259 AC_MSG_RESULT(`eval echo \\$ac_cv_type_$cv`)
1260 if test `eval echo \\$ac_cv_type_$cv` = yes; then
1261 ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'`
1262 dnl autoheader tricks *sigh*
1263 define(foo,translit($1, [ ], [_]))
1265 @@@funcs="$funcs foo"@@@
1268 AC_DEFINE_UNQUOTED($ac_tr_hdr, 1)
1272 dnl $Id: krb-struct-spwd.m4,v 1.3 1999/07/13 21:04:11 assar Exp $
1274 dnl Test for `struct spwd'
1276 AC_DEFUN(AC_KRB_STRUCT_SPWD, [
1277 AC_MSG_CHECKING(for struct spwd)
1278 AC_CACHE_VAL(ac_cv_struct_spwd, [
1281 #ifdef HAVE_SHADOW_H
1285 ac_cv_struct_spwd=yes,
1286 ac_cv_struct_spwd=no)
1288 AC_MSG_RESULT($ac_cv_struct_spwd)
1290 if test "$ac_cv_struct_spwd" = "yes"; then
1291 AC_DEFINE(HAVE_STRUCT_SPWD, 1, [define if you have struct spwd])
1295 dnl $Id: krb-struct-winsize.m4,v 1.2 1999/03/01 09:52:23 joda Exp $
1298 dnl Search for struct winsize
1301 AC_DEFUN(AC_KRB_STRUCT_WINSIZE, [
1302 AC_MSG_CHECKING(for struct winsize)
1303 AC_CACHE_VAL(ac_cv_struct_winsize, [
1304 ac_cv_struct_winsize=no
1305 for i in sys/termios.h sys/ioctl.h; do
1308 struct[ ]*winsize,dnl
1310 $i, ac_cv_struct_winsize=yes; break)dnl
1313 if test "$ac_cv_struct_winsize" = "yes"; then
1314 AC_DEFINE(HAVE_STRUCT_WINSIZE, 1, [define if struct winsize is declared in sys/termios.h])
1316 AC_MSG_RESULT($ac_cv_struct_winsize)
1317 AC_EGREP_HEADER(ws_xpixel, termios.h,
1318 AC_DEFINE(HAVE_WS_XPIXEL, 1, [define if struct winsize has ws_xpixel]))
1319 AC_EGREP_HEADER(ws_ypixel, termios.h,
1320 AC_DEFINE(HAVE_WS_YPIXEL, 1, [define if struct winsize has ws_ypixel]))
1323 dnl $Id: check-type-extra.m4,v 1.2 1999/03/01 09:52:23 joda Exp $
1325 dnl ac_check_type + extra headers
1327 dnl AC_CHECK_TYPE_EXTRA(TYPE, DEFAULT, HEADERS)
1328 AC_DEFUN(AC_CHECK_TYPE_EXTRA,
1329 [AC_REQUIRE([AC_HEADER_STDC])dnl
1330 AC_MSG_CHECKING(for $1)
1331 AC_CACHE_VAL(ac_cv_type_$1,
1333 changequote(<<,>>)dnl
1334 <<$1[^a-zA-Z_0-9]>>dnl
1335 changequote([,]), [#include <sys/types.h>
1340 $3], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
1341 AC_MSG_RESULT($ac_cv_type_$1)
1342 if test $ac_cv_type_$1 = no; then
1343 AC_DEFINE($1, $2, [Define this to what the type $1 should be.])
1347 dnl $Id: krb-version.m4,v 1.1 1997/12/14 15:59:03 joda Exp $
1350 dnl output a C header-file with some version strings
1352 AC_DEFUN(AC_KRB_VERSION,[
1353 dnl AC_OUTPUT_COMMANDS([
1354 cat > include/newversion.h.in <<FOOBAR
1355 char *${PACKAGE}_long_version = "@(#)\$Version: $PACKAGE-$VERSION by @USER@ on @HOST@ ($host) @DATE@ \$";
1356 char *${PACKAGE}_version = "$PACKAGE-$VERSION";
1359 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
1360 echo "include/version.h is unchanged"
1361 rm -f include/newversion.h.in
1363 echo "creating include/version.h"
1364 User=${USER-${LOGNAME}}
1365 Host=`(hostname || uname -n) 2>/dev/null | sed 1q`
1367 mv -f include/newversion.h.in include/version.h.in
1368 sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h
1370 dnl ],host=$host PACKAGE=$PACKAGE VERSION=$VERSION)