]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - crypto/heimdal/aclocal.m4
import of heimdal 0.3f
[FreeBSD/FreeBSD.git] / crypto / heimdal / aclocal.m4
1 # ./aclocal.m4 generated automatically by aclocal 1.4b
2
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.
8
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
12 # PARTICULAR PURPOSE.
13
14 dnl $Id: acinclude.m4,v 1.15 1998/05/23 14:54:53 joda Exp $
15 dnl
16 dnl Only put things that for some reason can't live in the `cf'
17 dnl directory in this file.
18 dnl
19
20 dnl $xId: misc.m4,v 1.1 1997/12/14 15:59:04 joda Exp $
21 dnl
22 define(upcase,`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`)dnl
23
24 dnl $Id: misc.m4,v 1.2 2000/07/19 15:04:00 joda Exp $
25 dnl
26 AC_DEFUN([upcase],[`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`])dnl
27 AC_DEFUN([rk_CONFIG_HEADER],[AH_TOP([#ifndef RCSID
28 #define RCSID(msg) \
29 static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg }
30 #endif
31
32 #undef BINDIR 
33 #undef LIBDIR
34 #undef LIBEXECDIR
35 #undef SBINDIR
36
37 #undef HAVE_INT8_T
38 #undef HAVE_INT16_T
39 #undef HAVE_INT32_T
40 #undef HAVE_INT64_T
41 #undef HAVE_U_INT8_T
42 #undef HAVE_U_INT16_T
43 #undef HAVE_U_INT32_T
44 #undef HAVE_U_INT64_T
45
46 /* Maximum values on all known systems */
47 #define MaxHostNameLen (64+4)
48 #define MaxPathLen (1024+4)
49
50 ])])
51 # Like AC_CONFIG_HEADER, but automatically create stamp file.
52
53 # serial 3
54
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 "/".
59
60 AC_PREREQ([2.12])
61
62 AC_DEFUN([AM_CONFIG_HEADER],
63 [AC_CONFIG_HEADER([$1])
64   AC_OUTPUT_COMMANDS(
65    ifelse(patsubst([$1], [[^ ]], []),
66           [],
67           [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
68            patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),
69   [am_indx=1
70   for am_file in $1; do
71     case " $CONFIG_HEADERS " in
72     *" $am_file "*)
73       echo timestamp > `echo $am_file | sed 's%:.*%%;s%[^/]*$%%'`stamp-h$am_indx
74       ;;
75     esac
76     am_indx=\`expr \$am_indx + 1\`
77   done])
78 ])
79
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.
83
84 # serial 3
85
86 AC_PREREQ([2.13])
87
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],
96       [],
97       [define([AC_PROVIDE_IFELSE],
98               [ifdef([AC_PROVIDE_$1],
99                      [$2], [$3])])])
100
101
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])
111 fi
112
113 # Define the identity of the package.
114 PACKAGE=$1
115 AC_SUBST(PACKAGE)dnl
116 VERSION=$2
117 AC_SUBST(VERSION)dnl
118 ifelse([$3],,
119 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
120 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
121
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
133 # some platforms.
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
146 ])
147
148 #
149 # Check to make sure that the build environment is sane.
150 #
151
152 AC_DEFUN([AM_SANITY_CHECK],
153 [AC_MSG_CHECKING([whether build environment is sane])
154 # Just in case
155 sleep 1
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
161 # directory).
162 if (
163    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
164    if test "[$]*" = "X"; then
165       # -L didn't work.
166       set X `ls -t $srcdir/configure conftestfile`
167    fi
168    if test "[$]*" != "X $srcdir/configure conftestfile" \
169       && test "[$]*" != "X conftestfile $srcdir/configure"; then
170
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])
177    fi
178
179    test "[$]2" = conftestfile
180    )
181 then
182    # Ok.
183    :
184 else
185    AC_MSG_ERROR([newly created file is older than distributed files!
186 Check your system clock])
187 fi
188 rm -f conftest*
189 AC_MSG_RESULT(yes)])
190
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"}
195 AC_SUBST($1)])
196
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}//'`"
208 fi
209 AC_SUBST(install_sh)])
210
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 "
220 else
221   am_missing_run=
222   am_backtick='`'
223   AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
224 fi
225 ])
226
227 # See how the compiler implements dependency checking.
228 # Usage:
229 # AM_DEPENDENCIES(NAME)
230 # NAME is "CC", "CXX" or "OBJC".
231
232 # We try a few techniques and use that to set a single cache variable.
233
234 AC_DEFUN([AM_DEPENDENCIES],[
235 AC_REQUIRE([AM_SET_DEPDIR])
236 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])
237 ifelse([$1],CC,[
238 AC_REQUIRE([AC_PROG_CC])
239 AC_REQUIRE([AC_PROG_CPP])
240 depcc="$CC"
241 depcpp="$CPP"],[$1],CXX,[
242 AC_REQUIRE([AC_PROG_CXX])
243 AC_REQUIRE([AC_PROG_CXXCPP])
244 depcc="$CXX"
245 depcpp="$CXXCPP"],[$1],OBJC,[
246 am_cv_OBJC_dependencies_compiler_type=gcc],[
247 AC_REQUIRE([AC_PROG_][$1])
248 depcc="$[$1]"
249 depcpp=""])
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
255
256   am_cv_[$1]_dependencies_compiler_type=none
257   for depmode in `sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_depcomp"`; do
258     case "$depmode" in
259     nosideeffect)
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
263         continue
264       else
265         break
266       fi
267       ;;
268     none) break ;;
269     esac
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"
279       break
280     fi
281   done
282
283   rm -f conftest.*
284 else
285   am_cv_[$1]_dependencies_compiler_type=none
286 fi
287 ])
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)
291 ])
292
293 # Choose a directory name for dependency files.
294 # This macro is AC_REQUIREd in AM_DEPENDENCIES
295
296 AC_DEFUN([AM_SET_DEPDIR],[
297 if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
298   DEPDIR=.deps
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
302 else
303   DEPDIR=_deps
304 fi
305 AC_SUBST(DEPDIR)
306 ])
307
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
313   AMDEP="#"
314 else
315   am_depcomp="$ac_aux_dir/depcomp"
316   if test ! -f "$am_depcomp"; then
317     AMDEP="#"
318   else
319     AMDEP=
320   fi
321 fi
322 AC_SUBST(AMDEP)
323 if test -z "$AMDEP"; then
324   AMDEPBACKSLASH='\'
325 else
326   AMDEPBACKSLASH=
327 fi
328 pushdef([subst], defn([AC_SUBST]))
329 subst(AMDEPBACKSLASH)
330 popdef([subst])
331 ])
332
333 # Generate code to set up dependency tracking.
334 # This macro should only be invoked once -- use via AC_REQUIRE.
335 # Usage:
336 # AM_OUTPUT_DEPENDENCY_COMMANDS
337
338 #
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],[
343 AC_OUTPUT_COMMANDS([
344 test x"$AMDEP" != x"" ||
345 for mf in $CONFIG_FILES; do
346   case "$mf" in
347   Makefile) dirpart=.;;
348   */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
349   *) continue;;
350   esac
351   grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
352   # Extract the definition of DEP_FILES from the Makefile without
353   # running `make'.
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 = .*\\\\$/ {
363       s/^DEP_FILES = //
364       :loop
365         s/\\\\$//
366         p
367         n
368         /\\\\$/ b loop
369       p
370     }
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"
379   done
380 done
381 ], [AMDEP="$AMDEP"
382 ac_aux_dir="$ac_aux_dir"])])
383
384
385 # AM_PROG_LEX
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])
390 AC_PROG_LEX
391 AC_DECL_YYTEXT])
392
393 dnl $Id: krb-prog-ln-s.m4,v 1.1 1997/12/14 15:59:01 joda Exp $
394 dnl
395 dnl
396 dnl Better test for ln -s, ln or cp
397 dnl
398
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,
402 [rm -f conftestdata
403 if ln -s X conftestdata 2>/dev/null
404 then
405   rm -f conftestdata
406   ac_cv_prog_LN_S="ln -s"
407 else
408   touch conftestdata1
409   if ln conftestdata1 conftestdata2; then
410     rm -f conftestdata*
411     ac_cv_prog_LN_S=ln
412   else
413     ac_cv_prog_LN_S=cp
414   fi
415 fi])dnl
416 LN_S="$ac_cv_prog_LN_S"
417 AC_MSG_RESULT($ac_cv_prog_LN_S)
418 AC_SUBST(LN_S)dnl
419 ])
420
421
422 dnl $Id: mips-abi.m4,v 1.5 2000/07/18 15:01:42 joda Exp $
423 dnl
424 dnl
425 dnl Check for MIPS/IRIX ABI flags. Sets $abi and $abilibdirext to some
426 dnl value.
427
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)])
431
432 case "$host_os" in
433 irix*)
434 with_mips_abi="${with_mips_abi:-yes}"
435 if test -n "$GCC"; then
436
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.
439 #
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.
443 #
444 # Don't you just love *all* the different SGI ABIs?
445
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") ;;
452 esac
453 if test -n "$abi" ; then
454 ac_foo=krb_cv_gcc_`echo $abi | tr =- __`
455 dnl
456 dnl can't use AC_CACHE_CHECK here, since it doesn't quote CACHE-ID to
457 dnl AC_MSG_RESULT
458 dnl
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"
465 ])
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...
470 case $abi in
471         -mabi=32) 
472         save_CFLAGS="$CFLAGS"
473         CFLAGS="$CFLAGS -mabi=n32"
474         AC_TRY_COMPILE(,int x;, ac_res=yes, ac_res=no)
475         CLAGS="$save_CFLAGS"
476         if test $ac_res = yes; then
477                 # New GCC
478                 AC_MSG_ERROR([$CC does not support the $with_mips_abi ABI])
479         fi
480         # Old GCC
481         abi=''
482         abilibdirext=''
483         ;;
484         -mabi=n32|-mabi=64)
485                 if test $with_mips_abi = yes; then
486                         # Old GCC, default to O32
487                         abi=''
488                         abilibdirext=''
489                 else
490                         # Some broken GCC
491                         AC_MSG_ERROR([$CC does not support the $with_mips_abi ABI])
492                 fi
493         ;;
494 esac
495 fi #if test $ac_res = no; then
496 fi #if test -n "$abi" ; then
497 else
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") ;;
504 esac
505 fi #if test -n "$GCC"; then
506 ;;
507 esac
508 ])
509
510 dnl
511 dnl $Id: c-attribute.m4,v 1.2 1999/03/01 09:52:23 joda Exp $
512 dnl
513
514 dnl
515 dnl Test for __attribute__
516 dnl
517
518 AC_DEFUN(AC_C___ATTRIBUTE__, [
519 AC_MSG_CHECKING(for __attribute__)
520 AC_CACHE_VAL(ac_cv___attribute__, [
521 AC_TRY_COMPILE([
522 #include <stdlib.h>
523 ],
524 [
525 static void foo(void) __attribute__ ((noreturn));
526
527 static void
528 foo(void)
529 {
530   exit(1);
531 }
532 ],
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__])
537 fi
538 AC_MSG_RESULT($ac_cv___attribute__)
539 ])
540
541
542
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
547
548 # Save cache, so that ltconfig can load it
549 AC_CACHE_SAVE
550
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])
561
562 # Reload cache, that may have been modified by ltconfig
563 AC_CACHE_LOAD
564
565 # This can be used to rebuild libtool when needed
566 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
567
568 # Always use our own libtool.
569 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
570 AC_SUBST(LIBTOOL)dnl
571
572 # Redirect the config.log output again, so that the ltconfig log is not
573 # clobbered by the next message.
574 exec 5>>./config.log
575 ])
576
577 AC_DEFUN(AC_LIBTOOL_SETUP,
578 [AC_PREREQ(2.13)dnl
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
592 dnl
593
594 # Only perform the check for file, if the check method requires it
595 case "$deplibs_check_method" in
596 file_magic*)
597   if test "$file_magic_cmd" = '${MAGIC}'; then
598     AC_PATH_MAGIC
599   fi
600   ;;
601 esac
602
603 AC_CHECK_TOOL(RANLIB, ranlib, :)
604 AC_CHECK_TOOL(STRIP, strip, :)
605
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"
621
622 AC_ARG_WITH(pic,
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"
627
628 # Some flags need to be propagated to the compiler or linker for good
629 # libtool support.
630 case "$host" in
631 *-*-irix6*)
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
636     *32-bit*)
637       LD="${LD-ld} -32"
638       ;;
639     *N32*)
640       LD="${LD-ld} -n32"
641       ;;
642     *64-bit*)
643       LD="${LD-ld} -64"
644       ;;
645     esac
646   fi
647   rm -rf conftest*
648   ;;
649
650 *-*-sco3.2v5*)
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,
655     [AC_LANG_SAVE
656      AC_LANG_C
657      AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
658      AC_LANG_RESTORE])
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"
662   fi
663   ;;
664
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)
670
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,
674     [AC_TRY_LINK([],
675       [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
676       DllMain (0, 0, 0);],
677       [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
678
679   case "$host/$CC" in
680   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
681     # old mingw systems require "-dll" to link a DLL, while more recent ones
682     # require "-mdll"
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" ;;
688   *-*-cygwin*)
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" ;;
692   esac
693   ;;
694   ])
695 esac
696 ])
697
698 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
699 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
700
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])])
703
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
707 #   `yes'.
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],
713 changequote([, ])dnl
714 [p=${PACKAGE-default}
715 case "$enableval" in
716 yes) enable_shared=yes ;;
717 no) enable_shared=no ;;
718 *)
719   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
724       enable_shared=yes
725     fi
726   done
727   IFS="$ac_save_ifs"
728   ;;
729 esac],
730 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
731 ])
732
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)])
736
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
740 #   `yes'.
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],
746 changequote([, ])dnl
747 [p=${PACKAGE-default}
748 case "$enableval" in
749 yes) enable_static=yes ;;
750 no) enable_static=no ;;
751 *)
752   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
757       enable_static=yes
758     fi
759   done
760   IFS="$ac_save_ifs"
761   ;;
762 esac],
763 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
764 ])
765
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)])
769
770
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
774 #   `yes'.
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],
780 changequote([, ])dnl
781 [p=${PACKAGE-default}
782 case "$enableval" in
783 yes) enable_fast_install=yes ;;
784 no) enable_fast_install=no ;;
785 *)
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
792     fi
793   done
794   IFS="$ac_save_ifs"
795   ;;
796 esac],
797 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
798 ])
799
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)])
803
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
807 #   `both'.
808 AC_DEFUN(AC_LIBTOOL_PICMODE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
809 pic_mode=ifelse($#,1,$1,default)])
810
811
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,
816 [case "$MAGIC" in
817   /*)
818   lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
819   ;;
820   ?:/*)
821   ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
822   ;;
823   *)
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
836         "file_magic "*)
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
841             :
842           else
843             cat <<EOF 1>&2
844
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
853
854 EOF
855           fi ;;
856         esac
857       fi
858       break
859     fi
860   done
861   IFS="$ac_save_ifs"
862   MAGIC="$ac_save_MAGIC"
863   ;;
864 esac])
865 MAGIC="$lt_cv_path_MAGIC"
866 if test -n "$MAGIC"; then
867   AC_MSG_RESULT($MAGIC)
868 else
869   AC_MSG_RESULT(no)
870 fi
871 ])
872
873
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)
881   else
882     MAGIC=:
883   fi
884 fi
885 ])
886
887
888 # AC_PROG_LD - find the path to the GNU or non-GNU linker
889 AC_DEFUN(AC_PROG_LD,
890 [AC_ARG_WITH(gnu-ld,
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
896 ac_prog=ld
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])
900   case $host in
901   *-*-mingw*)
902     # gcc leaves a trailing carriage return which upsets mingw
903     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
904   *)
905     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
906   esac
907   case "$ac_prog" in
908     # Accept absolute paths.
909 changequote(,)dnl
910     [\\/]* | [A-Za-z]:[\\/]*)
911       re_direlt='/[^/][^/]*/\.\./'
912 changequote([,])dnl
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%/%"`
917       done
918       test -z "$LD" && LD="$ac_prog"
919       ;;
920   "")
921     # If it fails, then pretend we aren't using GCC.
922     ac_prog=ld
923     ;;
924   *)
925     # If it is relative, then search for the first ld in PATH.
926     with_gnu_ld=unknown
927     ;;
928   esac
929 elif test "$with_gnu_ld" = yes; then
930   AC_MSG_CHECKING([for GNU ld])
931 else
932   AC_MSG_CHECKING([for non-GNU ld])
933 fi
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
946       else
947         test "$with_gnu_ld" != yes && break
948       fi
949     fi
950   done
951   IFS="$ac_save_ifs"
952 else
953   ac_cv_path_LD="$LD" # Let the user override the test with a path.
954 fi])
955 LD="$ac_cv_path_LD"
956 if test -n "$LD"; then
957   AC_MSG_RESULT($LD)
958 else
959   AC_MSG_RESULT(no)
960 fi
961 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
962 AC_PROG_LD_GNU
963 ])
964
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
970 else
971   ac_cv_prog_gnu_ld=no
972 fi])
973 with_gnu_ld=$ac_cv_prog_gnu_ld
974 ])
975
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"
983 ])
984
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.
1003
1004 case "$host_os" in
1005 aix4*)
1006   lt_cv_deplibs_check_method=pass_all
1007   ;;
1008
1009 beos*)
1010   lt_cv_deplibs_check_method=pass_all
1011   ;;
1012
1013 bsdi4*)
1014   changequote(,)dnl
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
1019   ;;
1020
1021 cygwin* | mingw*)
1022   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
1023   lt_cv_file_magic_cmd='${OBJDUMP} -f'
1024   ;;
1025
1026 freebsd*)
1027   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
1028     case "$host_cpu" in
1029     i*86 )
1030       changequote(,)dnl
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.*`
1035       ;;
1036     esac
1037   else
1038     lt_cv_deplibs_check_method=pass_all
1039   fi
1040   ;;
1041
1042 gnu*)
1043   lt_cv_deplibs_check_method=pass_all
1044   ;;
1045
1046 hpux10.20*)
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
1051   ;;
1052
1053 irix5* | irix6*)
1054   case "$host_os" in
1055   irix5*)
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"
1058     ;;
1059   *)
1060     case "$LD" in
1061     *-32|*"-32 ") libmagic=32-bit;;
1062     *-n32|*"-n32 ") libmagic=N32;;
1063     *-64|*"-64 ") libmagic=64-bit;;
1064     *) libmagic=never-match;;
1065     esac
1066     # this will be overridden with pass_all, but let us keep it just in case
1067     changequote(,)dnl
1068     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
1069     changequote([, ])dnl
1070     ;;
1071   esac
1072   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
1073   lt_cv_deplibs_check_method=pass_all
1074   ;;
1075
1076 # This must be Linux ELF.
1077 linux-gnu*)
1078   case "$host_cpu" in
1079   alpha* | i*86 | powerpc* | sparc* | ia64* )
1080     lt_cv_deplibs_check_method=pass_all ;;
1081   *)
1082     # glibc up to 2.1.1 does not perform some relocations on ARM
1083     changequote(,)dnl
1084     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
1085     changequote([, ])dnl
1086   esac
1087   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
1088   ;;
1089
1090 netbsd*)
1091   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then :
1092   else
1093     changequote(,)dnl
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*`
1098   fi
1099   ;;
1100
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
1106   ;;
1107
1108 sco3.2v5*)
1109   lt_cv_deplibs_check_method=pass_all
1110   ;;
1111
1112 solaris*)
1113   lt_cv_deplibs_check_method=pass_all
1114   lt_cv_file_magic_test_file=/lib/libc.so
1115   ;;
1116
1117 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1118   case "$host_vendor" in
1119   ncr)
1120     lt_cv_deplibs_check_method=pass_all
1121     ;;
1122   motorola)
1123     changequote(,)dnl
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*`
1127     ;;
1128   esac
1129   ;;
1130 esac
1131 ])
1132 file_magic_cmd=$lt_cv_file_magic_cmd
1133 deplibs_check_method=$lt_cv_deplibs_check_method
1134 ])
1135
1136
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.
1143   ac_cv_path_NM="$NM"
1144 else
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"
1155         break
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"
1158         break
1159       else
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
1162       fi
1163     fi
1164   done
1165   IFS="$ac_save_ifs"
1166   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1167 fi])
1168 NM="$ac_cv_path_NM"
1169 AC_MSG_RESULT([$NM])
1170 ])
1171
1172 # AC_CHECK_LIBM - check for math library
1173 AC_DEFUN(AC_CHECK_LIBM,
1174 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1175 LIBM=
1176 case "$host" in
1177 *-*-beos* | *-*-cygwin*)
1178   # These system don't have libm
1179   ;;
1180 *-ncr-sysv4.3*)
1181   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1182   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1183   ;;
1184 *)
1185   AC_CHECK_LIB(m, main, LIBM="-lm")
1186   ;;
1187 esac
1188 ])
1189
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" ;;
1205   esac
1206   LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
1207   INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
1208 ])
1209
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])
1226    else
1227      enable_ltdl_install=yes
1228    fi
1229   ])
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'])
1234   else
1235     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1236     LIBLTDL="-lltdl"
1237     INCLTDL=
1238   fi
1239 ])
1240
1241 dnl old names
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
1249
1250 dnl This is just to silence aclocal about the macro not being used
1251 ifelse([AC_DISABLE_FAST_INSTALL])dnl
1252
1253 dnl $Id: wflags.m4,v 1.3 1999/03/11 12:11:41 joda Exp $
1254 dnl
1255 dnl set WFLAGS
1256
1257 AC_DEFUN(AC_WFLAGS,[
1258 WFLAGS_NOUNUSED=""
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"
1269 fi
1270 AC_SUBST(WFLAGS)dnl
1271 AC_SUBST(WFLAGS_NOUNUSED)dnl
1272 AC_SUBST(WFLAGS_NOIMPLICITINT)dnl
1273 ])
1274
1275 dnl $Id: db.m4,v 1.1 2000/07/19 11:21:07 joda Exp $
1276 dnl
1277 dnl tests for various db libraries
1278 dnl
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
1283         berkeley_db=""
1284 fi
1285 ])
1286 if test "$berkeley_db"; then
1287   AC_CHECK_HEADERS([                            \
1288         db.h                                    \
1289         db_185.h                                \
1290   ])
1291 fi
1292
1293 AC_FIND_FUNC_NO_LIBS2(dbopen, $berkeley_db, [
1294 #include <stdio.h>
1295 #if defined(HAVE_DB_185_H)
1296 #include <db_185.h>
1297 #elif defined(HAVE_DB_H)
1298 #include <db.h>
1299 #endif
1300 ],[NULL, 0, 0, 0, NULL])
1301
1302 AC_FIND_FUNC_NO_LIBS(dbm_firstkey, $berkeley_db gdbm ndbm)
1303 AC_FIND_FUNC_NO_LIBS(db_create, $berkeley_db)
1304
1305 DBLIB="$LIB_dbopen"
1306 if test "$LIB_dbopen" != "$LIB_db_create"; then
1307         DBLIB="$DBLIB $LIB_db_create"
1308 fi
1309 if test "$LIB_dbopen" != "$LIB_dbm_firstkey"; then
1310         DBLIB="$DBLIB $LIB_dbm_firstkey"
1311 fi
1312 AC_SUBST(DBLIB)dnl
1313
1314 ])
1315
1316 dnl $Id: find-func-no-libs2.m4,v 1.4 2000/07/15 18:10:19 joda Exp $
1317 dnl
1318 dnl
1319 dnl Look for function in any of the specified libraries
1320 dnl
1321
1322 dnl AC_FIND_FUNC_NO_LIBS2(func, libraries, includes, arguments, extra libs, extra args)
1323 AC_DEFUN(AC_FIND_FUNC_NO_LIBS2, [
1324
1325 AC_MSG_CHECKING([for $1])
1326 AC_CACHE_VAL(ac_cv_funclib_$1,
1327 [
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 
1332                         ac_lib="-l$ac_lib"
1333                 else
1334                         ac_lib=""
1335                 fi
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)
1338         done
1339         eval "ac_cv_funclib_$1=\${ac_cv_funclib_$1-no}"
1340         LIBS="$ac_save_LIBS"
1341 fi
1342 ])
1343
1344 eval "ac_res=\$ac_cv_funclib_$1"
1345
1346 if false; then
1347         AC_CHECK_FUNCS($1)
1348 dnl     AC_CHECK_LIBS($2, foo)
1349 fi
1350 # $1
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"
1354
1355 case "$ac_res" in
1356         yes)
1357         eval "ac_cv_func_$1=yes"
1358         eval "LIB_$1="
1359         AC_DEFINE_UNQUOTED($ac_tr_func)
1360         AC_MSG_RESULT([yes])
1361         ;;
1362         no)
1363         eval "ac_cv_func_$1=no"
1364         eval "LIB_$1="
1365         AC_MSG_RESULT([no])
1366         ;;
1367         *)
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])
1373         ;;
1374 esac
1375 AC_SUBST(LIB_$1)
1376 ])
1377
1378 dnl $Id: find-func-no-libs.m4,v 1.5 1999/10/30 21:08:18 assar Exp $
1379 dnl
1380 dnl
1381 dnl Look for function in any of the specified libraries
1382 dnl
1383
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])])
1387
1388 dnl $Id: roken-frag.m4,v 1.21 2001/05/11 13:58:21 joda Exp $
1389 dnl
1390 dnl some code to get roken working
1391 dnl
1392 dnl rk_ROKEN(subdir)
1393 dnl
1394 AC_DEFUN(rk_ROKEN, [
1395
1396 AC_REQUIRE([rk_CONFIG_HEADER])
1397
1398 DIR_roken=roken
1399 LIB_roken='$(top_builddir)/$1/libroken.la'
1400 INCLUDES_roken='-I$(top_builddir)/$1 -I$(top_srcdir)/$1'
1401
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])
1408
1409 AC_REQUIRE([AC_MIPS_ABI])
1410
1411 dnl C characteristics
1412
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)
1417
1418 AC_REQUIRE([rk_DB])
1419
1420 dnl C types
1421
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])
1427
1428 AC_REQUIRE([rk_RETSIGTYPE])
1429
1430 dnl Checks for header files.
1431 AC_REQUIRE([AC_HEADER_STDC])
1432 AC_REQUIRE([AC_HEADER_TIME])
1433
1434 AC_CHECK_HEADERS([\
1435         arpa/inet.h                             \
1436         arpa/nameser.h                          \
1437         config.h                                \
1438         crypt.h                                 \
1439         dbm.h                                   \
1440         db.h                                    \
1441         dirent.h                                \
1442         errno.h                                 \
1443         err.h                                   \
1444         fcntl.h                                 \
1445         gdbm/ndbm.h                             \
1446         grp.h                                   \
1447         ifaddrs.h                               \
1448         ndbm.h                                  \
1449         net/if.h                                \
1450         netdb.h                                 \
1451         netinet/in.h                            \
1452         netinet/in6.h                           \
1453         netinet/in_systm.h                      \
1454         netinet6/in6.h                          \
1455         netinet6/in6_var.h                      \
1456         paths.h                                 \
1457         pwd.h                                   \
1458         resolv.h                                \
1459         rpcsvc/dbm.h                            \
1460         rpcsvc/ypclnt.h                         \
1461         shadow.h                                \
1462         sys/bswap.h                             \
1463         sys/ioctl.h                             \
1464         sys/param.h                             \
1465         sys/proc.h                              \
1466         sys/resource.h                          \
1467         sys/socket.h                            \
1468         sys/sockio.h                            \
1469         sys/stat.h                              \
1470         sys/sysctl.h                            \
1471         sys/time.h                              \
1472         sys/tty.h                               \
1473         sys/types.h                             \
1474         sys/uio.h                               \
1475         sys/utsname.h                           \
1476         sys/wait.h                              \
1477         syslog.h                                \
1478         termios.h                               \
1479         unistd.h                                \
1480         userconf.h                              \
1481         usersec.h                               \
1482         util.h                                  \
1483         vis.h                                   \
1484         winsock.h                               \
1485 ])
1486         
1487 AC_REQUIRE([CHECK_NETINET_IP_AND_TCP])
1488
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)
1493
1494 dnl Check for functions and libraries
1495
1496 AC_KRB_IPV6
1497
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)
1502
1503 AC_FIND_FUNC(res_search, resolv,
1504 [
1505 #include <stdio.h>
1506 #ifdef HAVE_SYS_TYPES_H
1507 #include <sys/types.h>
1508 #endif
1509 #ifdef HAVE_NETINET_IN_H
1510 #include <netinet/in.h>
1511 #endif
1512 #ifdef HAVE_ARPA_NAMESER_H
1513 #include <arpa/nameser.h>
1514 #endif
1515 #ifdef HAVE_RESOLV_H
1516 #include <resolv.h>
1517 #endif
1518 ],
1519 [0,0,0,0,0])
1520
1521 AC_FIND_FUNC(dn_expand, resolv,
1522 [
1523 #include <stdio.h>
1524 #ifdef HAVE_SYS_TYPES_H
1525 #include <sys/types.h>
1526 #endif
1527 #ifdef HAVE_NETINET_IN_H
1528 #include <netinet/in.h>
1529 #endif
1530 #ifdef HAVE_ARPA_NAMESER_H
1531 #include <arpa/nameser.h>
1532 #endif
1533 #ifdef HAVE_RESOLV_H
1534 #include <resolv.h>
1535 #endif
1536 ],
1537 [0,0,0,0,0])
1538
1539 AC_BROKEN_SNPRINTF
1540 AC_BROKEN_VSNPRINTF
1541
1542 AC_BROKEN_GLOB
1543 if test "$ac_cv_func_glob_working" != yes; then
1544         LIBOBJS="$LIBOBJS glob.o"
1545 fi
1546 AM_CONDITIONAL(have_glob_h, test "$ac_cv_func_glob_working" = yes)
1547
1548
1549 AC_CHECK_FUNCS([                                \
1550         asnprintf                               \
1551         asprintf                                \
1552         cgetent                                 \
1553         getconfattr                             \
1554         getprogname                             \
1555         getrlimit                               \
1556         getspnam                                \
1557         setprogname                             \
1558         strsvis                                 \
1559         strunvis                                \
1560         strvis                                  \
1561         strvisx                                 \
1562         svis                                    \
1563         sysconf                                 \
1564         sysctl                                  \
1565         uname                                   \
1566         unvis                                   \
1567         vasnprintf                              \
1568         vasprintf                               \
1569         vis                                     \
1570 ])
1571
1572 if test "$ac_cv_func_cgetent" = no; then
1573         LIBOBJS="$LIBOBJS getcap.o"
1574 fi
1575
1576 AC_REQUIRE([AC_FUNC_GETLOGIN])
1577
1578 AC_FIND_FUNC_NO_LIBS(getsockopt,,
1579 [#ifdef HAVE_SYS_TYPES_H
1580 #include <sys/types.h>
1581 #endif
1582 #ifdef HAVE_SYS_SOCKET_H
1583 #include <sys/socket.h>
1584 #endif],
1585 [0,0,0,0,0])
1586 AC_FIND_FUNC_NO_LIBS(setsockopt,,
1587 [#ifdef HAVE_SYS_TYPES_H
1588 #include <sys/types.h>
1589 #endif
1590 #ifdef HAVE_SYS_SOCKET_H
1591 #include <sys/socket.h>
1592 #endif],
1593 [0,0,0,0,0])
1594
1595 AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
1596 [#ifdef HAVE_NETDB_H
1597 #include <netdb.h>
1598 #endif],
1599 17)
1600 if test "$ac_cv_func_hstrerror" = yes; then
1601 AC_NEED_PROTO([
1602 #ifdef HAVE_NETDB_H
1603 #include <netdb.h>
1604 #endif],
1605 hstrerror)
1606 fi
1607
1608 dnl sigh, wish this could be done in a loop
1609 if test "$ac_cv_func_asprintf" = yes; then
1610 AC_NEED_PROTO([
1611 #include <stdio.h>
1612 #include <string.h>],
1613 asprintf)dnl
1614 fi
1615 if test "$ac_cv_func_vasprintf" = yes; then
1616 AC_NEED_PROTO([
1617 #include <stdio.h>
1618 #include <string.h>],
1619 vasprintf)dnl
1620 fi
1621 if test "$ac_cv_func_asnprintf" = yes; then
1622 AC_NEED_PROTO([
1623 #include <stdio.h>
1624 #include <string.h>],
1625 asnprintf)dnl
1626 fi
1627 if test "$ac_cv_func_vasnprintf" = yes; then
1628 AC_NEED_PROTO([
1629 #include <stdio.h>
1630 #include <string.h>],
1631 vasnprintf)dnl
1632 fi
1633
1634 AC_FIND_FUNC_NO_LIBS(bswap16,,
1635 [#ifdef HAVE_SYS_BSWAP_H
1636 #include <sys/bswap.h>
1637 #endif],0)
1638
1639 AC_FIND_FUNC_NO_LIBS(bswap32,,
1640 [#ifdef HAVE_SYS_BSWAP_H
1641 #include <sys/bswap.h>
1642 #endif],0)
1643
1644 AC_FIND_FUNC_NO_LIBS(pidfile,util,
1645 [#ifdef HAVE_UTIL_H
1646 #include <util.h>
1647 #endif],0)
1648
1649 AC_BROKEN([                                     \
1650         chown                                   \
1651         copyhostent                             \
1652         daemon                                  \
1653         err                                     \
1654         errx                                    \
1655         fchown                                  \
1656         flock                                   \
1657         fnmatch                                 \
1658         freeaddrinfo                            \
1659         freehostent                             \
1660         gai_strerror                            \
1661         getaddrinfo                             \
1662         getcwd                                  \
1663         getdtablesize                           \
1664         getegid                                 \
1665         geteuid                                 \
1666         getgid                                  \
1667         gethostname                             \
1668         getifaddrs                              \
1669         getipnodebyaddr                         \
1670         getipnodebyname                         \
1671         getnameinfo                             \
1672         getopt                                  \
1673         gettimeofday                            \
1674         getuid                                  \
1675         getusershell                            \
1676         initgroups                              \
1677         innetgr                                 \
1678         iruserok                                \
1679         lstat                                   \
1680         memmove                                 \
1681         mkstemp                                 \
1682         putenv                                  \
1683         rcmd                                    \
1684         readv                                   \
1685         recvmsg                                 \
1686         sendmsg                                 \
1687         setegid                                 \
1688         setenv                                  \
1689         seteuid                                 \
1690         strcasecmp                              \
1691         strdup                                  \
1692         strerror                                \
1693         strftime                                \
1694         strlcat                                 \
1695         strlcpy                                 \
1696         strlwr                                  \
1697         strncasecmp                             \
1698         strndup                                 \
1699         strnlen                                 \
1700         strptime                                \
1701         strsep                                  \
1702         strsep_copy                             \
1703         strtok_r                                \
1704         strupr                                  \
1705         swab                                    \
1706         unsetenv                                \
1707         verr                                    \
1708         verrx                                   \
1709         vsyslog                                 \
1710         vwarn                                   \
1711         vwarnx                                  \
1712         warn                                    \
1713         warnx                                   \
1714         writev                                  \
1715 ])
1716
1717 AC_BROKEN2(inet_aton,
1718 [#ifdef HAVE_SYS_TYPES_H
1719 #include <sys/types.h>
1720 #endif
1721 #ifdef HAVE_SYS_SOCKET_H
1722 #include <sys/socket.h>
1723 #endif
1724 #ifdef HAVE_NETINET_IN_H
1725 #include <netinet/in.h>
1726 #endif
1727 #ifdef HAVE_ARPA_INET_H
1728 #include <arpa/inet.h>
1729 #endif],
1730 [0,0])
1731
1732 AC_BROKEN2(inet_ntop,
1733 [#ifdef HAVE_SYS_TYPES_H
1734 #include <sys/types.h>
1735 #endif
1736 #ifdef HAVE_SYS_SOCKET_H
1737 #include <sys/socket.h>
1738 #endif
1739 #ifdef HAVE_NETINET_IN_H
1740 #include <netinet/in.h>
1741 #endif
1742 #ifdef HAVE_ARPA_INET_H
1743 #include <arpa/inet.h>
1744 #endif],
1745 [0, 0, 0, 0])
1746
1747 AC_BROKEN2(inet_pton,
1748 [#ifdef HAVE_SYS_TYPES_H
1749 #include <sys/types.h>
1750 #endif
1751 #ifdef HAVE_SYS_SOCKET_H
1752 #include <sys/socket.h>
1753 #endif
1754 #ifdef HAVE_NETINET_IN_H
1755 #include <netinet/in.h>
1756 #endif
1757 #ifdef HAVE_ARPA_INET_H
1758 #include <arpa/inet.h>
1759 #endif],
1760 [0,0,0])
1761
1762 dnl
1763 dnl Check for sa_len in struct sockaddr, 
1764 dnl needs to come before the getnameinfo test
1765 dnl
1766 AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
1767 #include <sys/socket.h>])
1768
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"
1773   fi
1774 fi
1775
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)
1781
1782 AC_NEED_PROTO([
1783 #ifdef HAVE_SYS_TYPES_H
1784 #include <sys/types.h>
1785 #endif
1786 #ifdef HAVE_SYS_SOCKET_H
1787 #include <sys/socket.h>
1788 #endif
1789 #ifdef HAVE_NETINET_IN_H
1790 #include <netinet/in.h>
1791 #endif
1792 #ifdef HAVE_ARPA_INET_H
1793 #include <arpa/inet.h>
1794 #endif],
1795 inet_aton)
1796
1797 AC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl
1798
1799 AC_REQUIRE([rk_BROKEN_REALLOC])dnl
1800
1801 dnl AC_KRB_FUNC_GETCWD_BROKEN
1802
1803 dnl
1804 dnl Checks for prototypes and declarations
1805 dnl
1806
1807 AC_PROTO_COMPAT([
1808 #ifdef HAVE_SYS_TYPES_H
1809 #include <sys/types.h>
1810 #endif
1811 #ifdef HAVE_SYS_SOCKET_H
1812 #include <sys/socket.h>
1813 #endif
1814 #ifdef HAVE_NETINET_IN_H
1815 #include <netinet/in.h>
1816 #endif
1817 #ifdef HAVE_ARPA_INET_H
1818 #include <arpa/inet.h>
1819 #endif
1820 #ifdef HAVE_NETDB_H
1821 #include <netdb.h>
1822 #endif
1823 ],
1824 gethostbyname, struct hostent *gethostbyname(const char *))
1825
1826 AC_PROTO_COMPAT([
1827 #ifdef HAVE_SYS_TYPES_H
1828 #include <sys/types.h>
1829 #endif
1830 #ifdef HAVE_SYS_SOCKET_H
1831 #include <sys/socket.h>
1832 #endif
1833 #ifdef HAVE_NETINET_IN_H
1834 #include <netinet/in.h>
1835 #endif
1836 #ifdef HAVE_ARPA_INET_H
1837 #include <arpa/inet.h>
1838 #endif
1839 #ifdef HAVE_NETDB_H
1840 #include <netdb.h>
1841 #endif
1842 ],
1843 gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
1844
1845 AC_PROTO_COMPAT([
1846 #ifdef HAVE_SYS_TYPES_H
1847 #include <sys/types.h>
1848 #endif
1849 #ifdef HAVE_SYS_SOCKET_H
1850 #include <sys/socket.h>
1851 #endif
1852 #ifdef HAVE_NETINET_IN_H
1853 #include <netinet/in.h>
1854 #endif
1855 #ifdef HAVE_ARPA_INET_H
1856 #include <arpa/inet.h>
1857 #endif
1858 #ifdef HAVE_NETDB_H
1859 #include <netdb.h>
1860 #endif
1861 ],
1862 getservbyname, struct servent *getservbyname(const char *, const char *))
1863
1864 AC_PROTO_COMPAT([
1865 #ifdef HAVE_SYS_TYPES_H
1866 #include <sys/types.h>
1867 #endif
1868 #ifdef HAVE_SYS_SOCKET_H
1869 #include <sys/socket.h>
1870 #endif
1871 ],
1872 getsockname, int getsockname(int, struct sockaddr*, socklen_t*))
1873
1874 AC_PROTO_COMPAT([
1875 #ifdef HAVE_SYSLOG_H
1876 #include <syslog.h>
1877 #endif
1878 ],
1879 openlog, void openlog(const char *, int, int))
1880
1881 AC_NEED_PROTO([
1882 #ifdef HAVE_CRYPT_H
1883 #include <crypt.h>
1884 #endif
1885 #ifdef HAVE_UNISTD_H
1886 #include <unistd.h>
1887 #endif
1888 ],
1889 crypt)
1890
1891 AC_NEED_PROTO([
1892 #include <string.h>
1893 ],
1894 strtok_r)
1895
1896 AC_NEED_PROTO([
1897 #include <string.h>
1898 ],
1899 strsep)
1900
1901 dnl variables
1902
1903 rk_CHECK_VAR(h_errno, 
1904 [#ifdef HAVE_SYS_TYPES_H
1905 #include <sys/types.h>
1906 #endif
1907 #ifdef HAVE_NETDB_H
1908 #include <netdb.h>
1909 #endif])
1910
1911 rk_CHECK_VAR(h_errlist, 
1912 [#ifdef HAVE_NETDB_H
1913 #include <netdb.h>
1914 #endif])
1915
1916 rk_CHECK_VAR(h_nerr, 
1917 [#ifdef HAVE_NETDB_H
1918 #include <netdb.h>
1919 #endif])
1920
1921 rk_CHECK_VAR([__progname], 
1922 [#ifdef HAVE_ERR_H
1923 #include <err.h>
1924 #endif])
1925
1926 AC_CHECK_DECLARATION([#include <stdlib.h>
1927 #ifdef HAVE_UNISTD_H
1928 #include <unistd.h>
1929 #endif], optarg)
1930 AC_CHECK_DECLARATION([#include <stdlib.h>
1931 #ifdef HAVE_UNISTD_H
1932 #include <unistd.h>
1933 #endif], optind)
1934 AC_CHECK_DECLARATION([#include <stdlib.h>
1935 #ifdef HAVE_UNISTD_H
1936 #include <unistd.h>
1937 #endif], opterr)
1938 AC_CHECK_DECLARATION([#include <stdlib.h>
1939 #ifdef HAVE_UNISTD_H
1940 #include <unistd.h>
1941 #endif], optopt)
1942
1943 AC_CHECK_DECLARATION([#include <stdlib.h>], environ)
1944
1945 dnl
1946 dnl Check for fields in struct tm
1947 dnl
1948
1949 AC_HAVE_STRUCT_FIELD(struct tm, tm_gmtoff, [#include <time.h>])
1950 AC_HAVE_STRUCT_FIELD(struct tm, tm_zone, [#include <time.h>])
1951
1952 dnl
1953 dnl or do we have a variable `timezone' ?
1954 dnl
1955
1956 rk_CHECK_VAR(timezone,[#include <time.h>])
1957
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>])
1964
1965 dnl
1966 dnl Check for struct winsize
1967 dnl
1968
1969 AC_KRB_STRUCT_WINSIZE
1970
1971 dnl
1972 dnl Check for struct spwd
1973 dnl
1974
1975 AC_KRB_STRUCT_SPWD
1976
1977 dnl won't work with automake
1978 dnl moved to AC_OUTPUT in configure.in
1979 dnl AC_CONFIG_FILES($1/Makefile)
1980
1981 LIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
1982
1983 AC_SUBST(DIR_roken)dnl
1984 AC_SUBST(LIB_roken)dnl
1985 AC_SUBST(INCLUDES_roken)dnl
1986 ])
1987 dnl $Id: check-type-extra.m4,v 1.2 1999/03/01 09:52:23 joda Exp $
1988 dnl
1989 dnl ac_check_type + extra headers
1990
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,
1996 [AC_EGREP_CPP(dnl
1997 changequote(<<,>>)dnl
1998 <<$1[^a-zA-Z_0-9]>>dnl
1999 changequote([,]), [#include <sys/types.h>
2000 #if STDC_HEADERS
2001 #include <stdlib.h>
2002 #include <stddef.h>
2003 #endif
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.])
2008 fi
2009 ])
2010
2011 dnl $Id: have-type.m4,v 1.6 2000/07/15 18:10:00 joda Exp $
2012 dnl
2013 dnl check for existance of a type
2014
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],
2021 AC_TRY_COMPILE(
2022 [#include <sys/types.h>
2023 #if STDC_HEADERS
2024 #include <stdlib.h>
2025 #include <stddef.h>
2026 #endif
2027 $2],
2028 [$1 foo;],
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____%'`
2035 if false; then
2036         AC_CHECK_TYPES($1)
2037 fi
2038   AC_DEFINE_UNQUOTED($ac_tr_hdr, 1, [Define if you have type `$1'])
2039 fi
2040 ])
2041
2042 dnl
2043 dnl $Id: retsigtype.m4,v 1.1 2000/07/15 18:05:56 joda Exp $
2044 dnl
2045 dnl Figure out return type of signal handlers, and define SIGRETURN macro
2046 dnl that can be used to return from one
2047 dnl
2048 AC_DEFUN(rk_RETSIGTYPE,[
2049 AC_TYPE_SIGNAL
2050 if test "$ac_cv_type_signal" = "void" ; then
2051         AC_DEFINE(VOID_RETSIGTYPE, 1, [Define if signal handlers return void.])
2052 fi
2053 AC_SUBST(VOID_RETSIGTYPE)
2054 AH_BOTTOM([#ifdef VOID_RETSIGTYPE
2055 #define SIGRETURN(x) return
2056 #else
2057 #define SIGRETURN(x) return (RETSIGTYPE)(x)
2058 #endif])
2059 ])
2060 dnl
2061 dnl $Id: check-netinet-ip-and-tcp.m4,v 1.3 2000/07/18 10:33:02 joda Exp $
2062 dnl
2063
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
2066
2067 AC_DEFUN(CHECK_NETINET_IP_AND_TCP,
2068 [
2069 AC_CHECK_HEADERS(standards.h)
2070 for i in netinet/ip.h netinet/tcp.h; do
2071
2072 cv=`echo "$i" | sed 'y%./+-%__p_%'`
2073
2074 AC_CACHE_CHECK([for $i],ac_cv_header_$cv,
2075 [AC_TRY_CPP([\
2076 #ifdef HAVE_STANDARDS_H
2077 #include <standards.h>
2078 #endif
2079 #include <$i>
2080 ],
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)
2087 fi
2088 done
2089 if false;then
2090         AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h)
2091 fi
2092 ])
2093
2094 # Define a conditional.
2095
2096 AC_DEFUN([AM_CONDITIONAL],
2097 [AC_SUBST($1_TRUE)
2098 AC_SUBST($1_FALSE)
2099 if $2; then
2100   $1_TRUE=
2101   $1_FALSE='#'
2102 else
2103   $1_TRUE='#'
2104   $1_FALSE=
2105 fi])
2106
2107 dnl $Id: krb-ipv6.m4,v 1.10 2001/03/26 03:28:03 assar Exp $
2108 dnl
2109 dnl test for IPv6
2110 dnl
2111 AC_DEFUN(AC_KRB_IPV6, [
2112 AC_ARG_WITH(ipv6,
2113 [  --without-ipv6       do not enable IPv6 support],[
2114 if test "$withval" = "no"; then
2115         ac_cv_lib_ipv6=no
2116 fi])
2117 save_CFLAGS="${CFLAGS}"
2118 AC_CACHE_VAL(ac_cv_lib_ipv6,
2119 [dnl check for different v6 implementations (by itojun)
2120 v6type=unknown
2121 v6lib=none
2122
2123 AC_MSG_CHECKING([ipv6 stack type])
2124 for i in v6d toshiba kame inria zeta linux; do
2125         case $i in
2126         v6d)
2127                 AC_EGREP_CPP(yes, [
2128 #include </usr/local/v6/include/sys/types.h>
2129 #ifdef __V6D__
2130 yes
2131 #endif],
2132                         [v6type=$i; v6lib=v6;
2133                         v6libdir=/usr/local/v6/lib;
2134                         CFLAGS="-I/usr/local/v6/include $CFLAGS"])
2135                 ;;
2136         toshiba)
2137                 AC_EGREP_CPP(yes, [
2138 #include <sys/param.h>
2139 #ifdef _TOSHIBA_INET6
2140 yes
2141 #endif],
2142                         [v6type=$i; v6lib=inet6;
2143                         v6libdir=/usr/local/v6/lib;
2144                         CFLAGS="-DINET6 $CFLAGS"])
2145                 ;;
2146         kame)
2147                 AC_EGREP_CPP(yes, [
2148 #include <netinet/in.h>
2149 #ifdef __KAME__
2150 yes
2151 #endif],
2152                         [v6type=$i; v6lib=inet6;
2153                         v6libdir=/usr/local/v6/lib;
2154                         CFLAGS="-DINET6 $CFLAGS"])
2155                 ;;
2156         inria)
2157                 AC_EGREP_CPP(yes, [
2158 #include <netinet/in.h>
2159 #ifdef IPV6_INRIA_VERSION
2160 yes
2161 #endif],
2162                         [v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
2163                 ;;
2164         zeta)
2165                 AC_EGREP_CPP(yes, [
2166 #include <sys/param.h>
2167 #ifdef _ZETA_MINAMI_INET6
2168 yes
2169 #endif],
2170                         [v6type=$i; v6lib=inet6;
2171                         v6libdir=/usr/local/v6/lib;
2172                         CFLAGS="-DINET6 $CFLAGS"])
2173                 ;;
2174         linux)
2175                 if test -d /usr/inet6; then
2176                         v6type=$i
2177                         v6lib=inet6
2178                         v6libdir=/usr/inet6
2179                         CFLAGS="-DINET6 $CFLAGS"
2180                 fi
2181                 ;;
2182         esac
2183         if test "$v6type" != "unknown"; then
2184                 break
2185         fi
2186 done
2187 AC_MSG_RESULT($v6type)
2188
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"
2193                         break
2194                 fi
2195         done
2196 fi
2197 AC_TRY_LINK([
2198 #ifdef HAVE_SYS_TYPES_H
2199 #include <sys/types.h>
2200 #endif
2201 #ifdef HAVE_SYS_SOCKET_H
2202 #include <sys/socket.h>
2203 #endif
2204 #ifdef HAVE_NETINET_IN_H
2205 #include <netinet/in.h>
2206 #endif
2207 #ifdef HAVE_NETINET_IN6_H
2208 #include <netinet/in6.h>
2209 #endif
2210 ],
2211 [
2212  struct sockaddr_in6 sin6;
2213  int s;
2214
2215  s = socket(AF_INET6, SOCK_DGRAM, 0);
2216
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));
2221 ],
2222 ac_cv_lib_ipv6=yes,
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.])
2228 else
2229   CFLAGS="${save_CFLAGS}"
2230 fi
2231 ])
2232
2233 dnl $Id: find-func.m4,v 1.1 1997/12/14 15:58:58 joda Exp $
2234 dnl
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"
2240 fi
2241 ])
2242
2243 dnl $Id: broken-snprintf.m4,v 1.3 1999/03/01 09:52:22 joda Exp $
2244 dnl
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
2248 AC_TRY_RUN([
2249 #include <stdio.h>
2250 #include <string.h>
2251 int main()
2252 {
2253 changequote(`,')dnl
2254         char foo[3];
2255 changequote([,])dnl
2256         snprintf(foo, 2, "12");
2257         return strcmp(foo, "1");
2258 }],:,ac_cv_func_snprintf_working=no,:))
2259
2260 if test "$ac_cv_func_snprintf_working" = yes; then
2261         AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [define if you have a working snprintf])
2262 fi
2263 if test "$ac_cv_func_snprintf_working" = yes; then
2264 AC_NEED_PROTO([#include <stdio.h>],snprintf)
2265 fi
2266 ])
2267
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
2271 AC_TRY_RUN([
2272 #include <stdio.h>
2273 #include <string.h>
2274 #include <stdarg.h>
2275
2276 int foo(int num, ...)
2277 {
2278 changequote(`,')dnl
2279         char bar[3];
2280 changequote([,])dnl
2281         va_list arg;
2282         va_start(arg, num);
2283         vsnprintf(bar, 2, "%s", arg);
2284         va_end(arg);
2285         return strcmp(bar, "1");
2286 }
2287
2288
2289 int main()
2290 {
2291         return foo(0, "12");
2292 }],:,ac_cv_func_vsnprintf_working=no,:))
2293
2294 if test "$ac_cv_func_vsnprintf_working" = yes; then
2295         AC_DEFINE_UNQUOTED(HAVE_VSNPRINTF, 1, [define if you have a working vsnprintf])
2296 fi
2297 if test "$ac_cv_func_vsnprintf_working" = yes; then
2298 AC_NEED_PROTO([#include <stdio.h>],vsnprintf)
2299 fi
2300 ])
2301
2302 dnl $Id: need-proto.m4,v 1.2 1999/03/01 09:52:24 joda Exp $
2303 dnl
2304 dnl
2305 dnl Check if we need the prototype for a function
2306 dnl
2307
2308 dnl AC_NEED_PROTO(includes, function)
2309
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*);
2316 $2(&xx);
2317 ],
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()])
2323 fi
2324 undefine([foo])
2325 fi
2326 ])
2327
2328 dnl $Id: broken-glob.m4,v 1.3 2001/03/26 11:40:24 assar Exp $
2329 dnl
2330 dnl check for glob(3)
2331 dnl
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
2335 AC_TRY_LINK([
2336 #include <stdio.h>
2337 #include <glob.h>],[
2338 glob(NULL, GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE|GLOB_LIMIT,
2339 NULL, NULL);
2340 ],:,ac_cv_func_glob_working=no,:))
2341
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])
2345 fi
2346 if test "$ac_cv_func_glob_working" = yes; then
2347 AC_NEED_PROTO([#include <stdio.h>
2348 #include <glob.h>],glob)
2349 fi
2350 ])
2351
2352 dnl
2353 dnl $Id: krb-func-getlogin.m4,v 1.1 1999/07/13 17:45:30 assar Exp $
2354 dnl
2355 dnl test for POSIX (broken) getlogin
2356 dnl
2357
2358
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
2365 else
2366         ac_cv_func_getlogin_posix=yes
2367 fi
2368 ])
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).])
2371 fi
2372 fi
2373 ])
2374
2375 dnl $Id: find-if-not-broken.m4,v 1.2 1998/03/16 22:16:27 joda Exp $
2376 dnl
2377 dnl
2378 dnl Mix between AC_FIND_FUNC and AC_BROKEN
2379 dnl
2380
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"
2385 fi
2386 AC_SUBST(LIBOBJS)dnl
2387 ])
2388
2389 dnl $Id: broken.m4,v 1.4 2000/07/15 18:06:36 joda Exp $
2390 dnl
2391 dnl
2392 dnl Same as AC _REPLACE_FUNCS, just define HAVE_func if found in normal
2393 dnl libraries 
2394
2395 AC_DEFUN(AC_BROKEN,
2396 [for ac_func in $1
2397 do
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"])
2401 if false; then
2402         AC_CHECK_FUNCS($1)
2403 fi
2404 done
2405 AC_SUBST(LIBOBJS)dnl
2406 ])
2407
2408 dnl $Id: broken2.m4,v 1.1 2000/12/15 14:27:33 assar Exp $
2409 dnl
2410 dnl AC_BROKEN but with more arguments
2411
2412 dnl AC_BROKEN2(func, includes, arguments)
2413 AC_DEFUN(AC_BROKEN2,
2414 [for ac_func in $1
2415 do
2416 AC_MSG_CHECKING([for $ac_func])
2417 AC_CACHE_VAL(ac_cv_func_$ac_func,
2418 [AC_TRY_LINK([$2],
2419 [
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)
2424 choke me
2425 #else
2426 $ac_func($3)
2427 #endif
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)
2432   AC_MSG_RESULT(yes)
2433 else
2434   AC_MSG_RESULT(no)
2435   LIBOBJS[]="$LIBOBJS ${ac_func}.o"
2436 fi
2437 done
2438 if false; then
2439         AC_CHECK_FUNCS($1)
2440 fi
2441 AC_SUBST(LIBOBJS)dnl
2442 ])
2443
2444 dnl $Id: have-struct-field.m4,v 1.6 1999/07/29 01:44:32 assar Exp $
2445 dnl
2446 dnl check for fields in a structure
2447 dnl
2448 dnl AC_HAVE_STRUCT_FIELD(struct, field, headers)
2449
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;],
2454 cache_val=yes,
2455 cache_val=no)])
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.])
2459         undefine([foo])
2460 fi
2461 undefine([cache_val])
2462 ])
2463
2464 dnl $Id: broken-getnameinfo.m4,v 1.2 2000/12/05 09:09:00 joda Exp $
2465 dnl
2466 dnl test for broken AIX getnameinfo
2467
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>
2474 #include <netdb.h>
2475
2476 int
2477 main(int argc, char **argv)
2478 {
2479   struct sockaddr_in sin;
2480   char host[256];
2481   memset(&sin, 0, sizeof(sin));
2482 #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
2483   sin.sin_len = sizeof(sin);
2484 #endif
2485   sin.sin_family = AF_INET;
2486   sin.sin_addr.s_addr = 0xffffffff;
2487   sin.sin_port = 0;
2488   return getnameinfo((struct sockaddr*)&sin, sizeof(sin), host, sizeof(host),
2489               NULL, 0, 0);
2490 }
2491 ]], ac_cv_func_getnameinfo_broken=no, ac_cv_func_getnameinfo_broken=yes))])
2492
2493 dnl
2494 dnl $Id: broken-realloc.m4,v 1.1 2000/07/15 18:05:36 joda Exp $
2495 dnl
2496 dnl Test for realloc that doesn't handle NULL as first parameter
2497 dnl
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
2501 AC_TRY_RUN([
2502 #include <stddef.h>
2503 #include <stdlib.h>
2504
2505 int main()
2506 {
2507         return realloc(NULL, 17) == NULL;
2508 }
2509 ],:, ac_cv_func_realloc_broken=yes, :)
2510 ])
2511 if test "$ac_cv_func_realloc_broken" = yes ; then
2512         AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.])
2513 fi
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))
2517 #endif])
2518 ])
2519
2520 dnl $Id: proto-compat.m4,v 1.3 1999/03/01 13:03:48 joda Exp $
2521 dnl
2522 dnl
2523 dnl Check if the prototype of a function is compatible with another one
2524 dnl
2525
2526 dnl AC_PROTO_COMPAT(includes, function, prototype)
2527
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],
2532 [$3;],
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
2538         $3])
2539 fi
2540 undefine([foo])
2541 ])
2542 dnl $Id: check-var.m4,v 1.5 2000/12/15 04:54:06 assar Exp $
2543 dnl
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; }],
2550             [foo()],
2551             ac_cv_var_$1=yes, ac_cv_var_$1=no)
2552 ])
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]))
2559 fi
2560 ])
2561
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 $
2565 dnl
2566 dnl
2567 dnl Check if we need the declaration of a variable
2568 dnl
2569
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, [
2574 AC_TRY_COMPILE([$1
2575 extern struct { int foo; } $2;],
2576 [$2.foo = 1;],
2577 eval "ac_cv_var_$2_declaration=no",
2578 eval "ac_cv_var_$2_declaration=yes")
2579 ])
2580
2581 define(foo, [HAVE_]translit($2, [a-z], [A-Z])[_DECLARATION])
2582
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])
2586 fi
2587 undefine([foo])
2588 ])
2589
2590 dnl $Id: krb-struct-winsize.m4,v 1.2 1999/03/01 09:52:23 joda Exp $
2591 dnl
2592 dnl
2593 dnl Search for struct winsize
2594 dnl
2595
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
2601 AC_EGREP_HEADER(
2602 changequote(, )dnl
2603 struct[         ]*winsize,dnl
2604 changequote([,])dnl
2605 $i, ac_cv_struct_winsize=yes; break)dnl
2606 done
2607 ])
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])
2610 fi
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]))
2616 ])
2617
2618 dnl $Id: krb-struct-spwd.m4,v 1.3 1999/07/13 21:04:11 assar Exp $
2619 dnl
2620 dnl Test for `struct spwd'
2621
2622 AC_DEFUN(AC_KRB_STRUCT_SPWD, [
2623 AC_MSG_CHECKING(for struct spwd)
2624 AC_CACHE_VAL(ac_cv_struct_spwd, [
2625 AC_TRY_COMPILE(
2626 [#include <pwd.h>
2627 #ifdef HAVE_SHADOW_H
2628 #include <shadow.h>
2629 #endif],
2630 [struct spwd foo;],
2631 ac_cv_struct_spwd=yes,
2632 ac_cv_struct_spwd=no)
2633 ])
2634 AC_MSG_RESULT($ac_cv_struct_spwd)
2635
2636 if test "$ac_cv_struct_spwd" = "yes"; then
2637   AC_DEFINE(HAVE_STRUCT_SPWD, 1, [define if you have struct spwd])
2638 fi
2639 ])
2640
2641 dnl $Id: test-package.m4,v 1.9 2000/12/15 04:54:24 assar Exp $
2642 dnl
2643 dnl AC_TEST_PACKAGE_NEW(package,headers,libraries,extra libs,default locations, conditional)
2644
2645 AC_DEFUN(AC_TEST_PACKAGE,[AC_TEST_PACKAGE_NEW($1,[#include <$2>],$4,,$5)])
2646
2647 AC_DEFUN(AC_TEST_PACKAGE_NEW,[
2648 AC_ARG_WITH($1,
2649 [  --with-$1=dir                use $1 in dir])
2650 AC_ARG_WITH($1-lib,
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
2655   with_$1=yes
2656 fi])
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
2662   with_$1=yes
2663 fi])
2664
2665 AC_MSG_CHECKING(for $1)
2666
2667 case "$with_$1" in
2668 yes)    ;;
2669 no)     ;;
2670 "")     ;;
2671 *)      if test "$with_$1_include" = ""; then
2672                 with_$1_include="$with_$1/include"
2673         fi
2674         if test "$with_$1_lib" = ""; then
2675                 with_$1_lib="$with_$1/lib$abilibdirext"
2676         fi
2677         ;;
2678 esac
2679 header_dirs=
2680 lib_dirs=
2681 d='$5'
2682 for i in $d; do
2683         header_dirs="$header_dirs $i/include"
2684         lib_dirs="$lib_dirs $i/lib$abilibdirext"
2685 done
2686
2687 case "$with_$1_include" in
2688 yes) ;;
2689 no)  ;;
2690 *)   header_dirs="$with_$1_include $header_dirs";;
2691 esac
2692 case "$with_$1_lib" in
2693 yes) ;;
2694 no)  ;;
2695 *)   lib_dirs="$with_$1_lib $lib_dirs";;
2696 esac
2697
2698 save_CFLAGS="$CFLAGS"
2699 save_LIBS="$LIBS"
2700 ires= lres=
2701 for i in $header_dirs; do
2702         CFLAGS="-I$i $save_CFLAGS"
2703         AC_TRY_COMPILE([$2],,ires=$i;break)
2704 done
2705 for i in $lib_dirs; do
2706         LIBS="-L$i $3 $4 $save_LIBS"
2707         AC_TRY_LINK([$2],,lres=$i;break)
2708 done
2709 CFLAGS="$save_CFLAGS"
2710 LIBS="$save_LIBS"
2711
2712 if test "$ires" -a "$lres" -a "$with_$1" != "no"; then
2713         $1_includedir="$ires"
2714         $1_libdir="$lres"
2715         INCLUDE_$1="-I$$1_includedir"
2716         LIB_$1="-L$$1_libdir $3"
2717         m4_ifval([$6],
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.]))
2720         with_$1=yes
2721         AC_MSG_RESULT([headers $ires, libraries $lres])
2722 else
2723         INCLUDE_$1=
2724         LIB_$1=
2725         with_$1=no
2726         AC_MSG_RESULT($with_$1)
2727 fi
2728 dnl m4_ifval([$6],
2729 dnl     AM_CONDITIONAL($6, test "$with_$1" = yes)
2730 dnl     AM_CONDITIONAL(upcase($1), test "$with_$1" = yes))
2731 AC_SUBST(INCLUDE_$1)
2732 AC_SUBST(LIB_$1)
2733 ])
2734
2735 dnl $Id: osfc2.m4,v 1.2 1999/03/27 17:28:16 joda Exp $
2736 dnl
2737 dnl enable OSF C2 stuff
2738
2739 AC_DEFUN(AC_CHECK_OSFC2,[
2740 AC_ARG_ENABLE(osfc2,
2741 [  --enable-osfc2          enable some OSF C2 support])
2742 LIB_security=
2743 if test "$enable_osfc2" = yes; then
2744         AC_DEFINE(HAVE_OSFC2, 1, [Define to enable basic OSF C2 support.])
2745         LIB_security=-lsecurity
2746 fi
2747 AC_SUBST(LIB_security)
2748 ])
2749
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
2752 dnl
2753
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
2759 .Dd January 1, 1970
2760 .Dt CONFTEST 1
2761 .Sh NAME
2762 .Nm conftest
2763 .Nd
2764 foobar
2765 END
2766
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"
2772                         break
2773                 fi
2774         done
2775 fi
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"
2781                         break
2782                 fi
2783         done
2784 fi
2785 if test "$ac_cv_sys_man_format"; then
2786         ac_cv_sys_man_format="$ac_cv_sys_man_format \[$]< > \[$]@"
2787 fi
2788 ])
2789 if test "$ac_cv_sys_man_format"; then
2790         CATMAN="$ac_cv_sys_man_format"
2791         AC_SUBST(CATMAN)
2792 fi
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
2797 else
2798         ac_cv_sys_catman_ext=number
2799 fi
2800 ])
2801 if test "$ac_cv_sys_catman_ext" = number; then
2802         CATMANEXT='$$section'
2803 else
2804         CATMANEXT=0
2805 fi
2806 AC_SUBST(CATMANEXT)
2807 ])
2808 dnl
2809 dnl $Id: krb-bigendian.m4,v 1.6 2000/08/19 15:37:00 assar Exp $
2810 dnl
2811
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
2816
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,
2826 [AC_TRY_COMPILE([
2827 #include <sys/types.h>
2828 #include <sys/param.h>],[
2829 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
2830  bogus endian macros
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
2834     AC_TRY_COMPILE([
2835 #include <sys/types.h>
2836 #include <sys/param.h>],[
2837 #if BYTE_ORDER != BIG_ENDIAN
2838   not big endian
2839 #endif], krb_cv_c_bigendian=yes, krb_cv_c_bigendian=no)
2840   else
2841     AC_TRY_RUN([main () {
2842       /* Are we little or big endian?  From Harbison&Steele.  */
2843       union
2844       {
2845         long l;
2846         char c[sizeof (long)];
2847     } u;
2848     u.l = 1;
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]))
2852   fi
2853 ])
2854 if test "$krb_cv_c_bigendian" = "yes"; then
2855   AC_DEFINE(WORDS_BIGENDIAN, 1, [define if target is big endian])dnl
2856 fi
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
2859 fi
2860 ])
2861
2862 dnl
2863 dnl $Id: aix.m4,v 1.5 2000/11/05 17:15:46 joda Exp $
2864 dnl
2865
2866 AC_DEFUN(KRB_AIX,[
2867 aix=no
2868 case "$host" in 
2869 *-*-aix3*)
2870         aix=3
2871         ;;
2872 *-*-aix4*)
2873         aix=4
2874         ;;
2875 esac
2876 AM_CONDITIONAL(AIX, test "$aix" != no)dnl
2877 AM_CONDITIONAL(AIX4, test "$aix" = 4)
2878 aix_dynamic_afs=yes
2879 AM_CONDITIONAL(AIX_DYNAMIC_AFS, test "$aix_dynamic_afs" = yes)dnl
2880
2881 AC_FIND_FUNC_NO_LIBS(dlopen, dl)
2882
2883 if test "$aix" != no; then
2884         if test "$aix_dynamic_afs" = yes; then
2885                 if test "$ac_cv_funclib_dlopen" = yes; then
2886                         AIX_EXTRA_KAFS=
2887                 elif test "$ac_cv_funclib_dlopen" != no; then
2888                         AIX_EXTRA_KAFS="$ac_cv_funclib_dlopen"
2889                 else
2890                         AIX_EXTRA_KAFS=-lld
2891                 fi
2892         else
2893                 AIX_EXTRA_KAFS=
2894         fi
2895 fi
2896
2897 AM_CONDITIONAL(HAVE_DLOPEN, test "$ac_cv_funclib_dlopen" != no)dnl
2898 AC_SUBST(AIX_EXTRA_KAFS)dnl
2899
2900 ])
2901 dnl
2902 dnl $Id: krb-irix.m4,v 1.2 2000/12/13 12:48:45 assar Exp $
2903 dnl
2904
2905 dnl requires AC_CANONICAL_HOST
2906 AC_DEFUN(KRB_IRIX,[
2907 irix=no
2908 case "$host_os" in
2909 irix*) irix=yes ;;
2910 esac
2911 AM_CONDITIONAL(IRIX, test "$irix" != no)dnl
2912 ])
2913
2914 dnl 
2915 dnl See if there is any X11 present
2916 dnl
2917 dnl $Id: check-x.m4,v 1.2 1999/11/05 04:25:23 assar Exp $
2918
2919 AC_DEFUN(KRB_CHECK_X,[
2920 AC_PATH_XTRA
2921
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
2933                         foo="$X_LIBS"
2934                 else
2935                         foo=""
2936                         for flag in $X_LIBS; do
2937                         case $flag in
2938                         -L*)
2939                                 foo="$foo $flag `echo $flag | sed \"s/-L/$rflag/\"`"
2940                                 ;;
2941                         *)
2942                                 foo="$foo $flag"
2943                                 ;;
2944                         esac
2945                         done
2946                 fi
2947                 LIBS="$ac_save_libs $foo $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
2948                 AC_TRY_RUN([
2949                 #include <X11/Xlib.h>
2950                 foo()
2951                 {
2952                 XOpenDisplay(NULL);
2953                 }
2954                 main()
2955                 {
2956                 return 0;
2957                 }
2958                 ], krb_cv_sys_x_libs_rpath="$rflag"; krb_cv_sys_x_libs="$foo"; break,:)
2959         done
2960         LIBS="$ac_save_libs"
2961         CFLAGS="$ac_save_cflags"
2962         ])
2963         X_LIBS="$krb_cv_sys_x_libs"
2964 fi
2965 ])
2966
2967 dnl $Id: check-xau.m4,v 1.3 1999/05/14 01:17:06 assar Exp $
2968 dnl
2969 dnl check for Xau{Read,Write}Auth and XauFileName
2970 dnl
2971 AC_DEFUN(AC_CHECK_XAU,[
2972 save_CFLAGS="$CFLAGS"
2973 CFLAGS="$X_CFLAGS $CFLAGS"
2974 save_LIBS="$LIBS"
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"
2979
2980
2981 AC_FIND_FUNC_NO_LIBS(XauWriteAuth, X11 Xau)
2982 ac_xxx="$LIBS"
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)
2987 LIBS="$ac_xxx"
2988
2989 case "$ac_cv_funclib_XauWriteAuth" in
2990 yes)    ;;
2991 no)     ;;
2992 *)      if test "$ac_cv_funclib_XauReadAuth" = yes; then
2993                 if test "$ac_cv_funclib_XauFileName" = yes; then
2994                         LIB_XauReadAuth="$LIB_XauWriteAuth"
2995                 else
2996                         LIB_XauReadAuth="$LIB_XauWriteAuth $LIB_XauFileName"
2997                 fi
2998         else
2999                 if test "$ac_cv_funclib_XauFileName" = yes; then
3000                         LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth"
3001                 else
3002                         LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth $LIB_XauFileName"
3003                 fi
3004         fi
3005         ;;
3006 esac
3007
3008 if test "$AUTOMAKE" != ""; then
3009         AM_CONDITIONAL(NEED_WRITEAUTH, test "$ac_cv_func_XauWriteAuth" != "yes")
3010 else
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='#'
3016         else
3017                 NEED_WRITEAUTH_TRUE='#'
3018                 NEED_WRITEAUTH_FALSE=
3019         fi
3020 fi
3021 CFLAGS=$save_CFLAGS
3022 LIBS=$save_LIBS
3023 LDFLAGS=$save_LDFLAGS
3024 ])
3025
3026 dnl
3027 dnl $Id: capabilities.m4,v 1.2 1999/09/01 11:02:26 joda Exp $
3028 dnl
3029
3030 dnl
3031 dnl Test SGI capabilities
3032 dnl
3033
3034 AC_DEFUN(KRB_CAPABILITIES,[
3035
3036 AC_CHECK_HEADERS(capability.h sys/capability.h)
3037
3038 AC_CHECK_FUNCS(sgi_getcapabilitybyname cap_set_proc)
3039 ])
3040
3041 dnl $Id: check-getpwnam_r-posix.m4,v 1.2 1999/03/23 16:47:31 joda Exp $
3042 dnl
3043 dnl check for getpwnam_r, and if it's posix or not
3044
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,
3049         ac_libs="$LIBS"
3050         LIBS="$LIBS $LIB_getpwnam_r"
3051         AC_TRY_RUN([
3052 #include <pwd.h>
3053 int main()
3054 {
3055         struct passwd pw, *pwd;
3056         return getpwnam_r("", &pw, NULL, 0, &pwd) < 0;
3057 }
3058 ],ac_cv_func_getpwnam_r_posix=yes,ac_cv_func_getpwnam_r_posix=no,:)
3059 LIBS="$ac_libs")
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.])
3062 fi
3063 fi
3064 ])
3065 dnl $Id: grok-type.m4,v 1.4 1999/11/29 11:16:48 joda Exp $
3066 dnl
3067 AC_DEFUN(AC_GROK_TYPE, [
3068 AC_CACHE_VAL(ac_cv_type_$1, 
3069 AC_TRY_COMPILE([
3070 #ifdef HAVE_INTTYPES_H
3071 #include <inttypes.h>
3072 #endif
3073 #ifdef HAVE_SYS_TYPES_H
3074 #include <sys/types.h>
3075 #endif
3076 #ifdef HAVE_SYS_BITYPES_H
3077 #include <sys/bitypes.h>
3078 #endif
3079 #ifdef HAVE_BIND_BITYPES_H
3080 #include <bind/bitypes.h>
3081 #endif
3082 #ifdef HAVE_NETINET_IN6_MACHTYPES_H
3083 #include <netinet/in6_machtypes.h>
3084 #endif
3085 ],
3086 $i x;
3087 ,
3088 eval ac_cv_type_$1=yes,
3089 eval ac_cv_type_$1=no))])
3090
3091 AC_DEFUN(AC_GROK_TYPES, [
3092 for i in $1; do
3093         AC_MSG_CHECKING(for $i)
3094         AC_GROK_TYPE($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)
3099         fi
3100         AC_MSG_RESULT($ac_res)
3101 done
3102 ])
3103
3104 dnl $Id: krb-readline.m4,v 1.2 2000/11/15 00:47:08 assar Exp $
3105 dnl
3106 dnl Tests for readline functions
3107 dnl
3108
3109 dnl el_init
3110
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.])
3122         fi
3123 fi
3124
3125 dnl readline
3126
3127 ac_foo=no
3128 if test "$with_readline" = yes; then
3129         :
3130 elif test "$ac_cv_func_readline" = yes; then
3131         :
3132 elif test "$ac_cv_func_el_init" = yes; then
3133         ac_foo=yes
3134         LIB_readline="\$(top_builddir)/lib/editline/libel_compat.la $LIB_el_init"
3135 else
3136         LIB_readline='$(top_builddir)/lib/editline/libeditline.la'
3137 fi
3138 AM_CONDITIONAL(el_compat, test "$ac_foo" = yes)
3139 if test "$readline_libdir"; then
3140         LIB_readline="-rpath $readline_libdir $LIB_readline"
3141 fi
3142 LIB_readline="$LIB_readline \$(LIB_tgetent)"
3143 AC_DEFINE(HAVE_READLINE, 1, 
3144         [Define if you have a readline compatible library.])dnl
3145
3146 ])
3147 dnl $Id: auth-modules.m4,v 1.1 1999/03/21 13:48:00 joda Exp $
3148 dnl
3149 dnl Figure what authentication modules should be built
3150
3151 AC_DEFUN(AC_AUTH_MODULES,[
3152 AC_MSG_CHECKING(which authentication modules should be built)
3153
3154 LIB_AUTH_SUBDIRS=
3155
3156 if test "$ac_cv_header_siad_h" = yes; then
3157         LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS sia"
3158 fi
3159
3160 if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_shared" = yes; then
3161         LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS pam"
3162 fi
3163
3164 case "${host}" in
3165 changequote(,)dnl
3166 *-*-irix[56]*) LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS afskauthlib" ;;
3167 changequote([,])dnl
3168 esac
3169
3170 AC_MSG_RESULT($LIB_AUTH_SUBDIRS)
3171
3172 AC_SUBST(LIB_AUTH_SUBDIRS)dnl
3173 ])
3174