1 # ./aclocal.m4 generated automatically by aclocal 1.4b
3 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 dnl $Id: acinclude.m4,v 1.15 1998/05/23 14:54:53 joda Exp $
16 dnl Only put things that for some reason can't live in the `cf'
17 dnl directory in this file.
20 dnl $xId: misc.m4,v 1.1 1997/12/14 15:59:04 joda Exp $
22 define(upcase,`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`)dnl
24 dnl $Id: misc.m4,v 1.2 2000/07/19 15:04:00 joda Exp $
26 AC_DEFUN([upcase],[`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`])dnl
27 AC_DEFUN([rk_CONFIG_HEADER],[AH_TOP([#ifndef RCSID
29 static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg }
46 /* Maximum values on all known systems */
47 #define MaxHostNameLen (64+4)
48 #define MaxPathLen (1024+4)
51 # Like AC_CONFIG_HEADER, but automatically create stamp file.
55 # When config.status generates a header, we must update the stamp-h file.
56 # This file resides in the same directory as the config header
57 # that is generated. We must strip everything past the first ":",
58 # and everything past the last "/".
62 AC_DEFUN([AM_CONFIG_HEADER],
63 [AC_CONFIG_HEADER([$1])
65 ifelse(patsubst([$1], [[^ ]], []),
67 [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
68 patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),
71 case " $CONFIG_HEADERS " in
73 echo timestamp > `echo $am_file | sed 's%:.*%%;s%[^/]*$%%'`stamp-h$am_indx
76 am_indx=\`expr \$am_indx + 1\`
80 # Do all the work for Automake. This macro actually does too much --
81 # some checks are only needed if your package does certain things.
82 # But this isn't really a big deal.
88 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
89 # -----------------------------------------------------------
90 # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
91 # The purpose of this macro is to provide the user with a means to
92 # check macros which are provided without letting her know how the
93 # information is coded.
94 # If this macro is not defined by Autoconf, define it here.
95 ifdef([AC_PROVIDE_IFELSE],
97 [define([AC_PROVIDE_IFELSE],
98 [ifdef([AC_PROVIDE_$1],
102 # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
103 # ----------------------------------------------
104 AC_DEFUN([AM_INIT_AUTOMAKE],
105 [dnl We require 2.13 because we rely on SHELL being computed by configure.
106 AC_REQUIRE([AC_PROG_INSTALL])dnl
107 # test to see if srcdir already configured
108 if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
109 test -f $srcdir/config.status; then
110 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
113 # Define the identity of the package.
119 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
120 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
122 # Some tools Automake needs.
123 AC_REQUIRE([AM_SANITY_CHECK])dnl
124 AC_REQUIRE([AC_ARG_PROGRAM])dnl
125 AM_MISSING_PROG(ACLOCAL, aclocal)
126 AM_MISSING_PROG(AUTOCONF, autoconf)
127 AM_MISSING_PROG(AUTOMAKE, automake)
128 AM_MISSING_PROG(AUTOHEADER, autoheader)
129 AM_MISSING_PROG(MAKEINFO, makeinfo)
130 AM_MISSING_PROG(AMTAR, tar)
131 AM_MISSING_INSTALL_SH
132 # We need awk for the "check" target. The system "awk" is bad on
134 AC_REQUIRE([AC_PROG_AWK])dnl
135 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
136 AC_REQUIRE([AM_DEP_TRACK])dnl
137 AC_REQUIRE([AM_SET_DEPDIR])dnl
138 AC_PROVIDE_IFELSE([AC_PROG_CC],
139 [AM_DEPENDENCIES(CC)],
140 [define([AC_PROG_CC],
141 defn([AC_PROG_CC])[AM_DEPENDENCIES(CC)])])dnl
142 AC_PROVIDE_IFELSE([AC_PROG_CXX],
143 [AM_DEPENDENCIES(CXX)],
144 [define([AC_PROG_CXX],
145 defn([AC_PROG_CXX])[AM_DEPENDENCIES(CXX)])])dnl
149 # Check to make sure that the build environment is sane.
152 AC_DEFUN([AM_SANITY_CHECK],
153 [AC_MSG_CHECKING([whether build environment is sane])
156 echo timestamp > conftestfile
157 # Do `set' in a subshell so we don't clobber the current shell's
158 # arguments. Must try -L first in case configure is actually a
159 # symlink; some systems play weird games with the mod time of symlinks
160 # (eg FreeBSD returns the mod time of the symlink's containing
163 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
164 if test "[$]*" = "X"; then
166 set X `ls -t $srcdir/configure conftestfile`
168 if test "[$]*" != "X $srcdir/configure conftestfile" \
169 && test "[$]*" != "X conftestfile $srcdir/configure"; then
171 # If neither matched, then we have a broken ls. This can happen
172 # if, for instance, CONFIG_SHELL is bash and it inherits a
173 # broken ls alias from the environment. This has actually
174 # happened. Such a system could not be considered "sane".
175 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
176 alias in your environment])
179 test "[$]2" = conftestfile
185 AC_MSG_ERROR([newly created file is older than distributed files!
186 Check your system clock])
191 # AM_MISSING_PROG(NAME, PROGRAM)
192 AC_DEFUN([AM_MISSING_PROG], [
193 AC_REQUIRE([AM_MISSING_HAS_RUN])
194 $1=${$1-"${am_missing_run}$2"}
197 # Like AM_MISSING_PROG, but only looks for install-sh.
198 # AM_MISSING_INSTALL_SH()
199 AC_DEFUN([AM_MISSING_INSTALL_SH], [
200 AC_REQUIRE([AM_MISSING_HAS_RUN])
201 if test -z "$install_sh"; then
202 install_sh="$ac_aux_dir/install-sh"
203 test -f "$install_sh" || install_sh="$ac_aux_dir/install.sh"
204 test -f "$install_sh" || install_sh="${am_missing_run}${ac_auxdir}/install-sh"
205 dnl FIXME: an evil hack: we remove the SHELL invocation from
206 dnl install_sh because automake adds it back in. Sigh.
207 install_sh="`echo $install_sh | sed -e 's/\${SHELL}//'`"
209 AC_SUBST(install_sh)])
211 # AM_MISSING_HAS_RUN.
212 # Define MISSING if not defined so far and test if it supports --run.
213 # If it does, set am_missing_run to use it, otherwise, to nothing.
214 AC_DEFUN([AM_MISSING_HAS_RUN], [
215 test x"${MISSING+set}" = xset || \
216 MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
217 # Use eval to expand $SHELL
218 if eval "$MISSING --run :"; then
219 am_missing_run="$MISSING --run "
223 AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
227 # See how the compiler implements dependency checking.
229 # AM_DEPENDENCIES(NAME)
230 # NAME is "CC", "CXX" or "OBJC".
232 # We try a few techniques and use that to set a single cache variable.
234 AC_DEFUN([AM_DEPENDENCIES],[
235 AC_REQUIRE([AM_SET_DEPDIR])
236 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])
238 AC_REQUIRE([AC_PROG_CC])
239 AC_REQUIRE([AC_PROG_CPP])
241 depcpp="$CPP"],[$1],CXX,[
242 AC_REQUIRE([AC_PROG_CXX])
243 AC_REQUIRE([AC_PROG_CXXCPP])
245 depcpp="$CXXCPP"],[$1],OBJC,[
246 am_cv_OBJC_dependencies_compiler_type=gcc],[
247 AC_REQUIRE([AC_PROG_][$1])
250 AC_MSG_CHECKING([dependency style of $depcc])
251 AC_CACHE_VAL(am_cv_[$1]_dependencies_compiler_type,[
252 if test -z "$AMDEP"; then
253 echo '#include "conftest.h"' > conftest.c
254 echo 'int i;' > conftest.h
256 am_cv_[$1]_dependencies_compiler_type=none
257 for depmode in `sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_depcomp"`; do
260 # after this tag, mechanisms are not by side-effect, so they'll
261 # only be used when explicitly requested
262 if test "x$enable_dependency_tracking" = xyes; then
270 # We check with `-c' and `-o' for the sake of the "dashmstdout"
271 # mode. It turns out that the SunPro C++ compiler does not properly
272 # handle `-M -o', and we need to detect this.
273 if depmode="$depmode" \
274 source=conftest.c object=conftest.o \
275 depfile=conftest.Po tmpdepfile=conftest.TPo \
276 $SHELL $am_depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
277 grep conftest.h conftest.Po > /dev/null 2>&1; then
278 am_cv_[$1]_dependencies_compiler_type="$depmode"
285 am_cv_[$1]_dependencies_compiler_type=none
288 AC_MSG_RESULT($am_cv_[$1]_dependencies_compiler_type)
289 [$1]DEPMODE="depmode=$am_cv_[$1]_dependencies_compiler_type"
290 AC_SUBST([$1]DEPMODE)
293 # Choose a directory name for dependency files.
294 # This macro is AC_REQUIREd in AM_DEPENDENCIES
296 AC_DEFUN([AM_SET_DEPDIR],[
297 if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
299 # We redirect because .deps might already exist and be populated.
300 # In this situation we don't want to see an error.
301 rmdir .deps > /dev/null 2>&1
308 AC_DEFUN([AM_DEP_TRACK],[
309 AC_ARG_ENABLE(dependency-tracking,
310 [ --disable-dependency-tracking Speeds up one-time builds
311 --enable-dependency-tracking Do not reject slow dependency extractors])
312 if test "x$enable_dependency_tracking" = xno; then
315 am_depcomp="$ac_aux_dir/depcomp"
316 if test ! -f "$am_depcomp"; then
323 if test -z "$AMDEP"; then
328 pushdef([subst], defn([AC_SUBST]))
329 subst(AMDEPBACKSLASH)
333 # Generate code to set up dependency tracking.
334 # This macro should only be invoked once -- use via AC_REQUIRE.
336 # AM_OUTPUT_DEPENDENCY_COMMANDS
339 # This code is only required when automatic dependency tracking
340 # is enabled. FIXME. This creates each `.P' file that we will
341 # need in order to bootstrap the dependency handling code.
342 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
344 test x"$AMDEP" != x"" ||
345 for mf in $CONFIG_FILES; do
347 Makefile) dirpart=.;;
348 */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
351 grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
352 # Extract the definition of DEP_FILES from the Makefile without
354 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
355 test -z "$DEPDIR" && continue
356 # When using ansi2knr, U may be empty or an underscore; expand it
357 U=`sed -n -e '/^U = / s///p' < "$mf"`
358 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
359 # We invoke sed twice because it is the simplest approach to
360 # changing $(DEPDIR) to its actual value in the expansion.
361 for file in `sed -n -e '
362 /^DEP_FILES = .*\\\\$/ {
371 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
372 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
373 # Make sure the directory exists.
374 test -f "$dirpart/$file" && continue
375 fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
376 $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
377 # echo "creating $dirpart/$file"
378 echo '# dummy' > "$dirpart/$file"
382 ac_aux_dir="$ac_aux_dir"])])
386 # Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
387 AC_DEFUN([AM_PROG_LEX],
388 [AC_REQUIRE([AM_MISSING_HAS_RUN])
389 AC_CHECK_PROGS(LEX, flex lex, [${am_missing_run}flex])
393 dnl $Id: krb-prog-ln-s.m4,v 1.1 1997/12/14 15:59:01 joda Exp $
396 dnl Better test for ln -s, ln or cp
399 AC_DEFUN(AC_KRB_PROG_LN_S,
400 [AC_MSG_CHECKING(for ln -s or something else)
401 AC_CACHE_VAL(ac_cv_prog_LN_S,
403 if ln -s X conftestdata 2>/dev/null
406 ac_cv_prog_LN_S="ln -s"
409 if ln conftestdata1 conftestdata2; then
416 LN_S="$ac_cv_prog_LN_S"
417 AC_MSG_RESULT($ac_cv_prog_LN_S)
422 dnl $Id: mips-abi.m4,v 1.5 2000/07/18 15:01:42 joda Exp $
425 dnl Check for MIPS/IRIX ABI flags. Sets $abi and $abilibdirext to some
428 AC_DEFUN(AC_MIPS_ABI, [
429 AC_ARG_WITH(mips_abi,
430 [ --with-mips-abi=abi ABI to use for IRIX (32, n32, or 64)])
434 with_mips_abi="${with_mips_abi:-yes}"
435 if test -n "$GCC"; then
437 # GCC < 2.8 only supports the O32 ABI. GCC >= 2.8 has a flag to select
438 # which ABI to use, but only supports (as of 2.8.1) the N32 and 64 ABIs.
440 # Default to N32, but if GCC doesn't grok -mabi=n32, we assume an old
441 # GCC and revert back to O32. The same goes if O32 is asked for - old
442 # GCCs doesn't like the -mabi option, and new GCCs can't output O32.
444 # Don't you just love *all* the different SGI ABIs?
446 case "${with_mips_abi}" in
447 32|o32) abi='-mabi=32'; abilibdirext='' ;;
448 n32|yes) abi='-mabi=n32'; abilibdirext='32' ;;
449 64) abi='-mabi=64'; abilibdirext='64' ;;
450 no) abi=''; abilibdirext='';;
451 *) AC_MSG_ERROR("Invalid ABI specified") ;;
453 if test -n "$abi" ; then
454 ac_foo=krb_cv_gcc_`echo $abi | tr =- __`
456 dnl can't use AC_CACHE_CHECK here, since it doesn't quote CACHE-ID to
459 AC_MSG_CHECKING([if $CC supports the $abi option])
460 AC_CACHE_VAL($ac_foo, [
461 save_CFLAGS="$CFLAGS"
462 CFLAGS="$CFLAGS $abi"
463 AC_TRY_COMPILE(,int x;, eval $ac_foo=yes, eval $ac_foo=no)
464 CFLAGS="$save_CFLAGS"
466 ac_res=`eval echo \\\$$ac_foo`
467 AC_MSG_RESULT($ac_res)
468 if test $ac_res = no; then
469 # Try to figure out why that failed...
472 save_CFLAGS="$CFLAGS"
473 CFLAGS="$CFLAGS -mabi=n32"
474 AC_TRY_COMPILE(,int x;, ac_res=yes, ac_res=no)
476 if test $ac_res = yes; then
478 AC_MSG_ERROR([$CC does not support the $with_mips_abi ABI])
485 if test $with_mips_abi = yes; then
486 # Old GCC, default to O32
491 AC_MSG_ERROR([$CC does not support the $with_mips_abi ABI])
495 fi #if test $ac_res = no; then
496 fi #if test -n "$abi" ; then
498 case "${with_mips_abi}" in
499 32|o32) abi='-32'; abilibdirext='' ;;
500 n32|yes) abi='-n32'; abilibdirext='32' ;;
501 64) abi='-64'; abilibdirext='64' ;;
502 no) abi=''; abilibdirext='';;
503 *) AC_MSG_ERROR("Invalid ABI specified") ;;
505 fi #if test -n "$GCC"; then
511 dnl $Id: c-attribute.m4,v 1.2 1999/03/01 09:52:23 joda Exp $
515 dnl Test for __attribute__
518 AC_DEFUN(AC_C___ATTRIBUTE__, [
519 AC_MSG_CHECKING(for __attribute__)
520 AC_CACHE_VAL(ac_cv___attribute__, [
525 static void foo(void) __attribute__ ((noreturn));
533 ac_cv___attribute__=yes,
534 ac_cv___attribute__=no)])
535 if test "$ac_cv___attribute__" = "yes"; then
536 AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
538 AC_MSG_RESULT($ac_cv___attribute__)
543 # serial 44 AC_PROG_LIBTOOL
544 AC_DEFUN(AC_PROG_LIBTOOL,[AC_REQUIRE([_AC_PROG_LIBTOOL])])
545 AC_DEFUN(_AC_PROG_LIBTOOL,
546 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
548 # Save cache, so that ltconfig can load it
551 # Actually configure libtool. ac_aux_dir is where install-sh is found.
552 AR="$AR" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
553 MAGIC="$MAGIC" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
554 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
555 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
556 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
557 deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
558 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
559 $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
560 || AC_MSG_ERROR([libtool configure failed])
562 # Reload cache, that may have been modified by ltconfig
565 # This can be used to rebuild libtool when needed
566 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
568 # Always use our own libtool.
569 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
572 # Redirect the config.log output again, so that the ltconfig log is not
573 # clobbered by the next message.
577 AC_DEFUN(AC_LIBTOOL_SETUP,
579 AC_REQUIRE([AC_ENABLE_SHARED])dnl
580 AC_REQUIRE([AC_ENABLE_STATIC])dnl
581 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
582 AC_REQUIRE([AC_CANONICAL_HOST])dnl
583 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
584 AC_REQUIRE([AC_PROG_CC])dnl
585 AC_REQUIRE([AC_PROG_LD])dnl
586 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
587 AC_REQUIRE([AC_PROG_NM])dnl
588 AC_REQUIRE([AC_PROG_LN_S])dnl
589 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
590 AC_REQUIRE([AC_OBJEXT])dnl
591 AC_REQUIRE([AC_EXEEXT])dnl
594 # Only perform the check for file, if the check method requires it
595 case "$deplibs_check_method" in
597 if test "$file_magic_cmd" = '${MAGIC}'; then
603 AC_CHECK_TOOL(RANLIB, ranlib, :)
604 AC_CHECK_TOOL(STRIP, strip, :)
606 # Check for any special flags to pass to ltconfig.
607 libtool_flags="--cache-file=$cache_file"
608 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
609 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
610 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
611 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
612 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
613 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
614 [libtool_flags="$libtool_flags --enable-dlopen"])
615 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
616 [libtool_flags="$libtool_flags --enable-win32-dll"])
617 AC_ARG_ENABLE(libtool-lock,
618 [ --disable-libtool-lock avoid locking (might break parallel builds)])
619 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
620 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
623 [ --with-pic try to use only PIC/non-PIC objects [default=use both]],
624 pic_mode="$withval", pic_mode=default)
625 test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
626 test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
628 # Some flags need to be propagated to the compiler or linker for good
632 # Find out which ABI we are using.
633 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
634 if AC_TRY_EVAL(ac_compile); then
635 case "`/usr/bin/file conftest.o`" in
651 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
652 SAVE_CFLAGS="$CFLAGS"
653 CFLAGS="$CFLAGS -belf"
654 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
657 AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
659 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
660 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
661 CFLAGS="$SAVE_CFLAGS"
665 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
666 [*-*-cygwin* | *-*-mingw*)
667 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
668 AC_CHECK_TOOL(AS, as, false)
669 AC_CHECK_TOOL(OBJDUMP, objdump, false)
671 # recent cygwin and mingw systems supply a stub DllMain which the user
672 # can override, but on older systems we have to supply one
673 AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
675 [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
677 [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
680 *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
681 # old mingw systems require "-dll" to link a DLL, while more recent ones
683 SAVE_CFLAGS="$CFLAGS"
684 CFLAGS="$CFLAGS -mdll"
685 AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
686 [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
687 CFLAGS="$SAVE_CFLAGS" ;;
689 # cygwin systems need to pass --dll to the linker, and not link
690 # crt.o which will require a WinMain@16 definition.
691 lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
698 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
699 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
701 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
702 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
704 # AC_ENABLE_SHARED - implement the --enable-shared flag
705 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
706 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
708 AC_DEFUN(AC_ENABLE_SHARED, [dnl
709 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
710 AC_ARG_ENABLE(shared,
711 changequote(<<, >>)dnl
712 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
714 [p=${PACKAGE-default}
716 yes) enable_shared=yes ;;
717 no) enable_shared=no ;;
720 # Look at the argument we got. We use all the common list separators.
721 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
722 for pkg in $enableval; do
723 if test "X$pkg" = "X$p"; then
730 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
733 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
734 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
735 AC_ENABLE_SHARED(no)])
737 # AC_ENABLE_STATIC - implement the --enable-static flag
738 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
739 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
741 AC_DEFUN(AC_ENABLE_STATIC, [dnl
742 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
743 AC_ARG_ENABLE(static,
744 changequote(<<, >>)dnl
745 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
747 [p=${PACKAGE-default}
749 yes) enable_static=yes ;;
750 no) enable_static=no ;;
753 # Look at the argument we got. We use all the common list separators.
754 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
755 for pkg in $enableval; do
756 if test "X$pkg" = "X$p"; then
763 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
766 # AC_DISABLE_STATIC - set the default static flag to --disable-static
767 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
768 AC_ENABLE_STATIC(no)])
771 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
772 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
773 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
775 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
776 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
777 AC_ARG_ENABLE(fast-install,
778 changequote(<<, >>)dnl
779 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
781 [p=${PACKAGE-default}
783 yes) enable_fast_install=yes ;;
784 no) enable_fast_install=no ;;
786 enable_fast_install=no
787 # Look at the argument we got. We use all the common list separators.
788 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
789 for pkg in $enableval; do
790 if test "X$pkg" = "X$p"; then
791 enable_fast_install=yes
797 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
800 # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
801 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
802 AC_ENABLE_FAST_INSTALL(no)])
804 # AC_LIBTOOL_PICMODE - implement the --with-pic flag
805 # Usage: AC_LIBTOOL_PICMODE[(MODE)]
806 # Where MODE is either `yes' or `no'. If omitted, it defaults to
808 AC_DEFUN(AC_LIBTOOL_PICMODE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
809 pic_mode=ifelse($#,1,$1,default)])
812 # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
813 AC_DEFUN(AC_PATH_TOOL_PREFIX,
814 [AC_MSG_CHECKING([for $1])
815 AC_CACHE_VAL(lt_cv_path_MAGIC,
818 lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
821 ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
824 ac_save_MAGIC="$MAGIC"
825 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
826 dnl $ac_dummy forces splitting on constant user-supplied paths.
827 dnl POSIX.2 word splitting is done only on the output of word expansions,
828 dnl not every word. This closes a longstanding sh security hole.
829 ac_dummy="ifelse([$2], , $PATH, [$2])"
830 for ac_dir in $ac_dummy; do
831 test -z "$ac_dir" && ac_dir=.
832 if test -f $ac_dir/$1; then
833 lt_cv_path_MAGIC="$ac_dir/$1"
834 if test -n "$file_magic_test_file"; then
835 case "$deplibs_check_method" in
837 file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
838 MAGIC="$lt_cv_path_MAGIC"
839 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
840 egrep "$file_magic_regex" > /dev/null; then
845 *** Warning: the command libtool uses to detect shared libraries,
846 *** $file_magic_cmd, produces output that libtool cannot recognize.
847 *** The result is that libtool may fail to recognize shared libraries
848 *** as such. This will affect the creation of libtool libraries that
849 *** depend on shared libraries, but programs linked with such libtool
850 *** libraries will work regardless of this problem. Nevertheless, you
851 *** may want to report the problem to your system manager and/or to
852 *** bug-libtool@gnu.org
862 MAGIC="$ac_save_MAGIC"
865 MAGIC="$lt_cv_path_MAGIC"
866 if test -n "$MAGIC"; then
867 AC_MSG_RESULT($MAGIC)
874 # AC_PATH_MAGIC - find a file program which can recognise a shared library
875 AC_DEFUN(AC_PATH_MAGIC,
876 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
877 AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
878 if test -z "$lt_cv_path_MAGIC"; then
879 if test -n "$ac_tool_prefix"; then
880 AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
888 # AC_PROG_LD - find the path to the GNU or non-GNU linker
891 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
892 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
893 AC_REQUIRE([AC_PROG_CC])dnl
894 AC_REQUIRE([AC_CANONICAL_HOST])dnl
895 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
897 if test "$ac_cv_prog_gcc" = yes; then
898 # Check if gcc -print-prog-name=ld gives a path.
899 AC_MSG_CHECKING([for ld used by GCC])
902 # gcc leaves a trailing carriage return which upsets mingw
903 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
905 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
908 # Accept absolute paths.
910 [\\/]* | [A-Za-z]:[\\/]*)
911 re_direlt='/[^/][^/]*/\.\./'
913 # Canonicalize the path of ld
914 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
915 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
916 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
918 test -z "$LD" && LD="$ac_prog"
921 # If it fails, then pretend we aren't using GCC.
925 # If it is relative, then search for the first ld in PATH.
929 elif test "$with_gnu_ld" = yes; then
930 AC_MSG_CHECKING([for GNU ld])
932 AC_MSG_CHECKING([for non-GNU ld])
934 AC_CACHE_VAL(ac_cv_path_LD,
935 [if test -z "$LD"; then
936 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
937 for ac_dir in $PATH; do
938 test -z "$ac_dir" && ac_dir=.
939 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
940 ac_cv_path_LD="$ac_dir/$ac_prog"
941 # Check to see if the program is GNU ld. I'd rather use --version,
942 # but apparently some GNU ld's only accept -v.
943 # Break only if it was the GNU/non-GNU ld that we prefer.
944 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
945 test "$with_gnu_ld" != no && break
947 test "$with_gnu_ld" != yes && break
953 ac_cv_path_LD="$LD" # Let the user override the test with a path.
956 if test -n "$LD"; then
961 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
965 AC_DEFUN(AC_PROG_LD_GNU,
966 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
967 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
968 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
969 ac_cv_prog_gnu_ld=yes
973 with_gnu_ld=$ac_cv_prog_gnu_ld
976 # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
977 # -- PORTME Some linkers may need a different reload flag.
978 AC_DEFUN(AC_PROG_LD_RELOAD_FLAG,
979 [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
980 [lt_cv_ld_reload_flag='-r'])
981 reload_flag=$lt_cv_ld_reload_flag
982 test -n "$reload_flag" && reload_flag=" $reload_flag"
985 # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
986 # -- PORTME fill in with the dynamic library characteristics
987 AC_DEFUN(AC_DEPLIBS_CHECK_METHOD,
988 [AC_CACHE_CHECK([how to recognise dependant libraries],
989 lt_cv_deplibs_check_method,
990 [lt_cv_file_magic_cmd='${MAGIC}'
991 lt_cv_file_magic_test_file=
992 lt_cv_deplibs_check_method='unknown'
993 # Need to set the preceding variable on all platforms that support
994 # interlibrary dependencies.
995 # 'none' -- dependencies not supported.
996 # `unknown' -- same as none, but documents that we really don't know.
997 # 'pass_all' -- all dependencies passed with no checks.
998 # 'test_compile' -- check by making test program.
999 # 'file_magic [regex]' -- check by looking for files in library path
1000 # which responds to the $file_magic_cmd with a given egrep regex.
1001 # If you have `file' or equivalent on your system and you're not sure
1002 # whether `pass_all' will *always* work, you probably want this one.
1006 lt_cv_deplibs_check_method=pass_all
1010 lt_cv_deplibs_check_method=pass_all
1015 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
1016 changequote([, ])dnl
1017 lt_cv_file_magic_cmd='/usr/bin/file -L'
1018 lt_cv_file_magic_test_file=/shlib/libc.so
1022 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
1023 lt_cv_file_magic_cmd='${OBJDUMP} -f'
1027 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
1031 lt_cv_deplibs_check_method=='file_magic OpenBSD/i[3-9]86 demand paged shared library'
1032 changequote([, ])dnl
1033 lt_cv_file_magic_cmd=/usr/bin/file
1034 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
1038 lt_cv_deplibs_check_method=pass_all
1043 lt_cv_deplibs_check_method=pass_all
1047 # TODO: Does this work for hpux-11 too?
1048 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
1049 lt_cv_file_magic_cmd=/usr/bin/file
1050 lt_cv_file_magic_test_file=/usr/lib/libc.sl
1056 # this will be overridden with pass_all, but let us keep it just in case
1057 lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
1061 *-32|*"-32 ") libmagic=32-bit;;
1062 *-n32|*"-n32 ") libmagic=N32;;
1063 *-64|*"-64 ") libmagic=64-bit;;
1064 *) libmagic=never-match;;
1066 # this will be overridden with pass_all, but let us keep it just in case
1068 lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
1069 changequote([, ])dnl
1072 lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
1073 lt_cv_deplibs_check_method=pass_all
1076 # This must be Linux ELF.
1079 alpha* | i*86 | powerpc* | sparc* | ia64* )
1080 lt_cv_deplibs_check_method=pass_all ;;
1082 # glibc up to 2.1.1 does not perform some relocations on ARM
1084 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
1085 changequote([, ])dnl
1087 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
1091 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then :
1094 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
1095 changequote([, ])dnl
1096 lt_cv_file_magic_cmd='/usr/bin/file -L'
1097 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
1101 osf3* | osf4* | osf5*)
1102 # this will be overridden with pass_all, but let us keep it just in case
1103 lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
1104 lt_cv_file_magic_test_file=/shlib/libc.so
1105 lt_cv_deplibs_check_method=pass_all
1109 lt_cv_deplibs_check_method=pass_all
1113 lt_cv_deplibs_check_method=pass_all
1114 lt_cv_file_magic_test_file=/lib/libc.so
1117 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1118 case "$host_vendor" in
1120 lt_cv_deplibs_check_method=pass_all
1124 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
1125 changequote([, ])dnl
1126 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
1132 file_magic_cmd=$lt_cv_file_magic_cmd
1133 deplibs_check_method=$lt_cv_deplibs_check_method
1137 # AC_PROG_NM - find the path to a BSD-compatible name lister
1138 AC_DEFUN(AC_PROG_NM,
1139 [AC_MSG_CHECKING([for BSD-compatible nm])
1140 AC_CACHE_VAL(ac_cv_path_NM,
1141 [if test -n "$NM"; then
1142 # Let the user override the test.
1145 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1146 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1147 test -z "$ac_dir" && ac_dir=.
1148 tmp_nm=$ac_dir/${ac_tool_prefix}nm
1149 if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
1150 # Check to see if the nm accepts a BSD-compat flag.
1151 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1152 # nm: unknown option "B" ignored
1153 if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1154 ac_cv_path_NM="$tmp_nm -B"
1156 elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1157 ac_cv_path_NM="$tmp_nm -p"
1160 ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but
1161 continue # so that we can try to find one that supports BSD flags
1166 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1169 AC_MSG_RESULT([$NM])
1172 # AC_CHECK_LIBM - check for math library
1173 AC_DEFUN(AC_CHECK_LIBM,
1174 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1177 *-*-beos* | *-*-cygwin*)
1178 # These system don't have libm
1181 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1182 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1185 AC_CHECK_LIB(m, main, LIBM="-lm")
1190 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1191 # the libltdl convenience library and INCLTDL to the include flags for
1192 # the libltdl header and adds --enable-ltdl-convenience to the
1193 # configure arguments. Note that LIBLTDL and INCLTDL are not
1194 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
1195 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
1196 # with '${top_builddir}/' and INCLTDL will be prefixed with
1197 # '${top_srcdir}/' (note the single quotes!). If your package is not
1198 # flat and you're not using automake, define top_builddir and
1199 # top_srcdir appropriately in the Makefiles.
1200 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1201 case "$enable_ltdl_convenience" in
1202 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1203 "") enable_ltdl_convenience=yes
1204 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1206 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
1207 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
1210 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1211 # the libltdl installable library and INCLTDL to the include flags for
1212 # the libltdl header and adds --enable-ltdl-install to the configure
1213 # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
1214 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
1215 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
1216 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
1217 # with '${top_srcdir}/' (note the single quotes!). If your package is
1218 # not flat and you're not using automake, define top_builddir and
1219 # top_srcdir appropriately in the Makefiles.
1220 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1221 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1222 AC_CHECK_LIB(ltdl, main,
1223 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1224 [if test x"$enable_ltdl_install" = xno; then
1225 AC_MSG_WARN([libltdl not installed, but installation disabled])
1227 enable_ltdl_install=yes
1230 if test x"$enable_ltdl_install" = x"yes"; then
1231 ac_configure_args="$ac_configure_args --enable-ltdl-install"
1232 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
1233 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
1235 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1242 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
1243 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
1244 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
1245 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
1246 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
1247 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
1248 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
1250 dnl This is just to silence aclocal about the macro not being used
1251 ifelse([AC_DISABLE_FAST_INSTALL])dnl
1253 dnl $Id: wflags.m4,v 1.3 1999/03/11 12:11:41 joda Exp $
1257 AC_DEFUN(AC_WFLAGS,[
1259 WFLAGS_NOIMPLICITINT=""
1260 if test -z "$WFLAGS" -a "$GCC" = "yes"; then
1261 # -Wno-implicit-int for broken X11 headers
1262 # leave these out for now:
1263 # -Wcast-align doesn't work well on alpha osf/1
1264 # -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast
1265 # -Wmissing-declarations -Wnested-externs
1266 WFLAGS="ifelse($#, 0,-Wall, $1)"
1267 WFLAGS_NOUNUSED="-Wno-unused"
1268 WFLAGS_NOIMPLICITINT="-Wno-implicit-int"
1271 AC_SUBST(WFLAGS_NOUNUSED)dnl
1272 AC_SUBST(WFLAGS_NOIMPLICITINT)dnl
1275 dnl $Id: db.m4,v 1.1 2000/07/19 11:21:07 joda Exp $
1277 dnl tests for various db libraries
1279 AC_DEFUN([rk_DB],[berkeley_db=db
1280 AC_ARG_WITH(berkeley-db,
1281 [ --without-berkeley-db if you don't want berkeley db],[
1282 if test "$withval" = no; then
1286 if test "$berkeley_db"; then
1287 AC_CHECK_HEADERS([ \
1293 AC_FIND_FUNC_NO_LIBS2(dbopen, $berkeley_db, [
1295 #if defined(HAVE_DB_185_H)
1297 #elif defined(HAVE_DB_H)
1300 ],[NULL, 0, 0, 0, NULL])
1302 AC_FIND_FUNC_NO_LIBS(dbm_firstkey, $berkeley_db gdbm ndbm)
1303 AC_FIND_FUNC_NO_LIBS(db_create, $berkeley_db)
1306 if test "$LIB_dbopen" != "$LIB_db_create"; then
1307 DBLIB="$DBLIB $LIB_db_create"
1309 if test "$LIB_dbopen" != "$LIB_dbm_firstkey"; then
1310 DBLIB="$DBLIB $LIB_dbm_firstkey"
1316 dnl $Id: find-func-no-libs2.m4,v 1.4 2000/07/15 18:10:19 joda Exp $
1319 dnl Look for function in any of the specified libraries
1322 dnl AC_FIND_FUNC_NO_LIBS2(func, libraries, includes, arguments, extra libs, extra args)
1323 AC_DEFUN(AC_FIND_FUNC_NO_LIBS2, [
1325 AC_MSG_CHECKING([for $1])
1326 AC_CACHE_VAL(ac_cv_funclib_$1,
1328 if eval "test \"\$ac_cv_func_$1\" != yes" ; then
1329 ac_save_LIBS="$LIBS"
1330 for ac_lib in $2; do
1331 if test -n "$ac_lib"; then
1336 LIBS="$6 $ac_lib $5 $ac_save_LIBS"
1337 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)
1339 eval "ac_cv_funclib_$1=\${ac_cv_funclib_$1-no}"
1340 LIBS="$ac_save_LIBS"
1344 eval "ac_res=\$ac_cv_funclib_$1"
1348 dnl AC_CHECK_LIBS($2, foo)
1351 eval "ac_tr_func=HAVE_[]upcase($1)"
1352 eval "ac_tr_lib=HAVE_LIB[]upcase($ac_res | sed -e 's/-l//')"
1353 eval "LIB_$1=$ac_res"
1357 eval "ac_cv_func_$1=yes"
1359 AC_DEFINE_UNQUOTED($ac_tr_func)
1360 AC_MSG_RESULT([yes])
1363 eval "ac_cv_func_$1=no"
1368 eval "ac_cv_func_$1=yes"
1369 eval "ac_cv_lib_`echo "$ac_res" | sed 's/-l//'`=yes"
1370 AC_DEFINE_UNQUOTED($ac_tr_func)
1371 AC_DEFINE_UNQUOTED($ac_tr_lib)
1372 AC_MSG_RESULT([yes, in $ac_res])
1378 dnl $Id: find-func-no-libs.m4,v 1.5 1999/10/30 21:08:18 assar Exp $
1381 dnl Look for function in any of the specified libraries
1384 dnl AC_FIND_FUNC_NO_LIBS(func, libraries, includes, arguments, extra libs, extra args)
1385 AC_DEFUN(AC_FIND_FUNC_NO_LIBS, [
1386 AC_FIND_FUNC_NO_LIBS2([$1], ["" $2], [$3], [$4], [$5], [$6])])
1388 dnl $Id: roken-frag.m4,v 1.21 2001/05/11 13:58:21 joda Exp $
1390 dnl some code to get roken working
1392 dnl rk_ROKEN(subdir)
1394 AC_DEFUN(rk_ROKEN, [
1396 AC_REQUIRE([rk_CONFIG_HEADER])
1399 LIB_roken='$(top_builddir)/$1/libroken.la'
1400 INCLUDES_roken='-I$(top_builddir)/$1 -I$(top_srcdir)/$1'
1402 dnl Checks for programs
1403 AC_REQUIRE([AC_PROG_CC])
1404 AC_REQUIRE([AC_PROG_AWK])
1405 AC_REQUIRE([AC_OBJEXT])
1406 AC_REQUIRE([AC_EXEEXT])
1407 AC_REQUIRE([AC_PROG_LIBTOOL])
1409 AC_REQUIRE([AC_MIPS_ABI])
1411 dnl C characteristics
1413 AC_REQUIRE([AC_C___ATTRIBUTE__])
1414 AC_REQUIRE([AC_C_INLINE])
1415 AC_REQUIRE([AC_C_CONST])
1416 AC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
1422 AC_REQUIRE([AC_TYPE_SIZE_T])
1423 AC_CHECK_TYPE_EXTRA(ssize_t, int, [#include <unistd.h>])
1424 AC_REQUIRE([AC_TYPE_PID_T])
1425 AC_REQUIRE([AC_TYPE_UID_T])
1426 AC_HAVE_TYPE([long long])
1428 AC_REQUIRE([rk_RETSIGTYPE])
1430 dnl Checks for header files.
1431 AC_REQUIRE([AC_HEADER_STDC])
1432 AC_REQUIRE([AC_HEADER_TIME])
1453 netinet/in_systm.h \
1455 netinet6/in6_var.h \
1487 AC_REQUIRE([CHECK_NETINET_IP_AND_TCP])
1489 AM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes)
1490 AM_CONDITIONAL(have_fnmatch_h, test "$ac_cv_header_fnmatch_h" = yes)
1491 AM_CONDITIONAL(have_ifaddrs_h, test "$ac_cv_header_ifaddrs_h" = yes)
1492 AM_CONDITIONAL(have_vis_h, test "$ac_cv_header_vis_h" = yes)
1494 dnl Check for functions and libraries
1498 AC_FIND_FUNC(socket, socket)
1499 AC_FIND_FUNC(gethostbyname, nsl)
1500 AC_FIND_FUNC(syslog, syslog)
1501 AC_FIND_FUNC(gethostbyname2, inet6 ip6)
1503 AC_FIND_FUNC(res_search, resolv,
1506 #ifdef HAVE_SYS_TYPES_H
1507 #include <sys/types.h>
1509 #ifdef HAVE_NETINET_IN_H
1510 #include <netinet/in.h>
1512 #ifdef HAVE_ARPA_NAMESER_H
1513 #include <arpa/nameser.h>
1515 #ifdef HAVE_RESOLV_H
1521 AC_FIND_FUNC(dn_expand, resolv,
1524 #ifdef HAVE_SYS_TYPES_H
1525 #include <sys/types.h>
1527 #ifdef HAVE_NETINET_IN_H
1528 #include <netinet/in.h>
1530 #ifdef HAVE_ARPA_NAMESER_H
1531 #include <arpa/nameser.h>
1533 #ifdef HAVE_RESOLV_H
1543 if test "$ac_cv_func_glob_working" != yes; then
1544 LIBOBJS="$LIBOBJS glob.o"
1546 AM_CONDITIONAL(have_glob_h, test "$ac_cv_func_glob_working" = yes)
1572 if test "$ac_cv_func_cgetent" = no; then
1573 LIBOBJS="$LIBOBJS getcap.o"
1576 AC_REQUIRE([AC_FUNC_GETLOGIN])
1578 AC_FIND_FUNC_NO_LIBS(getsockopt,,
1579 [#ifdef HAVE_SYS_TYPES_H
1580 #include <sys/types.h>
1582 #ifdef HAVE_SYS_SOCKET_H
1583 #include <sys/socket.h>
1586 AC_FIND_FUNC_NO_LIBS(setsockopt,,
1587 [#ifdef HAVE_SYS_TYPES_H
1588 #include <sys/types.h>
1590 #ifdef HAVE_SYS_SOCKET_H
1591 #include <sys/socket.h>
1595 AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
1596 [#ifdef HAVE_NETDB_H
1600 if test "$ac_cv_func_hstrerror" = yes; then
1608 dnl sigh, wish this could be done in a loop
1609 if test "$ac_cv_func_asprintf" = yes; then
1612 #include <string.h>],
1615 if test "$ac_cv_func_vasprintf" = yes; then
1618 #include <string.h>],
1621 if test "$ac_cv_func_asnprintf" = yes; then
1624 #include <string.h>],
1627 if test "$ac_cv_func_vasnprintf" = yes; then
1630 #include <string.h>],
1634 AC_FIND_FUNC_NO_LIBS(bswap16,,
1635 [#ifdef HAVE_SYS_BSWAP_H
1636 #include <sys/bswap.h>
1639 AC_FIND_FUNC_NO_LIBS(bswap32,,
1640 [#ifdef HAVE_SYS_BSWAP_H
1641 #include <sys/bswap.h>
1644 AC_FIND_FUNC_NO_LIBS(pidfile,util,
1717 AC_BROKEN2(inet_aton,
1718 [#ifdef HAVE_SYS_TYPES_H
1719 #include <sys/types.h>
1721 #ifdef HAVE_SYS_SOCKET_H
1722 #include <sys/socket.h>
1724 #ifdef HAVE_NETINET_IN_H
1725 #include <netinet/in.h>
1727 #ifdef HAVE_ARPA_INET_H
1728 #include <arpa/inet.h>
1732 AC_BROKEN2(inet_ntop,
1733 [#ifdef HAVE_SYS_TYPES_H
1734 #include <sys/types.h>
1736 #ifdef HAVE_SYS_SOCKET_H
1737 #include <sys/socket.h>
1739 #ifdef HAVE_NETINET_IN_H
1740 #include <netinet/in.h>
1742 #ifdef HAVE_ARPA_INET_H
1743 #include <arpa/inet.h>
1747 AC_BROKEN2(inet_pton,
1748 [#ifdef HAVE_SYS_TYPES_H
1749 #include <sys/types.h>
1751 #ifdef HAVE_SYS_SOCKET_H
1752 #include <sys/socket.h>
1754 #ifdef HAVE_NETINET_IN_H
1755 #include <netinet/in.h>
1757 #ifdef HAVE_ARPA_INET_H
1758 #include <arpa/inet.h>
1763 dnl Check for sa_len in struct sockaddr,
1764 dnl needs to come before the getnameinfo test
1766 AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
1767 #include <sys/socket.h>])
1769 if test "$ac_cv_func_getnameinfo" = "yes"; then
1770 rk_BROKEN_GETNAMEINFO
1771 if test "$ac_cv_func_getnameinfo_broken" = yes; then
1772 LIBOBJS="$LIBOBJS getnameinfo.o"
1776 AC_NEED_PROTO([#include <stdlib.h>], setenv)
1777 AC_NEED_PROTO([#include <stdlib.h>], unsetenv)
1778 AC_NEED_PROTO([#include <unistd.h>], gethostname)
1779 AC_NEED_PROTO([#include <unistd.h>], mkstemp)
1780 AC_NEED_PROTO([#include <unistd.h>], getusershell)
1783 #ifdef HAVE_SYS_TYPES_H
1784 #include <sys/types.h>
1786 #ifdef HAVE_SYS_SOCKET_H
1787 #include <sys/socket.h>
1789 #ifdef HAVE_NETINET_IN_H
1790 #include <netinet/in.h>
1792 #ifdef HAVE_ARPA_INET_H
1793 #include <arpa/inet.h>
1797 AC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl
1799 AC_REQUIRE([rk_BROKEN_REALLOC])dnl
1801 dnl AC_KRB_FUNC_GETCWD_BROKEN
1804 dnl Checks for prototypes and declarations
1808 #ifdef HAVE_SYS_TYPES_H
1809 #include <sys/types.h>
1811 #ifdef HAVE_SYS_SOCKET_H
1812 #include <sys/socket.h>
1814 #ifdef HAVE_NETINET_IN_H
1815 #include <netinet/in.h>
1817 #ifdef HAVE_ARPA_INET_H
1818 #include <arpa/inet.h>
1824 gethostbyname, struct hostent *gethostbyname(const char *))
1827 #ifdef HAVE_SYS_TYPES_H
1828 #include <sys/types.h>
1830 #ifdef HAVE_SYS_SOCKET_H
1831 #include <sys/socket.h>
1833 #ifdef HAVE_NETINET_IN_H
1834 #include <netinet/in.h>
1836 #ifdef HAVE_ARPA_INET_H
1837 #include <arpa/inet.h>
1843 gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
1846 #ifdef HAVE_SYS_TYPES_H
1847 #include <sys/types.h>
1849 #ifdef HAVE_SYS_SOCKET_H
1850 #include <sys/socket.h>
1852 #ifdef HAVE_NETINET_IN_H
1853 #include <netinet/in.h>
1855 #ifdef HAVE_ARPA_INET_H
1856 #include <arpa/inet.h>
1862 getservbyname, struct servent *getservbyname(const char *, const char *))
1865 #ifdef HAVE_SYS_TYPES_H
1866 #include <sys/types.h>
1868 #ifdef HAVE_SYS_SOCKET_H
1869 #include <sys/socket.h>
1872 getsockname, int getsockname(int, struct sockaddr*, socklen_t*))
1875 #ifdef HAVE_SYSLOG_H
1879 openlog, void openlog(const char *, int, int))
1885 #ifdef HAVE_UNISTD_H
1903 rk_CHECK_VAR(h_errno,
1904 [#ifdef HAVE_SYS_TYPES_H
1905 #include <sys/types.h>
1911 rk_CHECK_VAR(h_errlist,
1912 [#ifdef HAVE_NETDB_H
1916 rk_CHECK_VAR(h_nerr,
1917 [#ifdef HAVE_NETDB_H
1921 rk_CHECK_VAR([__progname],
1926 AC_CHECK_DECLARATION([#include <stdlib.h>
1927 #ifdef HAVE_UNISTD_H
1930 AC_CHECK_DECLARATION([#include <stdlib.h>
1931 #ifdef HAVE_UNISTD_H
1934 AC_CHECK_DECLARATION([#include <stdlib.h>
1935 #ifdef HAVE_UNISTD_H
1938 AC_CHECK_DECLARATION([#include <stdlib.h>
1939 #ifdef HAVE_UNISTD_H
1943 AC_CHECK_DECLARATION([#include <stdlib.h>], environ)
1946 dnl Check for fields in struct tm
1949 AC_HAVE_STRUCT_FIELD(struct tm, tm_gmtoff, [#include <time.h>])
1950 AC_HAVE_STRUCT_FIELD(struct tm, tm_zone, [#include <time.h>])
1953 dnl or do we have a variable `timezone' ?
1956 rk_CHECK_VAR(timezone,[#include <time.h>])
1958 AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
1959 AC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
1960 AC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
1961 AC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/socket.h>])
1962 AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
1963 AC_HAVE_TYPE([struct ifaddrs], [#include <ifaddrs.h>])
1966 dnl Check for struct winsize
1969 AC_KRB_STRUCT_WINSIZE
1972 dnl Check for struct spwd
1977 dnl won't work with automake
1978 dnl moved to AC_OUTPUT in configure.in
1979 dnl AC_CONFIG_FILES($1/Makefile)
1981 LIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
1983 AC_SUBST(DIR_roken)dnl
1984 AC_SUBST(LIB_roken)dnl
1985 AC_SUBST(INCLUDES_roken)dnl
1987 dnl $Id: check-type-extra.m4,v 1.2 1999/03/01 09:52:23 joda Exp $
1989 dnl ac_check_type + extra headers
1991 dnl AC_CHECK_TYPE_EXTRA(TYPE, DEFAULT, HEADERS)
1992 AC_DEFUN(AC_CHECK_TYPE_EXTRA,
1993 [AC_REQUIRE([AC_HEADER_STDC])dnl
1994 AC_MSG_CHECKING(for $1)
1995 AC_CACHE_VAL(ac_cv_type_$1,
1997 changequote(<<,>>)dnl
1998 <<$1[^a-zA-Z_0-9]>>dnl
1999 changequote([,]), [#include <sys/types.h>
2004 $3], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
2005 AC_MSG_RESULT($ac_cv_type_$1)
2006 if test $ac_cv_type_$1 = no; then
2007 AC_DEFINE($1, $2, [Define this to what the type $1 should be.])
2011 dnl $Id: have-type.m4,v 1.6 2000/07/15 18:10:00 joda Exp $
2013 dnl check for existance of a type
2015 dnl AC_HAVE_TYPE(TYPE,INCLUDES)
2016 AC_DEFUN(AC_HAVE_TYPE, [
2017 AC_REQUIRE([AC_HEADER_STDC])
2018 cv=`echo "$1" | sed 'y%./+- %__p__%'`
2019 AC_MSG_CHECKING(for $1)
2020 AC_CACHE_VAL([ac_cv_type_$cv],
2022 [#include <sys/types.h>
2029 eval "ac_cv_type_$cv=yes",
2030 eval "ac_cv_type_$cv=no"))dnl
2031 ac_foo=`eval echo \\$ac_cv_type_$cv`
2032 AC_MSG_RESULT($ac_foo)
2033 if test "$ac_foo" = yes; then
2034 ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'`
2038 AC_DEFINE_UNQUOTED($ac_tr_hdr, 1, [Define if you have type `$1'])
2043 dnl $Id: retsigtype.m4,v 1.1 2000/07/15 18:05:56 joda Exp $
2045 dnl Figure out return type of signal handlers, and define SIGRETURN macro
2046 dnl that can be used to return from one
2048 AC_DEFUN(rk_RETSIGTYPE,[
2050 if test "$ac_cv_type_signal" = "void" ; then
2051 AC_DEFINE(VOID_RETSIGTYPE, 1, [Define if signal handlers return void.])
2053 AC_SUBST(VOID_RETSIGTYPE)
2054 AH_BOTTOM([#ifdef VOID_RETSIGTYPE
2055 #define SIGRETURN(x) return
2057 #define SIGRETURN(x) return (RETSIGTYPE)(x)
2061 dnl $Id: check-netinet-ip-and-tcp.m4,v 1.3 2000/07/18 10:33:02 joda Exp $
2064 dnl extra magic check for netinet/{ip.h,tcp.h} because on irix 6.5.3
2065 dnl you have to include standards.h before including these files
2067 AC_DEFUN(CHECK_NETINET_IP_AND_TCP,
2069 AC_CHECK_HEADERS(standards.h)
2070 for i in netinet/ip.h netinet/tcp.h; do
2072 cv=`echo "$i" | sed 'y%./+-%__p_%'`
2074 AC_CACHE_CHECK([for $i],ac_cv_header_$cv,
2076 #ifdef HAVE_STANDARDS_H
2077 #include <standards.h>
2081 eval "ac_cv_header_$cv=yes",
2082 eval "ac_cv_header_$cv=no")])
2083 ac_res=`eval echo \\$ac_cv_header_$cv`
2084 if test "$ac_res" = yes; then
2085 ac_tr_hdr=HAVE_`echo $i | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2086 AC_DEFINE_UNQUOTED($ac_tr_hdr, 1)
2090 AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h)
2094 # Define a conditional.
2096 AC_DEFUN([AM_CONDITIONAL],
2107 dnl $Id: krb-ipv6.m4,v 1.10 2001/03/26 03:28:03 assar Exp $
2111 AC_DEFUN(AC_KRB_IPV6, [
2113 [ --without-ipv6 do not enable IPv6 support],[
2114 if test "$withval" = "no"; then
2117 save_CFLAGS="${CFLAGS}"
2118 AC_CACHE_VAL(ac_cv_lib_ipv6,
2119 [dnl check for different v6 implementations (by itojun)
2123 AC_MSG_CHECKING([ipv6 stack type])
2124 for i in v6d toshiba kame inria zeta linux; do
2128 #include </usr/local/v6/include/sys/types.h>
2132 [v6type=$i; v6lib=v6;
2133 v6libdir=/usr/local/v6/lib;
2134 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
2138 #include <sys/param.h>
2139 #ifdef _TOSHIBA_INET6
2142 [v6type=$i; v6lib=inet6;
2143 v6libdir=/usr/local/v6/lib;
2144 CFLAGS="-DINET6 $CFLAGS"])
2148 #include <netinet/in.h>
2152 [v6type=$i; v6lib=inet6;
2153 v6libdir=/usr/local/v6/lib;
2154 CFLAGS="-DINET6 $CFLAGS"])
2158 #include <netinet/in.h>
2159 #ifdef IPV6_INRIA_VERSION
2162 [v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
2166 #include <sys/param.h>
2167 #ifdef _ZETA_MINAMI_INET6
2170 [v6type=$i; v6lib=inet6;
2171 v6libdir=/usr/local/v6/lib;
2172 CFLAGS="-DINET6 $CFLAGS"])
2175 if test -d /usr/inet6; then
2179 CFLAGS="-DINET6 $CFLAGS"
2183 if test "$v6type" != "unknown"; then
2187 AC_MSG_RESULT($v6type)
2189 if test "$v6lib" != "none"; then
2190 for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
2191 if test -d $dir -a -f $dir/lib$v6lib.a; then
2192 LIBS="-L$dir -l$v6lib $LIBS"
2198 #ifdef HAVE_SYS_TYPES_H
2199 #include <sys/types.h>
2201 #ifdef HAVE_SYS_SOCKET_H
2202 #include <sys/socket.h>
2204 #ifdef HAVE_NETINET_IN_H
2205 #include <netinet/in.h>
2207 #ifdef HAVE_NETINET_IN6_H
2208 #include <netinet/in6.h>
2212 struct sockaddr_in6 sin6;
2215 s = socket(AF_INET6, SOCK_DGRAM, 0);
2217 sin6.sin6_family = AF_INET6;
2218 sin6.sin6_port = htons(17);
2219 sin6.sin6_addr = in6addr_any;
2220 bind(s, (struct sockaddr *)&sin6, sizeof(sin6));
2223 ac_cv_lib_ipv6=no)])
2224 AC_MSG_CHECKING(for IPv6)
2225 AC_MSG_RESULT($ac_cv_lib_ipv6)
2226 if test "$ac_cv_lib_ipv6" = yes; then
2227 AC_DEFINE(HAVE_IPV6, 1, [Define if you have IPv6.])
2229 CFLAGS="${save_CFLAGS}"
2233 dnl $Id: find-func.m4,v 1.1 1997/12/14 15:58:58 joda Exp $
2235 dnl AC_FIND_FUNC(func, libraries, includes, arguments)
2236 AC_DEFUN(AC_FIND_FUNC, [
2237 AC_FIND_FUNC_NO_LIBS([$1], [$2], [$3], [$4])
2238 if test -n "$LIB_$1"; then
2239 LIBS="$LIB_$1 $LIBS"
2243 dnl $Id: broken-snprintf.m4,v 1.3 1999/03/01 09:52:22 joda Exp $
2245 AC_DEFUN(AC_BROKEN_SNPRINTF, [
2246 AC_CACHE_CHECK(for working snprintf,ac_cv_func_snprintf_working,
2247 ac_cv_func_snprintf_working=yes
2256 snprintf(foo, 2, "12");
2257 return strcmp(foo, "1");
2258 }],:,ac_cv_func_snprintf_working=no,:))
2260 if test "$ac_cv_func_snprintf_working" = yes; then
2261 AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [define if you have a working snprintf])
2263 if test "$ac_cv_func_snprintf_working" = yes; then
2264 AC_NEED_PROTO([#include <stdio.h>],snprintf)
2268 AC_DEFUN(AC_BROKEN_VSNPRINTF,[
2269 AC_CACHE_CHECK(for working vsnprintf,ac_cv_func_vsnprintf_working,
2270 ac_cv_func_vsnprintf_working=yes
2276 int foo(int num, ...)
2283 vsnprintf(bar, 2, "%s", arg);
2285 return strcmp(bar, "1");
2291 return foo(0, "12");
2292 }],:,ac_cv_func_vsnprintf_working=no,:))
2294 if test "$ac_cv_func_vsnprintf_working" = yes; then
2295 AC_DEFINE_UNQUOTED(HAVE_VSNPRINTF, 1, [define if you have a working vsnprintf])
2297 if test "$ac_cv_func_vsnprintf_working" = yes; then
2298 AC_NEED_PROTO([#include <stdio.h>],vsnprintf)
2302 dnl $Id: need-proto.m4,v 1.2 1999/03/01 09:52:24 joda Exp $
2305 dnl Check if we need the prototype for a function
2308 dnl AC_NEED_PROTO(includes, function)
2310 AC_DEFUN(AC_NEED_PROTO, [
2311 if test "$ac_cv_func_$2+set" != set -o "$ac_cv_func_$2" = yes; then
2312 AC_CACHE_CHECK([if $2 needs a prototype], ac_cv_func_$2_noproto,
2313 AC_TRY_COMPILE([$1],
2314 [struct foo { int foo; } xx;
2315 extern int $2 (struct foo*);
2318 eval "ac_cv_func_$2_noproto=yes",
2319 eval "ac_cv_func_$2_noproto=no"))
2320 define([foo], [NEED_]translit($2, [a-z], [A-Z])[_PROTO])
2321 if test "$ac_cv_func_$2_noproto" = yes; then
2322 AC_DEFINE(foo, 1, [define if the system is missing a prototype for $2()])
2328 dnl $Id: broken-glob.m4,v 1.3 2001/03/26 11:40:24 assar Exp $
2330 dnl check for glob(3)
2332 AC_DEFUN(AC_BROKEN_GLOB,[
2333 AC_CACHE_CHECK(for working glob, ac_cv_func_glob_working,
2334 ac_cv_func_glob_working=yes
2337 #include <glob.h>],[
2338 glob(NULL, GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE|GLOB_LIMIT,
2340 ],:,ac_cv_func_glob_working=no,:))
2342 if test "$ac_cv_func_glob_working" = yes; then
2343 AC_DEFINE(HAVE_GLOB, 1, [define if you have a glob() that groks
2344 GLOB_BRACE, GLOB_NOCHECK, GLOB_QUOTE, GLOB_TILDE, and GLOB_LIMIT])
2346 if test "$ac_cv_func_glob_working" = yes; then
2347 AC_NEED_PROTO([#include <stdio.h>
2348 #include <glob.h>],glob)
2353 dnl $Id: krb-func-getlogin.m4,v 1.1 1999/07/13 17:45:30 assar Exp $
2355 dnl test for POSIX (broken) getlogin
2359 AC_DEFUN(AC_FUNC_GETLOGIN, [
2360 AC_CHECK_FUNCS(getlogin setlogin)
2361 if test "$ac_cv_func_getlogin" = yes; then
2362 AC_CACHE_CHECK(if getlogin is posix, ac_cv_func_getlogin_posix, [
2363 if test "$ac_cv_func_getlogin" = yes -a "$ac_cv_func_setlogin" = yes; then
2364 ac_cv_func_getlogin_posix=no
2366 ac_cv_func_getlogin_posix=yes
2369 if test "$ac_cv_func_getlogin_posix" = yes; then
2370 AC_DEFINE(POSIX_GETLOGIN, 1, [Define if getlogin has POSIX flavour (and not BSD).])
2375 dnl $Id: find-if-not-broken.m4,v 1.2 1998/03/16 22:16:27 joda Exp $
2378 dnl Mix between AC_FIND_FUNC and AC_BROKEN
2381 AC_DEFUN(AC_FIND_IF_NOT_BROKEN,
2382 [AC_FIND_FUNC([$1], [$2], [$3], [$4])
2383 if eval "test \"$ac_cv_func_$1\" != yes"; then
2384 LIBOBJS[]="$LIBOBJS $1.o"
2386 AC_SUBST(LIBOBJS)dnl
2389 dnl $Id: broken.m4,v 1.4 2000/07/15 18:06:36 joda Exp $
2392 dnl Same as AC _REPLACE_FUNCS, just define HAVE_func if found in normal
2398 AC_CHECK_FUNC($ac_func, [
2399 ac_tr_func=HAVE_[]upcase($ac_func)
2400 AC_DEFINE_UNQUOTED($ac_tr_func)],[LIBOBJS[]="$LIBOBJS ${ac_func}.o"])
2405 AC_SUBST(LIBOBJS)dnl
2408 dnl $Id: broken2.m4,v 1.1 2000/12/15 14:27:33 assar Exp $
2410 dnl AC_BROKEN but with more arguments
2412 dnl AC_BROKEN2(func, includes, arguments)
2413 AC_DEFUN(AC_BROKEN2,
2416 AC_MSG_CHECKING([for $ac_func])
2417 AC_CACHE_VAL(ac_cv_func_$ac_func,
2420 /* The GNU C library defines this for functions which it implements
2421 to always fail with ENOSYS. Some functions are actually named
2422 something starting with __ and the normal name is an alias. */
2423 #if defined (__stub_$1) || defined (__stub___$1)
2428 ], [eval "ac_cv_func_$ac_func=yes"], [eval "ac_cv_func_$ac_func=no"])])
2429 if eval "test \"\${ac_cv_func_$ac_func}\" = yes"; then
2430 ac_tr_func=HAVE_[]upcase($ac_func)
2431 AC_DEFINE_UNQUOTED($ac_tr_func)
2435 LIBOBJS[]="$LIBOBJS ${ac_func}.o"
2441 AC_SUBST(LIBOBJS)dnl
2444 dnl $Id: have-struct-field.m4,v 1.6 1999/07/29 01:44:32 assar Exp $
2446 dnl check for fields in a structure
2448 dnl AC_HAVE_STRUCT_FIELD(struct, field, headers)
2450 AC_DEFUN(AC_HAVE_STRUCT_FIELD, [
2451 define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_]))
2452 AC_CACHE_CHECK([for $2 in $1], cache_val,[
2453 AC_TRY_COMPILE([$3],[$1 x; x.$2;],
2456 if test "$cache_val" = yes; then
2457 define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_]))
2458 AC_DEFINE(foo, 1, [Define if $1 has field $2.])
2461 undefine([cache_val])
2464 dnl $Id: broken-getnameinfo.m4,v 1.2 2000/12/05 09:09:00 joda Exp $
2466 dnl test for broken AIX getnameinfo
2468 AC_DEFUN(rk_BROKEN_GETNAMEINFO,[
2469 AC_CACHE_CHECK([if getnameinfo is broken], ac_cv_func_getnameinfo_broken,
2470 AC_TRY_RUN([[#include <stdio.h>
2471 #include <sys/types.h>
2472 #include <sys/socket.h>
2473 #include <netinet/in.h>
2477 main(int argc, char **argv)
2479 struct sockaddr_in sin;
2481 memset(&sin, 0, sizeof(sin));
2482 #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
2483 sin.sin_len = sizeof(sin);
2485 sin.sin_family = AF_INET;
2486 sin.sin_addr.s_addr = 0xffffffff;
2488 return getnameinfo((struct sockaddr*)&sin, sizeof(sin), host, sizeof(host),
2491 ]], ac_cv_func_getnameinfo_broken=no, ac_cv_func_getnameinfo_broken=yes))])
2494 dnl $Id: broken-realloc.m4,v 1.1 2000/07/15 18:05:36 joda Exp $
2496 dnl Test for realloc that doesn't handle NULL as first parameter
2498 AC_DEFUN(rk_BROKEN_REALLOC, [
2499 AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
2500 ac_cv_func_realloc_broken=no
2507 return realloc(NULL, 17) == NULL;
2509 ],:, ac_cv_func_realloc_broken=yes, :)
2511 if test "$ac_cv_func_realloc_broken" = yes ; then
2512 AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.])
2514 AH_BOTTOM([#ifdef BROKEN_REALLOC
2515 #define realloc(X, Y) isoc_realloc((X), (Y))
2516 #define isoc_realloc(X, Y) ((X) ? realloc((X), (Y)) : malloc(Y))
2520 dnl $Id: proto-compat.m4,v 1.3 1999/03/01 13:03:48 joda Exp $
2523 dnl Check if the prototype of a function is compatible with another one
2526 dnl AC_PROTO_COMPAT(includes, function, prototype)
2528 AC_DEFUN(AC_PROTO_COMPAT, [
2529 AC_CACHE_CHECK([if $2 is compatible with system prototype],
2530 ac_cv_func_$2_proto_compat,
2531 AC_TRY_COMPILE([$1],
2533 eval "ac_cv_func_$2_proto_compat=yes",
2534 eval "ac_cv_func_$2_proto_compat=no"))
2535 define([foo], translit($2, [a-z], [A-Z])[_PROTO_COMPATIBLE])
2536 if test "$ac_cv_func_$2_proto_compat" = yes; then
2537 AC_DEFINE(foo, 1, [define if prototype of $2 is compatible with
2542 dnl $Id: check-var.m4,v 1.5 2000/12/15 04:54:06 assar Exp $
2544 dnl rk_CHECK_VAR(variable, includes)
2545 AC_DEFUN([rk_CHECK_VAR], [
2546 AC_MSG_CHECKING(for $1)
2547 AC_CACHE_VAL(ac_cv_var_$1, [
2548 AC_TRY_LINK([extern int $1;
2549 int foo() { return $1; }],
2551 ac_cv_var_$1=yes, ac_cv_var_$1=no)
2553 ac_foo=`eval echo \\$ac_cv_var_$1`
2554 AC_MSG_RESULT($ac_foo)
2555 if test "$ac_foo" = yes; then
2556 AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]$1), 1,
2557 [Define if you have the `]$1[' variable.])
2558 m4_ifval([$2], AC_CHECK_DECLARATION([$2],[$1]))
2562 AC_WARNING_ENABLE([obsolete])
2563 AU_DEFUN([AC_CHECK_VAR], [rk_CHECK_VAR([$2], [$1])], [foo])
2564 dnl $Id: check-declaration.m4,v 1.3 1999/03/01 13:03:08 joda Exp $
2567 dnl Check if we need the declaration of a variable
2570 dnl AC_HAVE_DECLARATION(includes, variable)
2571 AC_DEFUN(AC_CHECK_DECLARATION, [
2572 AC_MSG_CHECKING([if $2 is properly declared])
2573 AC_CACHE_VAL(ac_cv_var_$2_declaration, [
2575 extern struct { int foo; } $2;],
2577 eval "ac_cv_var_$2_declaration=no",
2578 eval "ac_cv_var_$2_declaration=yes")
2581 define(foo, [HAVE_]translit($2, [a-z], [A-Z])[_DECLARATION])
2583 AC_MSG_RESULT($ac_cv_var_$2_declaration)
2584 if eval "test \"\$ac_cv_var_$2_declaration\" = yes"; then
2585 AC_DEFINE(foo, 1, [define if your system declares $2])
2590 dnl $Id: krb-struct-winsize.m4,v 1.2 1999/03/01 09:52:23 joda Exp $
2593 dnl Search for struct winsize
2596 AC_DEFUN(AC_KRB_STRUCT_WINSIZE, [
2597 AC_MSG_CHECKING(for struct winsize)
2598 AC_CACHE_VAL(ac_cv_struct_winsize, [
2599 ac_cv_struct_winsize=no
2600 for i in sys/termios.h sys/ioctl.h; do
2603 struct[ ]*winsize,dnl
2605 $i, ac_cv_struct_winsize=yes; break)dnl
2608 if test "$ac_cv_struct_winsize" = "yes"; then
2609 AC_DEFINE(HAVE_STRUCT_WINSIZE, 1, [define if struct winsize is declared in sys/termios.h])
2611 AC_MSG_RESULT($ac_cv_struct_winsize)
2612 AC_EGREP_HEADER(ws_xpixel, termios.h,
2613 AC_DEFINE(HAVE_WS_XPIXEL, 1, [define if struct winsize has ws_xpixel]))
2614 AC_EGREP_HEADER(ws_ypixel, termios.h,
2615 AC_DEFINE(HAVE_WS_YPIXEL, 1, [define if struct winsize has ws_ypixel]))
2618 dnl $Id: krb-struct-spwd.m4,v 1.3 1999/07/13 21:04:11 assar Exp $
2620 dnl Test for `struct spwd'
2622 AC_DEFUN(AC_KRB_STRUCT_SPWD, [
2623 AC_MSG_CHECKING(for struct spwd)
2624 AC_CACHE_VAL(ac_cv_struct_spwd, [
2627 #ifdef HAVE_SHADOW_H
2631 ac_cv_struct_spwd=yes,
2632 ac_cv_struct_spwd=no)
2634 AC_MSG_RESULT($ac_cv_struct_spwd)
2636 if test "$ac_cv_struct_spwd" = "yes"; then
2637 AC_DEFINE(HAVE_STRUCT_SPWD, 1, [define if you have struct spwd])
2641 dnl $Id: test-package.m4,v 1.9 2000/12/15 04:54:24 assar Exp $
2643 dnl AC_TEST_PACKAGE_NEW(package,headers,libraries,extra libs,default locations, conditional)
2645 AC_DEFUN(AC_TEST_PACKAGE,[AC_TEST_PACKAGE_NEW($1,[#include <$2>],$4,,$5)])
2647 AC_DEFUN(AC_TEST_PACKAGE_NEW,[
2649 [ --with-$1=dir use $1 in dir])
2651 [ --with-$1-lib=dir use $1 libraries in dir],
2652 [if test "$withval" = "yes" -o "$withval" = "no"; then
2653 AC_MSG_ERROR([No argument for --with-$1-lib])
2654 elif test "X$with_$1" = "X"; then
2657 AC_ARG_WITH($1-include,
2658 [ --with-$1-include=dir use $1 headers in dir],
2659 [if test "$withval" = "yes" -o "$withval" = "no"; then
2660 AC_MSG_ERROR([No argument for --with-$1-include])
2661 elif test "X$with_$1" = "X"; then
2665 AC_MSG_CHECKING(for $1)
2671 *) if test "$with_$1_include" = ""; then
2672 with_$1_include="$with_$1/include"
2674 if test "$with_$1_lib" = ""; then
2675 with_$1_lib="$with_$1/lib$abilibdirext"
2683 header_dirs="$header_dirs $i/include"
2684 lib_dirs="$lib_dirs $i/lib$abilibdirext"
2687 case "$with_$1_include" in
2690 *) header_dirs="$with_$1_include $header_dirs";;
2692 case "$with_$1_lib" in
2695 *) lib_dirs="$with_$1_lib $lib_dirs";;
2698 save_CFLAGS="$CFLAGS"
2701 for i in $header_dirs; do
2702 CFLAGS="-I$i $save_CFLAGS"
2703 AC_TRY_COMPILE([$2],,ires=$i;break)
2705 for i in $lib_dirs; do
2706 LIBS="-L$i $3 $4 $save_LIBS"
2707 AC_TRY_LINK([$2],,lres=$i;break)
2709 CFLAGS="$save_CFLAGS"
2712 if test "$ires" -a "$lres" -a "$with_$1" != "no"; then
2713 $1_includedir="$ires"
2715 INCLUDE_$1="-I$$1_includedir"
2716 LIB_$1="-L$$1_libdir $3"
2718 AC_DEFINE_UNQUOTED($6,1,[Define if you have the $1 package.]),
2719 AC_DEFINE_UNQUOTED(upcase($1),1,[Define if you have the $1 package.]))
2721 AC_MSG_RESULT([headers $ires, libraries $lres])
2726 AC_MSG_RESULT($with_$1)
2729 dnl AM_CONDITIONAL($6, test "$with_$1" = yes)
2730 dnl AM_CONDITIONAL(upcase($1), test "$with_$1" = yes))
2731 AC_SUBST(INCLUDE_$1)
2735 dnl $Id: osfc2.m4,v 1.2 1999/03/27 17:28:16 joda Exp $
2737 dnl enable OSF C2 stuff
2739 AC_DEFUN(AC_CHECK_OSFC2,[
2740 AC_ARG_ENABLE(osfc2,
2741 [ --enable-osfc2 enable some OSF C2 support])
2743 if test "$enable_osfc2" = yes; then
2744 AC_DEFINE(HAVE_OSFC2, 1, [Define to enable basic OSF C2 support.])
2745 LIB_security=-lsecurity
2747 AC_SUBST(LIB_security)
2750 dnl $Id: check-man.m4,v 1.3 2000/11/30 01:47:17 joda Exp $
2751 dnl check how to format manual pages
2754 AC_DEFUN(rk_CHECK_MAN,
2755 [AC_PATH_PROG(NROFF, nroff)
2756 AC_PATH_PROG(GROFF, groff)
2757 AC_CACHE_CHECK(how to format man pages,ac_cv_sys_man_format,
2758 [cat > conftest.1 << END
2767 if test "$NROFF" ; then
2768 for i in "-mdoc" "-mandoc"; do
2769 if "$NROFF" $i conftest.1 2> /dev/null | \
2770 grep Jan > /dev/null 2>&1 ; then
2771 ac_cv_sys_man_format="$NROFF $i"
2776 if test "$ac_cv_sys_man_format" = "" -a "$GROFF" ; then
2777 for i in "-mdoc" "-mandoc"; do
2778 if "$GROFF" -Tascii $i conftest.1 2> /dev/null | \
2779 grep Jan > /dev/null 2>&1 ; then
2780 ac_cv_sys_man_format="$GROFF -Tascii $i"
2785 if test "$ac_cv_sys_man_format"; then
2786 ac_cv_sys_man_format="$ac_cv_sys_man_format \[$]< > \[$]@"
2789 if test "$ac_cv_sys_man_format"; then
2790 CATMAN="$ac_cv_sys_man_format"
2793 AM_CONDITIONAL(CATMAN, test "$CATMAN")
2794 AC_CACHE_CHECK(extension of pre-formatted manual pages,ac_cv_sys_catman_ext,
2795 [if grep _suffix /etc/man.conf > /dev/null 2>&1; then
2796 ac_cv_sys_catman_ext=0
2798 ac_cv_sys_catman_ext=number
2801 if test "$ac_cv_sys_catman_ext" = number; then
2802 CATMANEXT='$$section'
2809 dnl $Id: krb-bigendian.m4,v 1.6 2000/08/19 15:37:00 assar Exp $
2812 dnl check if this computer is little or big-endian
2813 dnl if we can figure it out at compile-time then don't define the cpp symbol
2814 dnl otherwise test for it and define it. also allow options for overriding
2815 dnl it when cross-compiling
2817 AC_DEFUN(KRB_C_BIGENDIAN, [
2818 AC_ARG_ENABLE(bigendian,
2819 [ --enable-bigendian the target is big endian],
2820 krb_cv_c_bigendian=yes)
2821 AC_ARG_ENABLE(littleendian,
2822 [ --enable-littleendian the target is little endian],
2823 krb_cv_c_bigendian=no)
2824 AC_CACHE_CHECK(whether byte order is known at compile time,
2825 krb_cv_c_bigendian_compile,
2827 #include <sys/types.h>
2828 #include <sys/param.h>],[
2829 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
2831 #endif], krb_cv_c_bigendian_compile=yes, krb_cv_c_bigendian_compile=no)])
2832 AC_CACHE_CHECK(whether byte ordering is bigendian, krb_cv_c_bigendian,[
2833 if test "$krb_cv_c_bigendian_compile" = "yes"; then
2835 #include <sys/types.h>
2836 #include <sys/param.h>],[
2837 #if BYTE_ORDER != BIG_ENDIAN
2839 #endif], krb_cv_c_bigendian=yes, krb_cv_c_bigendian=no)
2841 AC_TRY_RUN([main () {
2842 /* Are we little or big endian? From Harbison&Steele. */
2846 char c[sizeof (long)];
2849 exit (u.c[sizeof (long) - 1] == 1);
2850 }], krb_cv_c_bigendian=no, krb_cv_c_bigendian=yes,
2851 AC_MSG_ERROR([specify either --enable-bigendian or --enable-littleendian]))
2854 if test "$krb_cv_c_bigendian" = "yes"; then
2855 AC_DEFINE(WORDS_BIGENDIAN, 1, [define if target is big endian])dnl
2857 if test "$krb_cv_c_bigendian_compile" = "yes"; then
2858 AC_DEFINE(ENDIANESS_IN_SYS_PARAM_H, 1, [define if sys/param.h defines the endiness])dnl
2863 dnl $Id: aix.m4,v 1.5 2000/11/05 17:15:46 joda Exp $
2876 AM_CONDITIONAL(AIX, test "$aix" != no)dnl
2877 AM_CONDITIONAL(AIX4, test "$aix" = 4)
2879 AM_CONDITIONAL(AIX_DYNAMIC_AFS, test "$aix_dynamic_afs" = yes)dnl
2881 AC_FIND_FUNC_NO_LIBS(dlopen, dl)
2883 if test "$aix" != no; then
2884 if test "$aix_dynamic_afs" = yes; then
2885 if test "$ac_cv_funclib_dlopen" = yes; then
2887 elif test "$ac_cv_funclib_dlopen" != no; then
2888 AIX_EXTRA_KAFS="$ac_cv_funclib_dlopen"
2897 AM_CONDITIONAL(HAVE_DLOPEN, test "$ac_cv_funclib_dlopen" != no)dnl
2898 AC_SUBST(AIX_EXTRA_KAFS)dnl
2902 dnl $Id: krb-irix.m4,v 1.2 2000/12/13 12:48:45 assar Exp $
2905 dnl requires AC_CANONICAL_HOST
2911 AM_CONDITIONAL(IRIX, test "$irix" != no)dnl
2915 dnl See if there is any X11 present
2917 dnl $Id: check-x.m4,v 1.2 1999/11/05 04:25:23 assar Exp $
2919 AC_DEFUN(KRB_CHECK_X,[
2922 # try to figure out if we need any additional ld flags, like -R
2923 # and yes, the autoconf X test is utterly broken
2924 if test "$no_x" != yes; then
2925 AC_CACHE_CHECK(for special X linker flags,krb_cv_sys_x_libs_rpath,[
2926 ac_save_libs="$LIBS"
2927 ac_save_cflags="$CFLAGS"
2928 CFLAGS="$CFLAGS $X_CFLAGS"
2929 krb_cv_sys_x_libs_rpath=""
2930 krb_cv_sys_x_libs=""
2931 for rflag in "" "-R" "-R " "-rpath "; do
2932 if test "$rflag" = ""; then
2936 for flag in $X_LIBS; do
2939 foo="$foo $flag `echo $flag | sed \"s/-L/$rflag/\"`"
2947 LIBS="$ac_save_libs $foo $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
2949 #include <X11/Xlib.h>
2958 ], krb_cv_sys_x_libs_rpath="$rflag"; krb_cv_sys_x_libs="$foo"; break,:)
2960 LIBS="$ac_save_libs"
2961 CFLAGS="$ac_save_cflags"
2963 X_LIBS="$krb_cv_sys_x_libs"
2967 dnl $Id: check-xau.m4,v 1.3 1999/05/14 01:17:06 assar Exp $
2969 dnl check for Xau{Read,Write}Auth and XauFileName
2971 AC_DEFUN(AC_CHECK_XAU,[
2972 save_CFLAGS="$CFLAGS"
2973 CFLAGS="$X_CFLAGS $CFLAGS"
2975 dnl LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
2976 LIBS="$X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
2977 save_LDFLAGS="$LDFLAGS"
2978 LDFLAGS="$LDFLAGS $X_LIBS"
2981 AC_FIND_FUNC_NO_LIBS(XauWriteAuth, X11 Xau)
2983 LIBS="$LIB_XauWriteAuth $LIBS"
2984 AC_FIND_FUNC_NO_LIBS(XauReadAuth, X11 Xau)
2985 LIBS="$LIB_XauReadAauth $LIBS"
2986 AC_FIND_FUNC_NO_LIBS(XauFileName, X11 Xau)
2989 case "$ac_cv_funclib_XauWriteAuth" in
2992 *) if test "$ac_cv_funclib_XauReadAuth" = yes; then
2993 if test "$ac_cv_funclib_XauFileName" = yes; then
2994 LIB_XauReadAuth="$LIB_XauWriteAuth"
2996 LIB_XauReadAuth="$LIB_XauWriteAuth $LIB_XauFileName"
2999 if test "$ac_cv_funclib_XauFileName" = yes; then
3000 LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth"
3002 LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth $LIB_XauFileName"
3008 if test "$AUTOMAKE" != ""; then
3009 AM_CONDITIONAL(NEED_WRITEAUTH, test "$ac_cv_func_XauWriteAuth" != "yes")
3011 AC_SUBST(NEED_WRITEAUTH_TRUE)
3012 AC_SUBST(NEED_WRITEAUTH_FALSE)
3013 if test "$ac_cv_func_XauWriteAuth" != "yes"; then
3014 NEED_WRITEAUTH_TRUE=
3015 NEED_WRITEAUTH_FALSE='#'
3017 NEED_WRITEAUTH_TRUE='#'
3018 NEED_WRITEAUTH_FALSE=
3023 LDFLAGS=$save_LDFLAGS
3027 dnl $Id: capabilities.m4,v 1.2 1999/09/01 11:02:26 joda Exp $
3031 dnl Test SGI capabilities
3034 AC_DEFUN(KRB_CAPABILITIES,[
3036 AC_CHECK_HEADERS(capability.h sys/capability.h)
3038 AC_CHECK_FUNCS(sgi_getcapabilitybyname cap_set_proc)
3041 dnl $Id: check-getpwnam_r-posix.m4,v 1.2 1999/03/23 16:47:31 joda Exp $
3043 dnl check for getpwnam_r, and if it's posix or not
3045 AC_DEFUN(AC_CHECK_GETPWNAM_R_POSIX,[
3046 AC_FIND_FUNC_NO_LIBS(getpwnam_r,c_r)
3047 if test "$ac_cv_func_getpwnam_r" = yes; then
3048 AC_CACHE_CHECK(if getpwnam_r is posix,ac_cv_func_getpwnam_r_posix,
3050 LIBS="$LIBS $LIB_getpwnam_r"
3055 struct passwd pw, *pwd;
3056 return getpwnam_r("", &pw, NULL, 0, &pwd) < 0;
3058 ],ac_cv_func_getpwnam_r_posix=yes,ac_cv_func_getpwnam_r_posix=no,:)
3060 if test "$ac_cv_func_getpwnam_r_posix" = yes; then
3061 AC_DEFINE(POSIX_GETPWNAM_R, 1, [Define if getpwnam_r has POSIX flavour.])
3065 dnl $Id: grok-type.m4,v 1.4 1999/11/29 11:16:48 joda Exp $
3067 AC_DEFUN(AC_GROK_TYPE, [
3068 AC_CACHE_VAL(ac_cv_type_$1,
3070 #ifdef HAVE_INTTYPES_H
3071 #include <inttypes.h>
3073 #ifdef HAVE_SYS_TYPES_H
3074 #include <sys/types.h>
3076 #ifdef HAVE_SYS_BITYPES_H
3077 #include <sys/bitypes.h>
3079 #ifdef HAVE_BIND_BITYPES_H
3080 #include <bind/bitypes.h>
3082 #ifdef HAVE_NETINET_IN6_MACHTYPES_H
3083 #include <netinet/in6_machtypes.h>
3088 eval ac_cv_type_$1=yes,
3089 eval ac_cv_type_$1=no))])
3091 AC_DEFUN(AC_GROK_TYPES, [
3093 AC_MSG_CHECKING(for $i)
3095 eval ac_res=\$ac_cv_type_$i
3096 if test "$ac_res" = yes; then
3097 type=HAVE_[]upcase($i)
3098 AC_DEFINE_UNQUOTED($type)
3100 AC_MSG_RESULT($ac_res)
3104 dnl $Id: krb-readline.m4,v 1.2 2000/11/15 00:47:08 assar Exp $
3106 dnl Tests for readline functions
3111 AC_DEFUN(KRB_READLINE,[
3112 AC_FIND_FUNC_NO_LIBS(el_init, edit, [], [], [$LIB_tgetent])
3113 if test "$ac_cv_func_el_init" = yes ; then
3114 AC_CACHE_CHECK(for four argument el_init, ac_cv_func_el_init_four,[
3115 AC_TRY_COMPILE([#include <stdio.h>
3116 #include <histedit.h>],
3117 [el_init("", NULL, NULL, NULL);],
3118 ac_cv_func_el_init_four=yes,
3119 ac_cv_func_el_init_four=no)])
3120 if test "$ac_cv_func_el_init_four" = yes; then
3121 AC_DEFINE(HAVE_FOUR_VALUED_EL_INIT, 1, [Define if el_init takes four arguments.])
3128 if test "$with_readline" = yes; then
3130 elif test "$ac_cv_func_readline" = yes; then
3132 elif test "$ac_cv_func_el_init" = yes; then
3134 LIB_readline="\$(top_builddir)/lib/editline/libel_compat.la $LIB_el_init"
3136 LIB_readline='$(top_builddir)/lib/editline/libeditline.la'
3138 AM_CONDITIONAL(el_compat, test "$ac_foo" = yes)
3139 if test "$readline_libdir"; then
3140 LIB_readline="-rpath $readline_libdir $LIB_readline"
3142 LIB_readline="$LIB_readline \$(LIB_tgetent)"
3143 AC_DEFINE(HAVE_READLINE, 1,
3144 [Define if you have a readline compatible library.])dnl
3147 dnl $Id: auth-modules.m4,v 1.1 1999/03/21 13:48:00 joda Exp $
3149 dnl Figure what authentication modules should be built
3151 AC_DEFUN(AC_AUTH_MODULES,[
3152 AC_MSG_CHECKING(which authentication modules should be built)
3156 if test "$ac_cv_header_siad_h" = yes; then
3157 LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS sia"
3160 if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_shared" = yes; then
3161 LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS pam"
3166 *-*-irix[56]*) LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS afskauthlib" ;;
3170 AC_MSG_RESULT($LIB_AUTH_SUBDIRS)
3172 AC_SUBST(LIB_AUTH_SUBDIRS)dnl