aclocal.m4 revision 90926
185815Sobrien# ./aclocal.m4 generated automatically by aclocal 1.5
285815Sobrien
385815Sobrien# Copyright 1996, 1997, 1998, 1999, 2000, 2001
485815Sobrien# Free Software Foundation, Inc.
585815Sobrien# This file is free software; the Free Software Foundation
685815Sobrien# gives unlimited permission to copy and/or distribute it,
785815Sobrien# with or without modifications, as long as this notice is preserved.
885815Sobrien
985815Sobrien# This program is distributed in the hope that it will be useful,
1085815Sobrien# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1185815Sobrien# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1285815Sobrien# PARTICULAR PURPOSE.
1385815Sobrien
1485815Sobriendnl $Id: acinclude.m4,v 1.15 1998/05/23 14:54:53 joda Exp $
1585815Sobriendnl
1685815Sobriendnl Only put things that for some reason can't live in the `cf'
1785815Sobriendnl directory in this file.
1885815Sobriendnl
1985815Sobrien
2085815Sobriendnl $xId: misc.m4,v 1.1 1997/12/14 15:59:04 joda Exp $
2185815Sobriendnl
2285815Sobriendefine(upcase,`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`)dnl
2385815Sobrien
2485815Sobriendnl $Id: misc.m4,v 1.2 2000/07/19 15:04:00 joda Exp $
2585815Sobriendnl
2685815SobrienAC_DEFUN([upcase],[`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`])dnl
2785815SobrienAC_DEFUN([rk_CONFIG_HEADER],[AH_TOP([#ifndef RCSID
2885815Sobrien#define RCSID(msg) \
2985815Sobrienstatic /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg }
3085815Sobrien#endif
3185815Sobrien
3285815Sobrien#undef BINDIR 
3385815Sobrien#undef LIBDIR
3485815Sobrien#undef LIBEXECDIR
3585815Sobrien#undef SBINDIR
3685815Sobrien
3785815Sobrien#undef HAVE_INT8_T
3885815Sobrien#undef HAVE_INT16_T
3985815Sobrien#undef HAVE_INT32_T
4085815Sobrien#undef HAVE_INT64_T
4185815Sobrien#undef HAVE_U_INT8_T
4285815Sobrien#undef HAVE_U_INT16_T
4385815Sobrien#undef HAVE_U_INT32_T
4485815Sobrien#undef HAVE_U_INT64_T
4585815Sobrien
4685815Sobrien/* Maximum values on all known systems */
4785815Sobrien#define MaxHostNameLen (64+4)
4885815Sobrien#define MaxPathLen (1024+4)
4985815Sobrien
5085815Sobrien])])
5185815Sobrien# Like AC_CONFIG_HEADER, but automatically create stamp file.
5285815Sobrien
5385815Sobrien# serial 3
5485815Sobrien
5585815Sobrien# When config.status generates a header, we must update the stamp-h file.
5685815Sobrien# This file resides in the same directory as the config header
5785815Sobrien# that is generated.  We must strip everything past the first ":",
5885815Sobrien# and everything past the last "/".
5985815Sobrien
6085815SobrienAC_PREREQ([2.12])
6185815Sobrien
6285815SobrienAC_DEFUN([AM_CONFIG_HEADER],
6385815Sobrien[ifdef([AC_FOREACH],dnl
6485815Sobrien	 [dnl init our file count if it isn't already
6585815Sobrien	 m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
6685815Sobrien	 dnl prepare to store our destination file list for use in config.status
6785815Sobrien	 AC_FOREACH([_AM_File], [$1],
6885815Sobrien		    [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
6985815Sobrien		    m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
7085815Sobrien		    dnl and add it to the list of files AC keeps track of, along
7185815Sobrien		    dnl with our hook
7285815Sobrien		    AC_CONFIG_HEADERS(_AM_File,
7385815Sobriendnl COMMANDS, [, INIT-CMDS]
7485815Sobrien[# update the timestamp
7585815Sobrienecho timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
7685815Sobrien][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
7785815Sobrien		    m4_popdef([_AM_Dest])])],dnl
7885815Sobrien[AC_CONFIG_HEADER([$1])
7985815Sobrien  AC_OUTPUT_COMMANDS(
8085815Sobrien   ifelse(patsubst([$1], [[^ ]], []),
8185815Sobrien	  [],
8285815Sobrien	  [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
8385815Sobrien	   patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
8485815Sobrien[am_indx=1
8585815Sobrienfor am_file in $1; do
8685815Sobrien  case " \$CONFIG_HEADERS " in
8785815Sobrien  *" \$am_file "*)
8885815Sobrien    am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
8985815Sobrien    if test -n "\$am_dir"; then
9085815Sobrien      am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
9185815Sobrien      for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
9285815Sobrien        am_tmpdir=\$am_tmpdir\$am_subdir/
9385815Sobrien        if test ! -d \$am_tmpdir; then
9485815Sobrien          mkdir \$am_tmpdir
9585815Sobrien        fi
9685815Sobrien      done
9785815Sobrien    fi
9885815Sobrien    echo timestamp > "\$am_dir"stamp-h\$am_indx
9985815Sobrien    ;;
10085815Sobrien  esac
10185815Sobrien  am_indx=\`expr \$am_indx + 1\`
10285815Sobriendone])
10385815Sobrien])]) # AM_CONFIG_HEADER
10485815Sobrien
10585815Sobrien# _AM_DIRNAME(PATH)
10685815Sobrien# -----------------
10785815Sobrien# Like AS_DIRNAME, only do it during macro expansion
10885815SobrienAC_DEFUN([_AM_DIRNAME],
10985815Sobrien       [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
11085815Sobrien	      m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
11185815Sobrien		    m4_if(m4_regexp([$1], [^/.*]), -1,
11285815Sobrien			  [.],
11385815Sobrien			  m4_patsubst([$1], [^\(/\).*], [\1])),
11485815Sobrien		    m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
11585815Sobrien	      m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
11685815Sobrien]) # _AM_DIRNAME
11785815Sobrien
11885815Sobrien# Do all the work for Automake.  This macro actually does too much --
11985815Sobrien# some checks are only needed if your package does certain things.
12085815Sobrien# But this isn't really a big deal.
12185815Sobrien
12285815Sobrien# serial 5
12385815Sobrien
12485815Sobrien# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
12585815Sobrien# written in clear, in which case automake, when reading aclocal.m4,
12685815Sobrien# will think it sees a *use*, and therefore will trigger all it's
12785815Sobrien# C support machinery.  Also note that it means that autoscan, seeing
12885815Sobrien# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
12985815Sobrien
13085815Sobrien
13185815Sobrien# We require 2.13 because we rely on SHELL being computed by configure.
13285815SobrienAC_PREREQ([2.13])
13385815Sobrien
13485815Sobrien# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
13585815Sobrien# -----------------------------------------------------------
13685815Sobrien# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
13785815Sobrien# The purpose of this macro is to provide the user with a means to
13885815Sobrien# check macros which are provided without letting her know how the
13985815Sobrien# information is coded.
14085815Sobrien# If this macro is not defined by Autoconf, define it here.
14185815Sobrienifdef([AC_PROVIDE_IFELSE],
14285815Sobrien      [],
14385815Sobrien      [define([AC_PROVIDE_IFELSE],
14485815Sobrien              [ifdef([AC_PROVIDE_$1],
14585815Sobrien                     [$2], [$3])])])
14685815Sobrien
14785815Sobrien
14885815Sobrien# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
14985815Sobrien# ----------------------------------------------
15085815SobrienAC_DEFUN([AM_INIT_AUTOMAKE],
15185815Sobrien[AC_REQUIRE([AC_PROG_INSTALL])dnl
15285815Sobrien# test to see if srcdir already configured
15385815Sobrienif test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
15485815Sobrien   test -f $srcdir/config.status; then
15585815Sobrien  AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
15685815Sobrienfi
15785815Sobrien
15885815Sobrien# Define the identity of the package.
15985815SobrienPACKAGE=$1
16085815SobrienAC_SUBST(PACKAGE)dnl
16185815SobrienVERSION=$2
16285815SobrienAC_SUBST(VERSION)dnl
16385815Sobrienifelse([$3],,
16485815Sobrien[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
16585815SobrienAC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
16685815Sobrien
16785815Sobrien# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
16885815Sobrien# the ones we care about.
16985815Sobrienifdef([m4_pattern_allow],
17085815Sobrien      [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
17185815Sobrien
17285815Sobrien# Autoconf 2.50 always computes EXEEXT.  However we need to be
17385815Sobrien# compatible with 2.13, for now.  So we always define EXEEXT, but we
17485815Sobrien# don't compute it.
17585815SobrienAC_SUBST(EXEEXT)
17685815Sobrien# Similar for OBJEXT -- only we only use OBJEXT if the user actually
17785815Sobrien# requests that it be used.  This is a bit dumb.
17885815Sobrien: ${OBJEXT=o}
17985815SobrienAC_SUBST(OBJEXT)
18085815Sobrien
18185815Sobrien# Some tools Automake needs.
18285815SobrienAC_REQUIRE([AM_SANITY_CHECK])dnl
18385815SobrienAC_REQUIRE([AC_ARG_PROGRAM])dnl
18485815SobrienAM_MISSING_PROG(ACLOCAL, aclocal)
18585815SobrienAM_MISSING_PROG(AUTOCONF, autoconf)
18685815SobrienAM_MISSING_PROG(AUTOMAKE, automake)
18785815SobrienAM_MISSING_PROG(AUTOHEADER, autoheader)
18885815SobrienAM_MISSING_PROG(MAKEINFO, makeinfo)
18985815SobrienAM_MISSING_PROG(AMTAR, tar)
19085815SobrienAM_PROG_INSTALL_SH
19185815SobrienAM_PROG_INSTALL_STRIP
19285815Sobrien# We need awk for the "check" target.  The system "awk" is bad on
19385815Sobrien# some platforms.
19485815SobrienAC_REQUIRE([AC_PROG_AWK])dnl
19585815SobrienAC_REQUIRE([AC_PROG_MAKE_SET])dnl
19685815SobrienAC_REQUIRE([AM_DEP_TRACK])dnl
19785815SobrienAC_REQUIRE([AM_SET_DEPDIR])dnl
19885815SobrienAC_PROVIDE_IFELSE([AC_PROG_][CC],
19985815Sobrien                  [_AM_DEPENDENCIES(CC)],
20085815Sobrien                  [define([AC_PROG_][CC],
20185815Sobrien                          defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
20285815SobrienAC_PROVIDE_IFELSE([AC_PROG_][CXX],
20385815Sobrien                  [_AM_DEPENDENCIES(CXX)],
20485815Sobrien                  [define([AC_PROG_][CXX],
20585815Sobrien                          defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
20685815Sobrien])
20785815Sobrien
208#
209# Check to make sure that the build environment is sane.
210#
211
212# serial 3
213
214# AM_SANITY_CHECK
215# ---------------
216AC_DEFUN([AM_SANITY_CHECK],
217[AC_MSG_CHECKING([whether build environment is sane])
218# Just in case
219sleep 1
220echo timestamp > conftest.file
221# Do `set' in a subshell so we don't clobber the current shell's
222# arguments.  Must try -L first in case configure is actually a
223# symlink; some systems play weird games with the mod time of symlinks
224# (eg FreeBSD returns the mod time of the symlink's containing
225# directory).
226if (
227   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
228   if test "$[*]" = "X"; then
229      # -L didn't work.
230      set X `ls -t $srcdir/configure conftest.file`
231   fi
232   rm -f conftest.file
233   if test "$[*]" != "X $srcdir/configure conftest.file" \
234      && test "$[*]" != "X conftest.file $srcdir/configure"; then
235
236      # If neither matched, then we have a broken ls.  This can happen
237      # if, for instance, CONFIG_SHELL is bash and it inherits a
238      # broken ls alias from the environment.  This has actually
239      # happened.  Such a system could not be considered "sane".
240      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
241alias in your environment])
242   fi
243
244   test "$[2]" = conftest.file
245   )
246then
247   # Ok.
248   :
249else
250   AC_MSG_ERROR([newly created file is older than distributed files!
251Check your system clock])
252fi
253AC_MSG_RESULT(yes)])
254
255
256# serial 2
257
258# AM_MISSING_PROG(NAME, PROGRAM)
259# ------------------------------
260AC_DEFUN([AM_MISSING_PROG],
261[AC_REQUIRE([AM_MISSING_HAS_RUN])
262$1=${$1-"${am_missing_run}$2"}
263AC_SUBST($1)])
264
265
266# AM_MISSING_HAS_RUN
267# ------------------
268# Define MISSING if not defined so far and test if it supports --run.
269# If it does, set am_missing_run to use it, otherwise, to nothing.
270AC_DEFUN([AM_MISSING_HAS_RUN],
271[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
272test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
273# Use eval to expand $SHELL
274if eval "$MISSING --run true"; then
275  am_missing_run="$MISSING --run "
276else
277  am_missing_run=
278  am_backtick='`'
279  AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
280fi
281])
282
283# AM_AUX_DIR_EXPAND
284
285# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
286# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
287# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
288#
289# Of course, Automake must honor this variable whenever it calls a
290# tool from the auxiliary directory.  The problem is that $srcdir (and
291# therefore $ac_aux_dir as well) can be either absolute or relative,
292# depending on how configure is run.  This is pretty annoying, since
293# it makes $ac_aux_dir quite unusable in subdirectories: in the top
294# source directory, any form will work fine, but in subdirectories a
295# relative path needs to be adjusted first.
296#
297# $ac_aux_dir/missing
298#    fails when called from a subdirectory if $ac_aux_dir is relative
299# $top_srcdir/$ac_aux_dir/missing
300#    fails if $ac_aux_dir is absolute,
301#    fails when called from a subdirectory in a VPATH build with
302#          a relative $ac_aux_dir
303#
304# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
305# are both prefixed by $srcdir.  In an in-source build this is usually
306# harmless because $srcdir is `.', but things will broke when you
307# start a VPATH build or use an absolute $srcdir.
308#
309# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
310# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
311#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
312# and then we would define $MISSING as
313#   MISSING="\${SHELL} $am_aux_dir/missing"
314# This will work as long as MISSING is not called from configure, because
315# unfortunately $(top_srcdir) has no meaning in configure.
316# However there are other variables, like CC, which are often used in
317# configure, and could therefore not use this "fixed" $ac_aux_dir.
318#
319# Another solution, used here, is to always expand $ac_aux_dir to an
320# absolute PATH.  The drawback is that using absolute paths prevent a
321# configured tree to be moved without reconfiguration.
322
323AC_DEFUN([AM_AUX_DIR_EXPAND], [
324# expand $ac_aux_dir to an absolute path
325am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
326])
327
328# AM_PROG_INSTALL_SH
329# ------------------
330# Define $install_sh.
331AC_DEFUN([AM_PROG_INSTALL_SH],
332[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
333install_sh=${install_sh-"$am_aux_dir/install-sh"}
334AC_SUBST(install_sh)])
335
336# One issue with vendor `install' (even GNU) is that you can't
337# specify the program used to strip binaries.  This is especially
338# annoying in cross-compiling environments, where the build's strip
339# is unlikely to handle the host's binaries.
340# Fortunately install-sh will honor a STRIPPROG variable, so we
341# always use install-sh in `make install-strip', and initialize
342# STRIPPROG with the value of the STRIP variable (set by the user).
343AC_DEFUN([AM_PROG_INSTALL_STRIP],
344[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
345INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
346AC_SUBST([INSTALL_STRIP_PROGRAM])])
347
348# serial 4						-*- Autoconf -*-
349
350
351
352# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
353# written in clear, in which case automake, when reading aclocal.m4,
354# will think it sees a *use*, and therefore will trigger all it's
355# C support machinery.  Also note that it means that autoscan, seeing
356# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
357
358
359
360# _AM_DEPENDENCIES(NAME)
361# ---------------------
362# See how the compiler implements dependency checking.
363# NAME is "CC", "CXX" or "OBJC".
364# We try a few techniques and use that to set a single cache variable.
365#
366# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
367# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
368# dependency, and given that the user is not expected to run this macro,
369# just rely on AC_PROG_CC.
370AC_DEFUN([_AM_DEPENDENCIES],
371[AC_REQUIRE([AM_SET_DEPDIR])dnl
372AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
373AC_REQUIRE([AM_MAKE_INCLUDE])dnl
374AC_REQUIRE([AM_DEP_TRACK])dnl
375
376ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
377       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
378       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
379       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
380                   [depcc="$$1"   am_compiler_list=])
381
382AC_CACHE_CHECK([dependency style of $depcc],
383               [am_cv_$1_dependencies_compiler_type],
384[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
385  # We make a subdir and do the tests there.  Otherwise we can end up
386  # making bogus files that we don't know about and never remove.  For
387  # instance it was reported that on HP-UX the gcc test will end up
388  # making a dummy file named `D' -- because `-MD' means `put the output
389  # in D'.
390  mkdir conftest.dir
391  # Copy depcomp to subdir because otherwise we won't find it if we're
392  # using a relative directory.
393  cp "$am_depcomp" conftest.dir
394  cd conftest.dir
395
396  am_cv_$1_dependencies_compiler_type=none
397  if test "$am_compiler_list" = ""; then
398     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
399  fi
400  for depmode in $am_compiler_list; do
401    # We need to recreate these files for each test, as the compiler may
402    # overwrite some of them when testing with obscure command lines.
403    # This happens at least with the AIX C compiler.
404    echo '#include "conftest.h"' > conftest.c
405    echo 'int i;' > conftest.h
406    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
407
408    case $depmode in
409    nosideeffect)
410      # after this tag, mechanisms are not by side-effect, so they'll
411      # only be used when explicitly requested
412      if test "x$enable_dependency_tracking" = xyes; then
413	continue
414      else
415	break
416      fi
417      ;;
418    none) break ;;
419    esac
420    # We check with `-c' and `-o' for the sake of the "dashmstdout"
421    # mode.  It turns out that the SunPro C++ compiler does not properly
422    # handle `-M -o', and we need to detect this.
423    if depmode=$depmode \
424       source=conftest.c object=conftest.o \
425       depfile=conftest.Po tmpdepfile=conftest.TPo \
426       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
427       grep conftest.h conftest.Po > /dev/null 2>&1 &&
428       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
429      am_cv_$1_dependencies_compiler_type=$depmode
430      break
431    fi
432  done
433
434  cd ..
435  rm -rf conftest.dir
436else
437  am_cv_$1_dependencies_compiler_type=none
438fi
439])
440$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
441AC_SUBST([$1DEPMODE])
442])
443
444
445# AM_SET_DEPDIR
446# -------------
447# Choose a directory name for dependency files.
448# This macro is AC_REQUIREd in _AM_DEPENDENCIES
449AC_DEFUN([AM_SET_DEPDIR],
450[rm -f .deps 2>/dev/null
451mkdir .deps 2>/dev/null
452if test -d .deps; then
453  DEPDIR=.deps
454else
455  # MS-DOS does not allow filenames that begin with a dot.
456  DEPDIR=_deps
457fi
458rmdir .deps 2>/dev/null
459AC_SUBST(DEPDIR)
460])
461
462
463# AM_DEP_TRACK
464# ------------
465AC_DEFUN([AM_DEP_TRACK],
466[AC_ARG_ENABLE(dependency-tracking,
467[  --disable-dependency-tracking Speeds up one-time builds
468  --enable-dependency-tracking  Do not reject slow dependency extractors])
469if test "x$enable_dependency_tracking" != xno; then
470  am_depcomp="$ac_aux_dir/depcomp"
471  AMDEPBACKSLASH='\'
472fi
473AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
474pushdef([subst], defn([AC_SUBST]))
475subst(AMDEPBACKSLASH)
476popdef([subst])
477])
478
479# Generate code to set up dependency tracking.
480# This macro should only be invoked once -- use via AC_REQUIRE.
481# Usage:
482# AM_OUTPUT_DEPENDENCY_COMMANDS
483
484#
485# This code is only required when automatic dependency tracking
486# is enabled.  FIXME.  This creates each `.P' file that we will
487# need in order to bootstrap the dependency handling code.
488AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
489AC_OUTPUT_COMMANDS([
490test x"$AMDEP_TRUE" != x"" ||
491for mf in $CONFIG_FILES; do
492  case "$mf" in
493  Makefile) dirpart=.;;
494  */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
495  *) continue;;
496  esac
497  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
498  # Extract the definition of DEP_FILES from the Makefile without
499  # running `make'.
500  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
501  test -z "$DEPDIR" && continue
502  # When using ansi2knr, U may be empty or an underscore; expand it
503  U=`sed -n -e '/^U = / s///p' < "$mf"`
504  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
505  # We invoke sed twice because it is the simplest approach to
506  # changing $(DEPDIR) to its actual value in the expansion.
507  for file in `sed -n -e '
508    /^DEP_FILES = .*\\\\$/ {
509      s/^DEP_FILES = //
510      :loop
511	s/\\\\$//
512	p
513	n
514	/\\\\$/ b loop
515      p
516    }
517    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
518       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
519    # Make sure the directory exists.
520    test -f "$dirpart/$file" && continue
521    fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
522    $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
523    # echo "creating $dirpart/$file"
524    echo '# dummy' > "$dirpart/$file"
525  done
526done
527], [AMDEP_TRUE="$AMDEP_TRUE"
528ac_aux_dir="$ac_aux_dir"])])
529
530# AM_MAKE_INCLUDE()
531# -----------------
532# Check to see how make treats includes.
533AC_DEFUN([AM_MAKE_INCLUDE],
534[am_make=${MAKE-make}
535cat > confinc << 'END'
536doit:
537	@echo done
538END
539# If we don't find an include directive, just comment out the code.
540AC_MSG_CHECKING([for style of include used by $am_make])
541am__include='#'
542am__quote=
543_am_result=none
544# First try GNU make style include.
545echo "include confinc" > confmf
546# We grep out `Entering directory' and `Leaving directory'
547# messages which can occur if `w' ends up in MAKEFLAGS.
548# In particular we don't look at `^make:' because GNU make might
549# be invoked under some other name (usually "gmake"), in which
550# case it prints its new name instead of `make'.
551if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
552   am__include=include
553   am__quote=
554   _am_result=GNU
555fi
556# Now try BSD make style include.
557if test "$am__include" = "#"; then
558   echo '.include "confinc"' > confmf
559   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
560      am__include=.include
561      am__quote='"'
562      _am_result=BSD
563   fi
564fi
565AC_SUBST(am__include)
566AC_SUBST(am__quote)
567AC_MSG_RESULT($_am_result)
568rm -f confinc confmf
569])
570
571# serial 3
572
573# AM_CONDITIONAL(NAME, SHELL-CONDITION)
574# -------------------------------------
575# Define a conditional.
576#
577# FIXME: Once using 2.50, use this:
578# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
579AC_DEFUN([AM_CONDITIONAL],
580[ifelse([$1], [TRUE],
581        [errprint(__file__:__line__: [$0: invalid condition: $1
582])dnl
583m4exit(1)])dnl
584ifelse([$1], [FALSE],
585       [errprint(__file__:__line__: [$0: invalid condition: $1
586])dnl
587m4exit(1)])dnl
588AC_SUBST([$1_TRUE])
589AC_SUBST([$1_FALSE])
590if $2; then
591  $1_TRUE=
592  $1_FALSE='#'
593else
594  $1_TRUE='#'
595  $1_FALSE=
596fi])
597
598
599# AM_PROG_LEX
600# Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
601AC_DEFUN([AM_PROG_LEX],
602[AC_REQUIRE([AM_MISSING_HAS_RUN])
603AC_CHECK_PROGS(LEX, flex lex, [${am_missing_run}flex])
604AC_PROG_LEX
605AC_DECL_YYTEXT])
606
607dnl $Id: krb-prog-ln-s.m4,v 1.1 1997/12/14 15:59:01 joda Exp $
608dnl
609dnl
610dnl Better test for ln -s, ln or cp
611dnl
612
613AC_DEFUN(AC_KRB_PROG_LN_S,
614[AC_MSG_CHECKING(for ln -s or something else)
615AC_CACHE_VAL(ac_cv_prog_LN_S,
616[rm -f conftestdata
617if ln -s X conftestdata 2>/dev/null
618then
619  rm -f conftestdata
620  ac_cv_prog_LN_S="ln -s"
621else
622  touch conftestdata1
623  if ln conftestdata1 conftestdata2; then
624    rm -f conftestdata*
625    ac_cv_prog_LN_S=ln
626  else
627    ac_cv_prog_LN_S=cp
628  fi
629fi])dnl
630LN_S="$ac_cv_prog_LN_S"
631AC_MSG_RESULT($ac_cv_prog_LN_S)
632AC_SUBST(LN_S)dnl
633])
634
635
636dnl $Id: mips-abi.m4,v 1.5 2000/07/18 15:01:42 joda Exp $
637dnl
638dnl
639dnl Check for MIPS/IRIX ABI flags. Sets $abi and $abilibdirext to some
640dnl value.
641
642AC_DEFUN(AC_MIPS_ABI, [
643AC_ARG_WITH(mips_abi,
644[  --with-mips-abi=abi     ABI to use for IRIX (32, n32, or 64)])
645
646case "$host_os" in
647irix*)
648with_mips_abi="${with_mips_abi:-yes}"
649if test -n "$GCC"; then
650
651# GCC < 2.8 only supports the O32 ABI. GCC >= 2.8 has a flag to select
652# which ABI to use, but only supports (as of 2.8.1) the N32 and 64 ABIs.
653#
654# Default to N32, but if GCC doesn't grok -mabi=n32, we assume an old
655# GCC and revert back to O32. The same goes if O32 is asked for - old
656# GCCs doesn't like the -mabi option, and new GCCs can't output O32.
657#
658# Don't you just love *all* the different SGI ABIs?
659
660case "${with_mips_abi}" in 
661        32|o32) abi='-mabi=32';  abilibdirext=''     ;;
662       n32|yes) abi='-mabi=n32'; abilibdirext='32'  ;;
663        64) abi='-mabi=64';  abilibdirext='64'   ;;
664	no) abi=''; abilibdirext='';;
665         *) AC_MSG_ERROR("Invalid ABI specified") ;;
666esac
667if test -n "$abi" ; then
668ac_foo=krb_cv_gcc_`echo $abi | tr =- __`
669dnl
670dnl can't use AC_CACHE_CHECK here, since it doesn't quote CACHE-ID to
671dnl AC_MSG_RESULT
672dnl
673AC_MSG_CHECKING([if $CC supports the $abi option])
674AC_CACHE_VAL($ac_foo, [
675save_CFLAGS="$CFLAGS"
676CFLAGS="$CFLAGS $abi"
677AC_TRY_COMPILE(,int x;, eval $ac_foo=yes, eval $ac_foo=no)
678CFLAGS="$save_CFLAGS"
679])
680ac_res=`eval echo \\\$$ac_foo`
681AC_MSG_RESULT($ac_res)
682if test $ac_res = no; then
683# Try to figure out why that failed...
684case $abi in
685	-mabi=32) 
686	save_CFLAGS="$CFLAGS"
687	CFLAGS="$CFLAGS -mabi=n32"
688	AC_TRY_COMPILE(,int x;, ac_res=yes, ac_res=no)
689	CLAGS="$save_CFLAGS"
690	if test $ac_res = yes; then
691		# New GCC
692		AC_MSG_ERROR([$CC does not support the $with_mips_abi ABI])
693	fi
694	# Old GCC
695	abi=''
696	abilibdirext=''
697	;;
698	-mabi=n32|-mabi=64)
699		if test $with_mips_abi = yes; then
700			# Old GCC, default to O32
701			abi=''
702			abilibdirext=''
703		else
704			# Some broken GCC
705			AC_MSG_ERROR([$CC does not support the $with_mips_abi ABI])
706		fi
707	;;
708esac
709fi #if test $ac_res = no; then
710fi #if test -n "$abi" ; then
711else
712case "${with_mips_abi}" in
713        32|o32) abi='-32'; abilibdirext=''     ;;
714       n32|yes) abi='-n32'; abilibdirext='32'  ;;
715        64) abi='-64'; abilibdirext='64'   ;;
716	no) abi=''; abilibdirext='';;
717         *) AC_MSG_ERROR("Invalid ABI specified") ;;
718esac
719fi #if test -n "$GCC"; then
720;;
721esac
722])
723
724dnl
725dnl $Id: c-attribute.m4,v 1.2 1999/03/01 09:52:23 joda Exp $
726dnl
727
728dnl
729dnl Test for __attribute__
730dnl
731
732AC_DEFUN(AC_C___ATTRIBUTE__, [
733AC_MSG_CHECKING(for __attribute__)
734AC_CACHE_VAL(ac_cv___attribute__, [
735AC_TRY_COMPILE([
736#include <stdlib.h>
737],
738[
739static void foo(void) __attribute__ ((noreturn));
740
741static void
742foo(void)
743{
744  exit(1);
745}
746],
747ac_cv___attribute__=yes,
748ac_cv___attribute__=no)])
749if test "$ac_cv___attribute__" = "yes"; then
750  AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
751fi
752AC_MSG_RESULT($ac_cv___attribute__)
753])
754
755
756
757# serial 40 AC_PROG_LIBTOOL
758AC_DEFUN(AC_PROG_LIBTOOL,
759[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
760
761# Save cache, so that ltconfig can load it
762AC_CACHE_SAVE
763
764# Actually configure libtool.  ac_aux_dir is where install-sh is found.
765CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
766LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
767LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
768DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
769${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
770$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
771|| AC_MSG_ERROR([libtool configure failed])
772
773# Reload cache, that may have been modified by ltconfig
774AC_CACHE_LOAD
775
776# This can be used to rebuild libtool when needed
777LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
778
779# Always use our own libtool.
780LIBTOOL='$(SHELL) $(top_builddir)/libtool'
781AC_SUBST(LIBTOOL)dnl
782
783# Redirect the config.log output again, so that the ltconfig log is not
784# clobbered by the next message.
785exec 5>>./config.log
786])
787
788AC_DEFUN(AC_LIBTOOL_SETUP,
789[AC_PREREQ(2.13)dnl
790AC_REQUIRE([AC_ENABLE_SHARED])dnl
791AC_REQUIRE([AC_ENABLE_STATIC])dnl
792AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
793AC_REQUIRE([AC_CANONICAL_HOST])dnl
794AC_REQUIRE([AC_CANONICAL_BUILD])dnl
795AC_REQUIRE([AC_PROG_RANLIB])dnl
796AC_REQUIRE([AC_PROG_CC])dnl
797AC_REQUIRE([AC_PROG_LD])dnl
798AC_REQUIRE([AC_PROG_NM])dnl
799AC_REQUIRE([AC_PROG_LN_S])dnl
800dnl
801
802case "$target" in
803NONE) lt_target="$host" ;;
804*) lt_target="$target" ;;
805esac
806
807# Check for any special flags to pass to ltconfig.
808libtool_flags="--cache-file=$cache_file"
809test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
810test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
811test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
812test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
813test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
814ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
815[libtool_flags="$libtool_flags --enable-dlopen"])
816ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
817[libtool_flags="$libtool_flags --enable-win32-dll"])
818AC_ARG_ENABLE(libtool-lock,
819  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
820test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
821test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
822
823# Some flags need to be propagated to the compiler or linker for good
824# libtool support.
825case "$lt_target" in
826*-*-irix6*)
827  # Find out which ABI we are using.
828  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
829  if AC_TRY_EVAL(ac_compile); then
830    case "`/usr/bin/file conftest.o`" in
831    *32-bit*)
832      LD="${LD-ld} -32"
833      ;;
834    *N32*)
835      LD="${LD-ld} -n32"
836      ;;
837    *64-bit*)
838      LD="${LD-ld} -64"
839      ;;
840    esac
841  fi
842  rm -rf conftest*
843  ;;
844
845*-*-sco3.2v5*)
846  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
847  SAVE_CFLAGS="$CFLAGS"
848  CFLAGS="$CFLAGS -belf"
849  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
850    [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
851  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
852    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
853    CFLAGS="$SAVE_CFLAGS"
854  fi
855  ;;
856
857ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
858[*-*-cygwin* | *-*-mingw*)
859  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
860  AC_CHECK_TOOL(AS, as, false)
861  AC_CHECK_TOOL(OBJDUMP, objdump, false)
862  ;;
863])
864esac
865])
866
867# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
868AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
869
870# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
871AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
872
873# AC_ENABLE_SHARED - implement the --enable-shared flag
874# Usage: AC_ENABLE_SHARED[(DEFAULT)]
875#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
876#   `yes'.
877AC_DEFUN(AC_ENABLE_SHARED, [dnl
878define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
879AC_ARG_ENABLE(shared,
880changequote(<<, >>)dnl
881<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
882changequote([, ])dnl
883[p=${PACKAGE-default}
884case "$enableval" in
885yes) enable_shared=yes ;;
886no) enable_shared=no ;;
887*)
888  enable_shared=no
889  # Look at the argument we got.  We use all the common list separators.
890  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
891  for pkg in $enableval; do
892    if test "X$pkg" = "X$p"; then
893      enable_shared=yes
894    fi
895  done
896  IFS="$ac_save_ifs"
897  ;;
898esac],
899enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
900])
901
902# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
903AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
904AC_ENABLE_SHARED(no)])
905
906# AC_ENABLE_STATIC - implement the --enable-static flag
907# Usage: AC_ENABLE_STATIC[(DEFAULT)]
908#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
909#   `yes'.
910AC_DEFUN(AC_ENABLE_STATIC, [dnl
911define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
912AC_ARG_ENABLE(static,
913changequote(<<, >>)dnl
914<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
915changequote([, ])dnl
916[p=${PACKAGE-default}
917case "$enableval" in
918yes) enable_static=yes ;;
919no) enable_static=no ;;
920*)
921  enable_static=no
922  # Look at the argument we got.  We use all the common list separators.
923  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
924  for pkg in $enableval; do
925    if test "X$pkg" = "X$p"; then
926      enable_static=yes
927    fi
928  done
929  IFS="$ac_save_ifs"
930  ;;
931esac],
932enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
933])
934
935# AC_DISABLE_STATIC - set the default static flag to --disable-static
936AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
937AC_ENABLE_STATIC(no)])
938
939
940# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
941# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
942#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
943#   `yes'.
944AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
945define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
946AC_ARG_ENABLE(fast-install,
947changequote(<<, >>)dnl
948<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
949changequote([, ])dnl
950[p=${PACKAGE-default}
951case "$enableval" in
952yes) enable_fast_install=yes ;;
953no) enable_fast_install=no ;;
954*)
955  enable_fast_install=no
956  # Look at the argument we got.  We use all the common list separators.
957  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
958  for pkg in $enableval; do
959    if test "X$pkg" = "X$p"; then
960      enable_fast_install=yes
961    fi
962  done
963  IFS="$ac_save_ifs"
964  ;;
965esac],
966enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
967])
968
969# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
970AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
971AC_ENABLE_FAST_INSTALL(no)])
972
973# AC_PROG_LD - find the path to the GNU or non-GNU linker
974AC_DEFUN(AC_PROG_LD,
975[AC_ARG_WITH(gnu-ld,
976[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
977test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
978AC_REQUIRE([AC_PROG_CC])dnl
979AC_REQUIRE([AC_CANONICAL_HOST])dnl
980AC_REQUIRE([AC_CANONICAL_BUILD])dnl
981ac_prog=ld
982if test "$ac_cv_prog_gcc" = yes; then
983  # Check if gcc -print-prog-name=ld gives a path.
984  AC_MSG_CHECKING([for ld used by GCC])
985  ac_prog=`($CC -print-prog-name=ld) 2>&5`
986  case "$ac_prog" in
987    # Accept absolute paths.
988changequote(,)dnl
989    [\\/]* | [A-Za-z]:[\\/]*)
990      re_direlt='/[^/][^/]*/\.\./'
991changequote([,])dnl
992      # Canonicalize the path of ld
993      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
994      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
995	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
996      done
997      test -z "$LD" && LD="$ac_prog"
998      ;;
999  "")
1000    # If it fails, then pretend we aren't using GCC.
1001    ac_prog=ld
1002    ;;
1003  *)
1004    # If it is relative, then search for the first ld in PATH.
1005    with_gnu_ld=unknown
1006    ;;
1007  esac
1008elif test "$with_gnu_ld" = yes; then
1009  AC_MSG_CHECKING([for GNU ld])
1010else
1011  AC_MSG_CHECKING([for non-GNU ld])
1012fi
1013AC_CACHE_VAL(ac_cv_path_LD,
1014[if test -z "$LD"; then
1015  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1016  for ac_dir in $PATH; do
1017    test -z "$ac_dir" && ac_dir=.
1018    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1019      ac_cv_path_LD="$ac_dir/$ac_prog"
1020      # Check to see if the program is GNU ld.  I'd rather use --version,
1021      # but apparently some GNU ld's only accept -v.
1022      # Break only if it was the GNU/non-GNU ld that we prefer.
1023      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1024	test "$with_gnu_ld" != no && break
1025      else
1026	test "$with_gnu_ld" != yes && break
1027      fi
1028    fi
1029  done
1030  IFS="$ac_save_ifs"
1031else
1032  ac_cv_path_LD="$LD" # Let the user override the test with a path.
1033fi])
1034LD="$ac_cv_path_LD"
1035if test -n "$LD"; then
1036  AC_MSG_RESULT($LD)
1037else
1038  AC_MSG_RESULT(no)
1039fi
1040test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1041AC_PROG_LD_GNU
1042])
1043
1044AC_DEFUN(AC_PROG_LD_GNU,
1045[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
1046[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1047if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1048  ac_cv_prog_gnu_ld=yes
1049else
1050  ac_cv_prog_gnu_ld=no
1051fi])
1052])
1053
1054# AC_PROG_NM - find the path to a BSD-compatible name lister
1055AC_DEFUN(AC_PROG_NM,
1056[AC_MSG_CHECKING([for BSD-compatible nm])
1057AC_CACHE_VAL(ac_cv_path_NM,
1058[if test -n "$NM"; then
1059  # Let the user override the test.
1060  ac_cv_path_NM="$NM"
1061else
1062  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1063  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1064    test -z "$ac_dir" && ac_dir=.
1065    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1066      # Check to see if the nm accepts a BSD-compat flag.
1067      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1068      #   nm: unknown option "B" ignored
1069      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1070	ac_cv_path_NM="$ac_dir/nm -B"
1071	break
1072      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1073	ac_cv_path_NM="$ac_dir/nm -p"
1074	break
1075      else
1076	ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1077	continue # so that we can try to find one that supports BSD flags
1078      fi
1079    fi
1080  done
1081  IFS="$ac_save_ifs"
1082  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1083fi])
1084NM="$ac_cv_path_NM"
1085AC_MSG_RESULT([$NM])
1086])
1087
1088# AC_CHECK_LIBM - check for math library
1089AC_DEFUN(AC_CHECK_LIBM,
1090[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1091LIBM=
1092case "$lt_target" in
1093*-*-beos* | *-*-cygwin*)
1094  # These system don't have libm
1095  ;;
1096*-ncr-sysv4.3*)
1097  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1098  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1099  ;;
1100*)
1101  AC_CHECK_LIB(m, main, LIBM="-lm")
1102  ;;
1103esac
1104])
1105
1106# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1107# the libltdl convenience library, adds --enable-ltdl-convenience to
1108# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
1109# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
1110# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
1111# '${top_builddir}/' (note the single quotes!) if your package is not
1112# flat, and, if you're not using automake, define top_builddir as
1113# appropriate in the Makefiles.
1114AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1115  case "$enable_ltdl_convenience" in
1116  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1117  "") enable_ltdl_convenience=yes
1118      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1119  esac
1120  LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
1121  INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1122])
1123
1124# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1125# the libltdl installable library, and adds --enable-ltdl-install to
1126# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
1127# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
1128# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
1129# '${top_builddir}/' (note the single quotes!) if your package is not
1130# flat, and, if you're not using automake, define top_builddir as
1131# appropriate in the Makefiles.
1132# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1133AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1134  AC_CHECK_LIB(ltdl, main,
1135  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1136  [if test x"$enable_ltdl_install" = xno; then
1137     AC_MSG_WARN([libltdl not installed, but installation disabled])
1138   else
1139     enable_ltdl_install=yes
1140   fi
1141  ])
1142  if test x"$enable_ltdl_install" = x"yes"; then
1143    ac_configure_args="$ac_configure_args --enable-ltdl-install"
1144    LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
1145    INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1146  else
1147    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1148    LIBLTDL="-lltdl"
1149    INCLTDL=
1150  fi
1151])
1152
1153dnl old names
1154AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
1155AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
1156AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
1157AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
1158AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
1159AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
1160AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
1161
1162dnl This is just to silence aclocal about the macro not being used
1163ifelse([AC_DISABLE_FAST_INSTALL])dnl
1164
1165dnl $Id: wflags.m4,v 1.3 1999/03/11 12:11:41 joda Exp $
1166dnl
1167dnl set WFLAGS
1168
1169AC_DEFUN(AC_WFLAGS,[
1170WFLAGS_NOUNUSED=""
1171WFLAGS_NOIMPLICITINT=""
1172if test -z "$WFLAGS" -a "$GCC" = "yes"; then
1173  # -Wno-implicit-int for broken X11 headers
1174  # leave these out for now:
1175  #   -Wcast-align doesn't work well on alpha osf/1
1176  #   -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast
1177  #   -Wmissing-declarations -Wnested-externs
1178  WFLAGS="ifelse($#, 0,-Wall, $1)"
1179  WFLAGS_NOUNUSED="-Wno-unused"
1180  WFLAGS_NOIMPLICITINT="-Wno-implicit-int"
1181fi
1182AC_SUBST(WFLAGS)dnl
1183AC_SUBST(WFLAGS_NOUNUSED)dnl
1184AC_SUBST(WFLAGS_NOIMPLICITINT)dnl
1185])
1186
1187dnl $Id: db.m4,v 1.5 2001/09/13 00:34:07 assar Exp $
1188dnl
1189dnl tests for various db libraries
1190dnl
1191AC_DEFUN([rk_DB],[berkeley_db=db
1192AC_ARG_WITH(berkeley-db,
1193[  --without-berkeley-db   if you don't want berkeley db],[
1194if test "$withval" = no; then
1195	berkeley_db=""
1196fi
1197])
1198
1199have_ndbm=no
1200db_type=unknown
1201
1202if test "$berkeley_db"; then
1203
1204  AC_CHECK_HEADERS([				\
1205	db.h					\
1206	db_185.h				\
1207  ])
1208
1209dnl db_create is used by db3
1210
1211  AC_FIND_FUNC_NO_LIBS(db_create, $berkeley_db, [
1212  #include <stdio.h>
1213  #include <db.h>
1214  ],[NULL, NULL, 0])
1215
1216  if test "$ac_cv_func_db_create" = "yes"; then
1217    db_type=db3
1218    if test "$ac_cv_funclib_db_create" != "yes"; then
1219      DBLIB="$ac_cv_funclib_db_create"
1220    else
1221      DBLIB=""
1222    fi
1223    AC_DEFINE(HAVE_DB3, 1, [define if you have a berkeley db3 library])
1224  else
1225
1226dnl dbopen is used by db1/db2
1227
1228    AC_FIND_FUNC_NO_LIBS(dbopen, $berkeley_db, [
1229    #include <stdio.h>
1230    #if defined(HAVE_DB_185_H)
1231    #include <db_185.h>
1232    #elif defined(HAVE_DB_H)
1233    #include <db.h>
1234    #else
1235    #error no db.h
1236    #endif
1237    ],[NULL, 0, 0, 0, NULL])
1238
1239    if test "$ac_cv_func_dbopen" = "yes"; then
1240      db_type=db1
1241      if test "$ac_cv_funclib_dbopen" != "yes"; then
1242        DBLIB="$ac_cv_funclib_dbopen"
1243      else
1244        DBLIB=""
1245      fi
1246      AC_DEFINE(HAVE_DB1, 1, [define if you have a berkeley db1/2 library])
1247    fi
1248  fi
1249
1250dnl test for ndbm compatability
1251
1252  AC_FIND_FUNC_NO_LIBS2(dbm_firstkey, $ac_cv_funclib_dbopen $ac_cv_funclib_db_create, [
1253  #include <stdio.h>
1254  #define DB_DBM_HSEARCH 1
1255  #include <db.h>
1256  DBM *dbm;
1257  ],[NULL])
1258
1259  if test "$ac_cv_func_dbm_firstkey" = "yes"; then
1260    if test "$ac_cv_funclib_dbm_firstkey" != "yes"; then
1261      LIB_NDBM="$ac_cv_funclib_dbm_firstkey"
1262    else
1263      LIB_NDBM=""
1264    fi
1265    AC_DEFINE(HAVE_DB_NDBM, 1, [define if you have ndbm compat in db])
1266    AC_DEFINE(HAVE_NEW_DB, 1, [Define if NDBM really is DB (creates files *.db)])
1267  else
1268    $as_unset ac_cv_func_dbm_firstkey
1269    $as_unset ac_cv_funclib_dbm_firstkey
1270  fi
1271
1272fi # berkeley db
1273
1274if test "$db_type" = "unknown" -o "$ac_cv_func_dbm_firstkey" = ""; then
1275
1276  AC_CHECK_HEADERS([				\
1277	dbm.h					\
1278	ndbm.h					\
1279  ])
1280
1281  AC_FIND_FUNC_NO_LIBS(dbm_firstkey, ndbm, [
1282  #include <stdio.h>
1283  #if defined(HAVE_NDBM_H)
1284  #include <ndbm.h>
1285  #elif defined(HAVE_DBM_H)
1286  #include <dbm.h>
1287  #else
1288  #error no ndbm.h
1289  #endif
1290  DBM *dbm;
1291  ],[NULL])
1292
1293  if test "$ac_cv_func_dbm_firstkey" = "yes"; then
1294    if test "$ac_cv_funclib_dbm_firstkey" != "yes"; then
1295      LIB_NDBM="$ac_cv_funclib_dbm_firstkey"
1296    else
1297      LIB_NDBM=""
1298    fi
1299    AC_DEFINE(HAVE_NDBM, 1, [define if you have a ndbm library])dnl
1300    have_ndbm=yes
1301    if test "$db_type" = "unknown"; then
1302      db_type=ndbm
1303      DBLIB="$LIB_NDBM"
1304    fi
1305  else
1306
1307    $as_unset ac_cv_func_dbm_firstkey
1308    $as_unset ac_cv_funclib_dbm_firstkey
1309
1310    AC_CHECK_HEADERS([				\
1311	  gdbm/ndbm.h				\
1312    ])
1313
1314    AC_FIND_FUNC_NO_LIBS(dbm_firstkey, gdbm, [
1315    #include <stdio.h>
1316    #include <gdbm/ndbm.h>
1317    DBM *dbm;
1318    ],[NULL])
1319
1320    if test "$ac_cv_func_dbm_firstkey" = "yes"; then
1321      if test "$ac_cv_funclib_dbm_firstkey" != "yes"; then
1322	LIB_NDBM="$ac_cv_funclib_dbm_firstkey"
1323      else
1324	LIB_NDBM=""
1325      fi
1326      AC_DEFINE(HAVE_NDBM, 1, [define if you have a ndbm library])dnl
1327      have_ndbm=yes
1328      if test "$db_type" = "unknown"; then
1329	db_type=ndbm
1330	DBLIB="$LIB_NDBM"
1331      fi
1332    fi
1333  fi
1334
1335fi # unknown
1336
1337if test "$have_ndbm" = "yes"; then
1338  AC_MSG_CHECKING([if ndbm is implemented with db])
1339  AC_TRY_RUN([
1340#include <unistd.h>
1341#include <fcntl.h>
1342#if defined(HAVE_GDBM_NDBM_H)
1343#include <gdbm/ndbm.h>
1344#elif defined(HAVE_NDBM_H)
1345#include <ndbm.h>
1346#elif defined(HAVE_DBM_H)
1347#include <dbm.h>
1348#endif
1349int main()
1350{
1351  DBM *d;
1352
1353  d = dbm_open("conftest", O_RDWR | O_CREAT, 0666);
1354  if (d == NULL)
1355    return 1;
1356  dbm_close(d);
1357  return 0;
1358}],[
1359    if test -f conftest.db; then
1360      AC_MSG_RESULT([yes])
1361      AC_DEFINE(HAVE_NEW_DB, 1, [Define if NDBM really is DB (creates files *.db)])
1362    else
1363      AC_MSG_RESULT([no])
1364    fi],[AC_MSG_RESULT([no])])
1365fi
1366
1367AC_SUBST(DBLIB)dnl
1368AC_SUBST(LIB_NDBM)dnl
1369])
1370
1371dnl $Id: find-func-no-libs.m4,v 1.5 1999/10/30 21:08:18 assar Exp $
1372dnl
1373dnl
1374dnl Look for function in any of the specified libraries
1375dnl
1376
1377dnl AC_FIND_FUNC_NO_LIBS(func, libraries, includes, arguments, extra libs, extra args)
1378AC_DEFUN(AC_FIND_FUNC_NO_LIBS, [
1379AC_FIND_FUNC_NO_LIBS2([$1], ["" $2], [$3], [$4], [$5], [$6])])
1380
1381dnl $Id: find-func-no-libs2.m4,v 1.6 2001/09/01 10:57:32 assar Exp $
1382dnl
1383dnl
1384dnl Look for function in any of the specified libraries
1385dnl
1386
1387dnl AC_FIND_FUNC_NO_LIBS2(func, libraries, includes, arguments, extra libs, extra args)
1388AC_DEFUN(AC_FIND_FUNC_NO_LIBS2, [
1389
1390AC_MSG_CHECKING([for $1])
1391AC_CACHE_VAL(ac_cv_funclib_$1,
1392[
1393if eval "test \"\$ac_cv_func_$1\" != yes" ; then
1394	ac_save_LIBS="$LIBS"
1395	for ac_lib in $2; do
1396		case "$ac_lib" in
1397		"") ;;
1398		yes) ac_lib="" ;;
1399		no) continue ;;
1400		-l*) ;;
1401		*) ac_lib="-l$ac_lib" ;;
1402		esac
1403		LIBS="$6 $ac_lib $5 $ac_save_LIBS"
1404		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)
1405	done
1406	eval "ac_cv_funclib_$1=\${ac_cv_funclib_$1-no}"
1407	LIBS="$ac_save_LIBS"
1408fi
1409])
1410
1411eval "ac_res=\$ac_cv_funclib_$1"
1412
1413if false; then
1414	AC_CHECK_FUNCS($1)
1415dnl	AC_CHECK_LIBS($2, foo)
1416fi
1417# $1
1418eval "ac_tr_func=HAVE_[]upcase($1)"
1419eval "ac_tr_lib=HAVE_LIB[]upcase($ac_res | sed -e 's/-l//')"
1420eval "LIB_$1=$ac_res"
1421
1422case "$ac_res" in
1423	yes)
1424	eval "ac_cv_func_$1=yes"
1425	eval "LIB_$1="
1426	AC_DEFINE_UNQUOTED($ac_tr_func)
1427	AC_MSG_RESULT([yes])
1428	;;
1429	no)
1430	eval "ac_cv_func_$1=no"
1431	eval "LIB_$1="
1432	AC_MSG_RESULT([no])
1433	;;
1434	*)
1435	eval "ac_cv_func_$1=yes"
1436	eval "ac_cv_lib_`echo "$ac_res" | sed 's/-l//'`=yes"
1437	AC_DEFINE_UNQUOTED($ac_tr_func)
1438	AC_DEFINE_UNQUOTED($ac_tr_lib)
1439	AC_MSG_RESULT([yes, in $ac_res])
1440	;;
1441esac
1442AC_SUBST(LIB_$1)
1443])
1444
1445dnl $Id: roken-frag.m4,v 1.34 2001/11/30 03:29:47 assar Exp $
1446dnl
1447dnl some code to get roken working
1448dnl
1449dnl rk_ROKEN(subdir)
1450dnl
1451AC_DEFUN(rk_ROKEN, [
1452
1453AC_REQUIRE([rk_CONFIG_HEADER])
1454
1455DIR_roken=roken
1456LIB_roken='$(top_builddir)/$1/libroken.la'
1457INCLUDES_roken='-I$(top_builddir)/$1 -I$(top_srcdir)/$1'
1458
1459dnl Checks for programs
1460AC_REQUIRE([AC_PROG_CC])
1461AC_REQUIRE([AC_PROG_AWK])
1462AC_REQUIRE([AC_OBJEXT])
1463AC_REQUIRE([AC_EXEEXT])
1464AC_REQUIRE([AC_PROG_LIBTOOL])
1465
1466AC_REQUIRE([AC_MIPS_ABI])
1467
1468dnl C characteristics
1469
1470AC_REQUIRE([AC_C___ATTRIBUTE__])
1471AC_REQUIRE([AC_C_INLINE])
1472AC_REQUIRE([AC_C_CONST])
1473AC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
1474
1475AC_REQUIRE([rk_DB])
1476
1477dnl C types
1478
1479AC_REQUIRE([AC_TYPE_SIZE_T])
1480AC_CHECK_TYPE_EXTRA(ssize_t, int, [#include <unistd.h>])
1481AC_REQUIRE([AC_TYPE_PID_T])
1482AC_REQUIRE([AC_TYPE_UID_T])
1483AC_HAVE_TYPE([long long])
1484
1485AC_REQUIRE([rk_RETSIGTYPE])
1486
1487dnl Checks for header files.
1488AC_REQUIRE([AC_HEADER_STDC])
1489AC_REQUIRE([AC_HEADER_TIME])
1490
1491AC_CHECK_HEADERS([\
1492	arpa/inet.h				\
1493	arpa/nameser.h				\
1494	config.h				\
1495	crypt.h					\
1496	dirent.h				\
1497	errno.h					\
1498	err.h					\
1499	fcntl.h					\
1500	grp.h					\
1501	ifaddrs.h				\
1502	net/if.h				\
1503	netdb.h					\
1504	netinet/in.h				\
1505	netinet/in6.h				\
1506	netinet/in_systm.h			\
1507	netinet6/in6.h				\
1508	netinet6/in6_var.h			\
1509	paths.h					\
1510	pwd.h					\
1511	resolv.h				\
1512	rpcsvc/ypclnt.h				\
1513	shadow.h				\
1514	sys/bswap.h				\
1515	sys/ioctl.h				\
1516	sys/param.h				\
1517	sys/proc.h				\
1518	sys/resource.h				\
1519	sys/socket.h				\
1520	sys/sockio.h				\
1521	sys/stat.h				\
1522	sys/sysctl.h				\
1523	sys/time.h				\
1524	sys/tty.h				\
1525	sys/types.h				\
1526	sys/uio.h				\
1527	sys/utsname.h				\
1528	sys/wait.h				\
1529	syslog.h				\
1530	termios.h				\
1531	unistd.h				\
1532	userconf.h				\
1533	usersec.h				\
1534	util.h					\
1535	vis.h					\
1536])
1537	
1538AC_REQUIRE([CHECK_NETINET_IP_AND_TCP])
1539
1540AM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes)
1541AM_CONDITIONAL(have_fnmatch_h, test "$ac_cv_header_fnmatch_h" = yes)
1542AM_CONDITIONAL(have_ifaddrs_h, test "$ac_cv_header_ifaddrs_h" = yes)
1543AM_CONDITIONAL(have_vis_h, test "$ac_cv_header_vis_h" = yes)
1544
1545dnl Check for functions and libraries
1546
1547AC_FIND_FUNC(socket, socket)
1548AC_FIND_FUNC(gethostbyname, nsl)
1549AC_FIND_FUNC(syslog, syslog)
1550
1551AC_KRB_IPV6
1552
1553AC_FIND_FUNC(gethostbyname2, inet6 ip6)
1554
1555AC_FIND_FUNC(res_search, resolv,
1556[
1557#include <stdio.h>
1558#ifdef HAVE_SYS_TYPES_H
1559#include <sys/types.h>
1560#endif
1561#ifdef HAVE_NETINET_IN_H
1562#include <netinet/in.h>
1563#endif
1564#ifdef HAVE_ARPA_NAMESER_H
1565#include <arpa/nameser.h>
1566#endif
1567#ifdef HAVE_RESOLV_H
1568#include <resolv.h>
1569#endif
1570],
1571[0,0,0,0,0])
1572
1573AC_FIND_FUNC(dn_expand, resolv,
1574[
1575#include <stdio.h>
1576#ifdef HAVE_SYS_TYPES_H
1577#include <sys/types.h>
1578#endif
1579#ifdef HAVE_NETINET_IN_H
1580#include <netinet/in.h>
1581#endif
1582#ifdef HAVE_ARPA_NAMESER_H
1583#include <arpa/nameser.h>
1584#endif
1585#ifdef HAVE_RESOLV_H
1586#include <resolv.h>
1587#endif
1588],
1589[0,0,0,0,0])
1590
1591AC_BROKEN_SNPRINTF
1592AC_BROKEN_VSNPRINTF
1593
1594AC_BROKEN_GLOB
1595if test "$ac_cv_func_glob_working" != yes; then
1596	LIBOBJS="$LIBOBJS glob.o"
1597fi
1598AM_CONDITIONAL(have_glob_h, test "$ac_cv_func_glob_working" = yes)
1599
1600
1601AC_CHECK_FUNCS([				\
1602	asnprintf				\
1603	asprintf				\
1604	atexit					\
1605	cgetent					\
1606	getconfattr				\
1607	getprogname				\
1608	getrlimit				\
1609	getspnam				\
1610	initstate				\
1611	issetugid				\
1612	on_exit					\
1613	random					\
1614	setprogname				\
1615	setstate				\
1616	strsvis					\
1617	strunvis				\
1618	strvis					\
1619	strvisx					\
1620	svis					\
1621	sysconf					\
1622	sysctl					\
1623	uname					\
1624	unvis					\
1625	vasnprintf				\
1626	vasprintf				\
1627	vis					\
1628])
1629
1630if test "$ac_cv_func_cgetent" = no; then
1631	LIBOBJS="$LIBOBJS getcap.o"
1632fi
1633
1634AC_REQUIRE([AC_FUNC_GETLOGIN])
1635
1636AC_FIND_FUNC_NO_LIBS(getsockopt,,
1637[#ifdef HAVE_SYS_TYPES_H
1638#include <sys/types.h>
1639#endif
1640#ifdef HAVE_SYS_SOCKET_H
1641#include <sys/socket.h>
1642#endif],
1643[0,0,0,0,0])
1644AC_FIND_FUNC_NO_LIBS(setsockopt,,
1645[#ifdef HAVE_SYS_TYPES_H
1646#include <sys/types.h>
1647#endif
1648#ifdef HAVE_SYS_SOCKET_H
1649#include <sys/socket.h>
1650#endif],
1651[0,0,0,0,0])
1652
1653AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
1654[#ifdef HAVE_NETDB_H
1655#include <netdb.h>
1656#endif],
165717)
1658if test "$ac_cv_func_hstrerror" = yes; then
1659AC_NEED_PROTO([
1660#ifdef HAVE_NETDB_H
1661#include <netdb.h>
1662#endif],
1663hstrerror)
1664fi
1665
1666dnl sigh, wish this could be done in a loop
1667if test "$ac_cv_func_asprintf" = yes; then
1668AC_NEED_PROTO([
1669#include <stdio.h>
1670#include <string.h>],
1671asprintf)dnl
1672fi
1673if test "$ac_cv_func_vasprintf" = yes; then
1674AC_NEED_PROTO([
1675#include <stdio.h>
1676#include <string.h>],
1677vasprintf)dnl
1678fi
1679if test "$ac_cv_func_asnprintf" = yes; then
1680AC_NEED_PROTO([
1681#include <stdio.h>
1682#include <string.h>],
1683asnprintf)dnl
1684fi
1685if test "$ac_cv_func_vasnprintf" = yes; then
1686AC_NEED_PROTO([
1687#include <stdio.h>
1688#include <string.h>],
1689vasnprintf)dnl
1690fi
1691
1692AC_FIND_FUNC_NO_LIBS(bswap16,,
1693[#ifdef HAVE_SYS_BSWAP_H
1694#include <sys/bswap.h>
1695#endif],0)
1696
1697AC_FIND_FUNC_NO_LIBS(bswap32,,
1698[#ifdef HAVE_SYS_BSWAP_H
1699#include <sys/bswap.h>
1700#endif],0)
1701
1702AC_FIND_FUNC_NO_LIBS(pidfile,util,
1703[#ifdef HAVE_UTIL_H
1704#include <util.h>
1705#endif],0)
1706
1707AC_FIND_IF_NOT_BROKEN(getaddrinfo,,
1708[#ifdef HAVE_NETDB_H
1709#include <netdb.h>
1710#endif],[0,0,0,0])
1711
1712AC_FIND_IF_NOT_BROKEN(getnameinfo,,
1713[#ifdef HAVE_NETDB_H
1714#include <netdb.h>
1715#endif],[0,0,0,0,0,0,0])
1716
1717AC_FIND_IF_NOT_BROKEN(freeaddrinfo,,
1718[#ifdef HAVE_NETDB_H
1719#include <netdb.h>
1720#endif],[0])
1721
1722AC_FIND_IF_NOT_BROKEN(gai_strerror,,
1723[#ifdef HAVE_NETDB_H
1724#include <netdb.h>
1725#endif],[0])
1726
1727AC_BROKEN([					\
1728	chown					\
1729	copyhostent				\
1730	daemon					\
1731	ecalloc					\
1732	emalloc					\
1733	erealloc				\
1734	estrdup					\
1735	err					\
1736	errx					\
1737	fchown					\
1738	flock					\
1739	fnmatch					\
1740	freehostent				\
1741	getcwd					\
1742	getdtablesize				\
1743	getegid					\
1744	geteuid					\
1745	getgid					\
1746	gethostname				\
1747	getifaddrs				\
1748	getipnodebyaddr				\
1749	getipnodebyname				\
1750	getopt					\
1751	gettimeofday				\
1752	getuid					\
1753	getusershell				\
1754	initgroups				\
1755	innetgr					\
1756	iruserok				\
1757	localtime_r				\
1758	lstat					\
1759	memmove					\
1760	mkstemp					\
1761	putenv					\
1762	rcmd					\
1763	readv					\
1764	recvmsg					\
1765	sendmsg					\
1766	setegid					\
1767	setenv					\
1768	seteuid					\
1769	strcasecmp				\
1770	strdup					\
1771	strerror				\
1772	strftime				\
1773	strlcat					\
1774	strlcpy					\
1775	strlwr					\
1776	strncasecmp				\
1777	strndup					\
1778	strnlen					\
1779	strptime				\
1780	strsep					\
1781	strsep_copy				\
1782	strtok_r				\
1783	strupr					\
1784	swab					\
1785	unsetenv				\
1786	verr					\
1787	verrx					\
1788	vsyslog					\
1789	vwarn					\
1790	vwarnx					\
1791	warn					\
1792	warnx					\
1793	writev					\
1794])
1795
1796AC_BROKEN2(inet_aton,
1797[#ifdef HAVE_SYS_TYPES_H
1798#include <sys/types.h>
1799#endif
1800#ifdef HAVE_SYS_SOCKET_H
1801#include <sys/socket.h>
1802#endif
1803#ifdef HAVE_NETINET_IN_H
1804#include <netinet/in.h>
1805#endif
1806#ifdef HAVE_ARPA_INET_H
1807#include <arpa/inet.h>
1808#endif],
1809[0,0])
1810
1811AC_BROKEN2(inet_ntop,
1812[#ifdef HAVE_SYS_TYPES_H
1813#include <sys/types.h>
1814#endif
1815#ifdef HAVE_SYS_SOCKET_H
1816#include <sys/socket.h>
1817#endif
1818#ifdef HAVE_NETINET_IN_H
1819#include <netinet/in.h>
1820#endif
1821#ifdef HAVE_ARPA_INET_H
1822#include <arpa/inet.h>
1823#endif],
1824[0, 0, 0, 0])
1825
1826AC_BROKEN2(inet_pton,
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[0,0,0])
1840
1841dnl
1842dnl Check for sa_len in struct sockaddr, 
1843dnl needs to come before the getnameinfo test
1844dnl
1845AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
1846#include <sys/socket.h>])
1847
1848if test "$ac_cv_func_getnameinfo" = "yes"; then
1849  rk_BROKEN_GETNAMEINFO
1850  if test "$ac_cv_func_getnameinfo_broken" = yes; then
1851    LIBOBJS="$LIBOBJS getnameinfo.o"
1852  fi
1853fi
1854
1855if test "$ac_cv_func_getaddrinfo" = "yes"; then
1856  rk_BROKEN_GETADDRINFO
1857  if test "$ac_cv_func_getaddrinfo_numserv" = no; then
1858    LIBOBJS="$LIBOBJS getaddrinfo.o freeaddrinfo.o"
1859  fi
1860fi
1861
1862AC_NEED_PROTO([#include <stdlib.h>], setenv)
1863AC_NEED_PROTO([#include <stdlib.h>], unsetenv)
1864AC_NEED_PROTO([#include <unistd.h>], gethostname)
1865AC_NEED_PROTO([#include <unistd.h>], mkstemp)
1866AC_NEED_PROTO([#include <unistd.h>], getusershell)
1867
1868AC_NEED_PROTO([
1869#ifdef HAVE_SYS_TYPES_H
1870#include <sys/types.h>
1871#endif
1872#ifdef HAVE_SYS_SOCKET_H
1873#include <sys/socket.h>
1874#endif
1875#ifdef HAVE_NETINET_IN_H
1876#include <netinet/in.h>
1877#endif
1878#ifdef HAVE_ARPA_INET_H
1879#include <arpa/inet.h>
1880#endif],
1881inet_aton)
1882
1883AC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl
1884
1885AC_REQUIRE([rk_BROKEN_REALLOC])dnl
1886
1887dnl AC_KRB_FUNC_GETCWD_BROKEN
1888
1889dnl
1890dnl Checks for prototypes and declarations
1891dnl
1892
1893AC_PROTO_COMPAT([
1894#ifdef HAVE_SYS_TYPES_H
1895#include <sys/types.h>
1896#endif
1897#ifdef HAVE_SYS_SOCKET_H
1898#include <sys/socket.h>
1899#endif
1900#ifdef HAVE_NETINET_IN_H
1901#include <netinet/in.h>
1902#endif
1903#ifdef HAVE_ARPA_INET_H
1904#include <arpa/inet.h>
1905#endif
1906#ifdef HAVE_NETDB_H
1907#include <netdb.h>
1908#endif
1909],
1910gethostbyname, struct hostent *gethostbyname(const char *))
1911
1912AC_PROTO_COMPAT([
1913#ifdef HAVE_SYS_TYPES_H
1914#include <sys/types.h>
1915#endif
1916#ifdef HAVE_SYS_SOCKET_H
1917#include <sys/socket.h>
1918#endif
1919#ifdef HAVE_NETINET_IN_H
1920#include <netinet/in.h>
1921#endif
1922#ifdef HAVE_ARPA_INET_H
1923#include <arpa/inet.h>
1924#endif
1925#ifdef HAVE_NETDB_H
1926#include <netdb.h>
1927#endif
1928],
1929gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
1930
1931AC_PROTO_COMPAT([
1932#ifdef HAVE_SYS_TYPES_H
1933#include <sys/types.h>
1934#endif
1935#ifdef HAVE_SYS_SOCKET_H
1936#include <sys/socket.h>
1937#endif
1938#ifdef HAVE_NETINET_IN_H
1939#include <netinet/in.h>
1940#endif
1941#ifdef HAVE_ARPA_INET_H
1942#include <arpa/inet.h>
1943#endif
1944#ifdef HAVE_NETDB_H
1945#include <netdb.h>
1946#endif
1947],
1948getservbyname, struct servent *getservbyname(const char *, const char *))
1949
1950AC_PROTO_COMPAT([
1951#ifdef HAVE_SYS_TYPES_H
1952#include <sys/types.h>
1953#endif
1954#ifdef HAVE_SYS_SOCKET_H
1955#include <sys/socket.h>
1956#endif
1957],
1958getsockname, int getsockname(int, struct sockaddr*, socklen_t*))
1959
1960AC_PROTO_COMPAT([
1961#ifdef HAVE_SYSLOG_H
1962#include <syslog.h>
1963#endif
1964],
1965openlog, void openlog(const char *, int, int))
1966
1967AC_NEED_PROTO([
1968#ifdef HAVE_CRYPT_H
1969#include <crypt.h>
1970#endif
1971#ifdef HAVE_UNISTD_H
1972#include <unistd.h>
1973#endif
1974],
1975crypt)
1976
1977AC_NEED_PROTO([
1978#include <string.h>
1979],
1980strtok_r)
1981
1982AC_NEED_PROTO([
1983#include <string.h>
1984],
1985strsep)
1986
1987dnl variables
1988
1989rk_CHECK_VAR(h_errno, 
1990[#ifdef HAVE_SYS_TYPES_H
1991#include <sys/types.h>
1992#endif
1993#ifdef HAVE_NETDB_H
1994#include <netdb.h>
1995#endif])
1996
1997rk_CHECK_VAR(h_errlist, 
1998[#ifdef HAVE_NETDB_H
1999#include <netdb.h>
2000#endif])
2001
2002rk_CHECK_VAR(h_nerr, 
2003[#ifdef HAVE_NETDB_H
2004#include <netdb.h>
2005#endif])
2006
2007rk_CHECK_VAR([__progname], 
2008[#ifdef HAVE_ERR_H
2009#include <err.h>
2010#endif])
2011
2012AC_CHECK_DECLARATION([#include <stdlib.h>
2013#ifdef HAVE_UNISTD_H
2014#include <unistd.h>
2015#endif], optarg)
2016AC_CHECK_DECLARATION([#include <stdlib.h>
2017#ifdef HAVE_UNISTD_H
2018#include <unistd.h>
2019#endif], optind)
2020AC_CHECK_DECLARATION([#include <stdlib.h>
2021#ifdef HAVE_UNISTD_H
2022#include <unistd.h>
2023#endif], opterr)
2024AC_CHECK_DECLARATION([#include <stdlib.h>
2025#ifdef HAVE_UNISTD_H
2026#include <unistd.h>
2027#endif], optopt)
2028
2029AC_CHECK_DECLARATION([#include <stdlib.h>], environ)
2030
2031dnl
2032dnl Check for fields in struct tm
2033dnl
2034
2035AC_HAVE_STRUCT_FIELD(struct tm, tm_gmtoff, [#include <time.h>])
2036AC_HAVE_STRUCT_FIELD(struct tm, tm_zone, [#include <time.h>])
2037
2038dnl
2039dnl or do we have a variable `timezone' ?
2040dnl
2041
2042rk_CHECK_VAR(timezone,[#include <time.h>])
2043
2044AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
2045AC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
2046AC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
2047AC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/socket.h>])
2048AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
2049AC_HAVE_TYPE([struct ifaddrs], [#include <ifaddrs.h>])
2050
2051dnl
2052dnl Check for struct winsize
2053dnl
2054
2055AC_KRB_STRUCT_WINSIZE
2056
2057dnl
2058dnl Check for struct spwd
2059dnl
2060
2061AC_KRB_STRUCT_SPWD
2062
2063dnl won't work with automake
2064dnl moved to AC_OUTPUT in configure.in
2065dnl AC_CONFIG_FILES($1/Makefile)
2066
2067LIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
2068
2069AC_SUBST(DIR_roken)dnl
2070AC_SUBST(LIB_roken)dnl
2071AC_SUBST(INCLUDES_roken)dnl
2072])
2073
2074dnl $Id: check-type-extra.m4,v 1.2 1999/03/01 09:52:23 joda Exp $
2075dnl
2076dnl ac_check_type + extra headers
2077
2078dnl AC_CHECK_TYPE_EXTRA(TYPE, DEFAULT, HEADERS)
2079AC_DEFUN(AC_CHECK_TYPE_EXTRA,
2080[AC_REQUIRE([AC_HEADER_STDC])dnl
2081AC_MSG_CHECKING(for $1)
2082AC_CACHE_VAL(ac_cv_type_$1,
2083[AC_EGREP_CPP(dnl
2084changequote(<<,>>)dnl
2085<<$1[^a-zA-Z_0-9]>>dnl
2086changequote([,]), [#include <sys/types.h>
2087#if STDC_HEADERS
2088#include <stdlib.h>
2089#include <stddef.h>
2090#endif
2091$3], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
2092AC_MSG_RESULT($ac_cv_type_$1)
2093if test $ac_cv_type_$1 = no; then
2094  AC_DEFINE($1, $2, [Define this to what the type $1 should be.])
2095fi
2096])
2097
2098dnl $Id: have-type.m4,v 1.6 2000/07/15 18:10:00 joda Exp $
2099dnl
2100dnl check for existance of a type
2101
2102dnl AC_HAVE_TYPE(TYPE,INCLUDES)
2103AC_DEFUN(AC_HAVE_TYPE, [
2104AC_REQUIRE([AC_HEADER_STDC])
2105cv=`echo "$1" | sed 'y%./+- %__p__%'`
2106AC_MSG_CHECKING(for $1)
2107AC_CACHE_VAL([ac_cv_type_$cv],
2108AC_TRY_COMPILE(
2109[#include <sys/types.h>
2110#if STDC_HEADERS
2111#include <stdlib.h>
2112#include <stddef.h>
2113#endif
2114$2],
2115[$1 foo;],
2116eval "ac_cv_type_$cv=yes",
2117eval "ac_cv_type_$cv=no"))dnl
2118ac_foo=`eval echo \\$ac_cv_type_$cv`
2119AC_MSG_RESULT($ac_foo)
2120if test "$ac_foo" = yes; then
2121  ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'`
2122if false; then
2123	AC_CHECK_TYPES($1)
2124fi
2125  AC_DEFINE_UNQUOTED($ac_tr_hdr, 1, [Define if you have type `$1'])
2126fi
2127])
2128
2129dnl
2130dnl $Id: retsigtype.m4,v 1.1 2000/07/15 18:05:56 joda Exp $
2131dnl
2132dnl Figure out return type of signal handlers, and define SIGRETURN macro
2133dnl that can be used to return from one
2134dnl
2135AC_DEFUN(rk_RETSIGTYPE,[
2136AC_TYPE_SIGNAL
2137if test "$ac_cv_type_signal" = "void" ; then
2138	AC_DEFINE(VOID_RETSIGTYPE, 1, [Define if signal handlers return void.])
2139fi
2140AC_SUBST(VOID_RETSIGTYPE)
2141AH_BOTTOM([#ifdef VOID_RETSIGTYPE
2142#define SIGRETURN(x) return
2143#else
2144#define SIGRETURN(x) return (RETSIGTYPE)(x)
2145#endif])
2146])
2147dnl
2148dnl $Id: check-netinet-ip-and-tcp.m4,v 1.3 2000/07/18 10:33:02 joda Exp $
2149dnl
2150
2151dnl extra magic check for netinet/{ip.h,tcp.h} because on irix 6.5.3
2152dnl you have to include standards.h before including these files
2153
2154AC_DEFUN(CHECK_NETINET_IP_AND_TCP,
2155[
2156AC_CHECK_HEADERS(standards.h)
2157for i in netinet/ip.h netinet/tcp.h; do
2158
2159cv=`echo "$i" | sed 'y%./+-%__p_%'`
2160
2161AC_CACHE_CHECK([for $i],ac_cv_header_$cv,
2162[AC_TRY_CPP([\
2163#ifdef HAVE_STANDARDS_H
2164#include <standards.h>
2165#endif
2166#include <$i>
2167],
2168eval "ac_cv_header_$cv=yes",
2169eval "ac_cv_header_$cv=no")])
2170ac_res=`eval echo \\$ac_cv_header_$cv`
2171if test "$ac_res" = yes; then
2172	ac_tr_hdr=HAVE_`echo $i | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2173	AC_DEFINE_UNQUOTED($ac_tr_hdr, 1)
2174fi
2175done
2176if false;then
2177	AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h)
2178fi
2179])
2180
2181dnl $Id: find-func.m4,v 1.1 1997/12/14 15:58:58 joda Exp $
2182dnl
2183dnl AC_FIND_FUNC(func, libraries, includes, arguments)
2184AC_DEFUN(AC_FIND_FUNC, [
2185AC_FIND_FUNC_NO_LIBS([$1], [$2], [$3], [$4])
2186if test -n "$LIB_$1"; then
2187	LIBS="$LIB_$1 $LIBS"
2188fi
2189])
2190
2191dnl $Id: krb-ipv6.m4,v 1.12 2001/08/19 16:27:02 joda Exp $
2192dnl
2193dnl test for IPv6
2194dnl
2195AC_DEFUN(AC_KRB_IPV6, [
2196AC_ARG_WITH(ipv6,
2197[  --without-ipv6	do not enable IPv6 support],[
2198if test "$withval" = "no"; then
2199	ac_cv_lib_ipv6=no
2200fi])
2201save_CFLAGS="${CFLAGS}"
2202AC_CACHE_VAL(ac_cv_lib_ipv6,
2203[dnl check for different v6 implementations (by itojun)
2204v6type=unknown
2205v6lib=none
2206
2207AC_MSG_CHECKING([ipv6 stack type])
2208for i in v6d toshiba kame inria zeta linux; do
2209	case $i in
2210	v6d)
2211		AC_EGREP_CPP(yes, [
2212#include </usr/local/v6/include/sys/types.h>
2213#ifdef __V6D__
2214yes
2215#endif],
2216			[v6type=$i; v6lib=v6;
2217			v6libdir=/usr/local/v6/lib;
2218			CFLAGS="-I/usr/local/v6/include $CFLAGS"])
2219		;;
2220	toshiba)
2221		AC_EGREP_CPP(yes, [
2222#include <sys/param.h>
2223#ifdef _TOSHIBA_INET6
2224yes
2225#endif],
2226			[v6type=$i; v6lib=inet6;
2227			v6libdir=/usr/local/v6/lib;
2228			CFLAGS="-DINET6 $CFLAGS"])
2229		;;
2230	kame)
2231		AC_EGREP_CPP(yes, [
2232#include <netinet/in.h>
2233#ifdef __KAME__
2234yes
2235#endif],
2236			[v6type=$i; v6lib=inet6;
2237			v6libdir=/usr/local/v6/lib;
2238			CFLAGS="-DINET6 $CFLAGS"])
2239		;;
2240	inria)
2241		AC_EGREP_CPP(yes, [
2242#include <netinet/in.h>
2243#ifdef IPV6_INRIA_VERSION
2244yes
2245#endif],
2246			[v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
2247		;;
2248	zeta)
2249		AC_EGREP_CPP(yes, [
2250#include <sys/param.h>
2251#ifdef _ZETA_MINAMI_INET6
2252yes
2253#endif],
2254			[v6type=$i; v6lib=inet6;
2255			v6libdir=/usr/local/v6/lib;
2256			CFLAGS="-DINET6 $CFLAGS"])
2257		;;
2258	linux)
2259		if test -d /usr/inet6; then
2260			v6type=$i
2261			v6lib=inet6
2262			v6libdir=/usr/inet6
2263			CFLAGS="-DINET6 $CFLAGS"
2264		fi
2265		;;
2266	esac
2267	if test "$v6type" != "unknown"; then
2268		break
2269	fi
2270done
2271AC_MSG_RESULT($v6type)
2272
2273if test "$v6lib" != "none"; then
2274	for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
2275		if test -d $dir -a -f $dir/lib$v6lib.a; then
2276			LIBS="-L$dir -l$v6lib $LIBS"
2277			break
2278		fi
2279	done
2280fi
2281AC_TRY_LINK([
2282#ifdef HAVE_SYS_TYPES_H
2283#include <sys/types.h>
2284#endif
2285#ifdef HAVE_SYS_SOCKET_H
2286#include <sys/socket.h>
2287#endif
2288#ifdef HAVE_NETINET_IN_H
2289#include <netinet/in.h>
2290#endif
2291#ifdef HAVE_NETINET_IN6_H
2292#include <netinet/in6.h>
2293#endif
2294],
2295[
2296 struct sockaddr_in6 sin6;
2297 int s;
2298
2299 s = socket(AF_INET6, SOCK_DGRAM, 0);
2300
2301 sin6.sin6_family = AF_INET6;
2302 sin6.sin6_port = htons(17);
2303 sin6.sin6_addr = in6addr_any;
2304 bind(s, (struct sockaddr *)&sin6, sizeof(sin6));
2305],
2306ac_cv_lib_ipv6=yes,
2307ac_cv_lib_ipv6=no)])
2308AC_MSG_CHECKING(for IPv6)
2309AC_MSG_RESULT($ac_cv_lib_ipv6)
2310if test "$ac_cv_lib_ipv6" = yes; then
2311  AC_DEFINE(HAVE_IPV6, 1, [Define if you have IPv6.])
2312else
2313  CFLAGS="${save_CFLAGS}"
2314fi
2315
2316if test "$ac_cv_lib_ipv6" = yes; then
2317	AC_CACHE_CHECK([for in6addr_loopback],[ac_cv_var_in6addr_loopback],[
2318	AC_TRY_LINK([
2319#ifdef HAVE_SYS_TYPES_H
2320#include <sys/types.h>
2321#endif
2322#ifdef HAVE_SYS_SOCKET_H
2323#include <sys/socket.h>
2324#endif
2325#ifdef HAVE_NETINET_IN_H
2326#include <netinet/in.h>
2327#endif
2328#ifdef HAVE_NETINET_IN6_H
2329#include <netinet/in6.h>
2330#endif],[
2331struct sockaddr_in6 sin6;
2332sin6.sin6_addr = in6addr_loopback;
2333],ac_cv_var_in6addr_loopback=yes,ac_cv_var_in6addr_loopback=no)])
2334	if test "$ac_cv_var_in6addr_loopback" = yes; then
2335		AC_DEFINE(HAVE_IN6ADDR_LOOPBACK, 1, 
2336			[Define if you have the in6addr_loopback variable])
2337	fi
2338fi
2339])
2340dnl $Id: broken-snprintf.m4,v 1.4 2001/09/01 11:56:05 assar Exp $
2341dnl
2342AC_DEFUN(AC_BROKEN_SNPRINTF, [
2343AC_CACHE_CHECK(for working snprintf,ac_cv_func_snprintf_working,
2344ac_cv_func_snprintf_working=yes
2345AC_TRY_RUN([
2346#include <stdio.h>
2347#include <string.h>
2348int main()
2349{
2350	char foo[[3]];
2351	snprintf(foo, 2, "12");
2352	return strcmp(foo, "1");
2353}],:,ac_cv_func_snprintf_working=no,:))
2354
2355if test "$ac_cv_func_snprintf_working" = yes; then
2356	AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [define if you have a working snprintf])
2357fi
2358if test "$ac_cv_func_snprintf_working" = yes; then
2359AC_NEED_PROTO([#include <stdio.h>],snprintf)
2360fi
2361])
2362
2363AC_DEFUN(AC_BROKEN_VSNPRINTF,[
2364AC_CACHE_CHECK(for working vsnprintf,ac_cv_func_vsnprintf_working,
2365ac_cv_func_vsnprintf_working=yes
2366AC_TRY_RUN([
2367#include <stdio.h>
2368#include <string.h>
2369#include <stdarg.h>
2370
2371int foo(int num, ...)
2372{
2373	char bar[[3]];
2374	va_list arg;
2375	va_start(arg, num);
2376	vsnprintf(bar, 2, "%s", arg);
2377	va_end(arg);
2378	return strcmp(bar, "1");
2379}
2380
2381
2382int main()
2383{
2384	return foo(0, "12");
2385}],:,ac_cv_func_vsnprintf_working=no,:))
2386
2387if test "$ac_cv_func_vsnprintf_working" = yes; then
2388	AC_DEFINE_UNQUOTED(HAVE_VSNPRINTF, 1, [define if you have a working vsnprintf])
2389fi
2390if test "$ac_cv_func_vsnprintf_working" = yes; then
2391AC_NEED_PROTO([#include <stdio.h>],vsnprintf)
2392fi
2393])
2394
2395dnl $Id: need-proto.m4,v 1.2 1999/03/01 09:52:24 joda Exp $
2396dnl
2397dnl
2398dnl Check if we need the prototype for a function
2399dnl
2400
2401dnl AC_NEED_PROTO(includes, function)
2402
2403AC_DEFUN(AC_NEED_PROTO, [
2404if test "$ac_cv_func_$2+set" != set -o "$ac_cv_func_$2" = yes; then
2405AC_CACHE_CHECK([if $2 needs a prototype], ac_cv_func_$2_noproto,
2406AC_TRY_COMPILE([$1],
2407[struct foo { int foo; } xx;
2408extern int $2 (struct foo*);
2409$2(&xx);
2410],
2411eval "ac_cv_func_$2_noproto=yes",
2412eval "ac_cv_func_$2_noproto=no"))
2413define([foo], [NEED_]translit($2, [a-z], [A-Z])[_PROTO])
2414if test "$ac_cv_func_$2_noproto" = yes; then
2415	AC_DEFINE(foo, 1, [define if the system is missing a prototype for $2()])
2416fi
2417undefine([foo])
2418fi
2419])
2420
2421dnl $Id: broken-glob.m4,v 1.4 2001/06/19 09:59:46 assar Exp $
2422dnl
2423dnl check for glob(3)
2424dnl
2425AC_DEFUN(AC_BROKEN_GLOB,[
2426AC_CACHE_CHECK(for working glob, ac_cv_func_glob_working,
2427ac_cv_func_glob_working=yes
2428AC_TRY_LINK([
2429#include <stdio.h>
2430#include <glob.h>],[
2431glob(NULL, GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE|
2432#ifdef GLOB_MAXPATH
2433GLOB_MAXPATH
2434#else
2435GLOB_LIMIT
2436#endif
2437,
2438NULL, NULL);
2439],:,ac_cv_func_glob_working=no,:))
2440
2441if test "$ac_cv_func_glob_working" = yes; then
2442	AC_DEFINE(HAVE_GLOB, 1, [define if you have a glob() that groks 
2443	GLOB_BRACE, GLOB_NOCHECK, GLOB_QUOTE, GLOB_TILDE, and GLOB_LIMIT])
2444fi
2445if test "$ac_cv_func_glob_working" = yes; then
2446AC_NEED_PROTO([#include <stdio.h>
2447#include <glob.h>],glob)
2448fi
2449])
2450
2451dnl
2452dnl $Id: krb-func-getlogin.m4,v 1.1 1999/07/13 17:45:30 assar Exp $
2453dnl
2454dnl test for POSIX (broken) getlogin
2455dnl
2456
2457
2458AC_DEFUN(AC_FUNC_GETLOGIN, [
2459AC_CHECK_FUNCS(getlogin setlogin)
2460if test "$ac_cv_func_getlogin" = yes; then
2461AC_CACHE_CHECK(if getlogin is posix, ac_cv_func_getlogin_posix, [
2462if test "$ac_cv_func_getlogin" = yes -a "$ac_cv_func_setlogin" = yes; then
2463	ac_cv_func_getlogin_posix=no
2464else
2465	ac_cv_func_getlogin_posix=yes
2466fi
2467])
2468if test "$ac_cv_func_getlogin_posix" = yes; then
2469	AC_DEFINE(POSIX_GETLOGIN, 1, [Define if getlogin has POSIX flavour (and not BSD).])
2470fi
2471fi
2472])
2473
2474dnl $Id: find-if-not-broken.m4,v 1.2 1998/03/16 22:16:27 joda Exp $
2475dnl
2476dnl
2477dnl Mix between AC_FIND_FUNC and AC_BROKEN
2478dnl
2479
2480AC_DEFUN(AC_FIND_IF_NOT_BROKEN,
2481[AC_FIND_FUNC([$1], [$2], [$3], [$4])
2482if eval "test \"$ac_cv_func_$1\" != yes"; then
2483LIBOBJS[]="$LIBOBJS $1.o"
2484fi
2485AC_SUBST(LIBOBJS)dnl
2486])
2487
2488dnl $Id: broken.m4,v 1.4 2000/07/15 18:06:36 joda Exp $
2489dnl
2490dnl
2491dnl Same as AC _REPLACE_FUNCS, just define HAVE_func if found in normal
2492dnl libraries 
2493
2494AC_DEFUN(AC_BROKEN,
2495[for ac_func in $1
2496do
2497AC_CHECK_FUNC($ac_func, [
2498ac_tr_func=HAVE_[]upcase($ac_func)
2499AC_DEFINE_UNQUOTED($ac_tr_func)],[LIBOBJS[]="$LIBOBJS ${ac_func}.o"])
2500if false; then
2501	AC_CHECK_FUNCS($1)
2502fi
2503done
2504AC_SUBST(LIBOBJS)dnl
2505])
2506
2507dnl $Id: broken2.m4,v 1.1 2000/12/15 14:27:33 assar Exp $
2508dnl
2509dnl AC_BROKEN but with more arguments
2510
2511dnl AC_BROKEN2(func, includes, arguments)
2512AC_DEFUN(AC_BROKEN2,
2513[for ac_func in $1
2514do
2515AC_MSG_CHECKING([for $ac_func])
2516AC_CACHE_VAL(ac_cv_func_$ac_func,
2517[AC_TRY_LINK([$2],
2518[
2519/* The GNU C library defines this for functions which it implements
2520    to always fail with ENOSYS.  Some functions are actually named
2521    something starting with __ and the normal name is an alias.  */
2522#if defined (__stub_$1) || defined (__stub___$1)
2523choke me
2524#else
2525$ac_func($3)
2526#endif
2527], [eval "ac_cv_func_$ac_func=yes"], [eval "ac_cv_func_$ac_func=no"])])
2528if eval "test \"\${ac_cv_func_$ac_func}\" = yes"; then
2529  ac_tr_func=HAVE_[]upcase($ac_func)
2530  AC_DEFINE_UNQUOTED($ac_tr_func)
2531  AC_MSG_RESULT(yes)
2532else
2533  AC_MSG_RESULT(no)
2534  LIBOBJS[]="$LIBOBJS ${ac_func}.o"
2535fi
2536done
2537if false; then
2538	AC_CHECK_FUNCS($1)
2539fi
2540AC_SUBST(LIBOBJS)dnl
2541])
2542
2543dnl $Id: have-struct-field.m4,v 1.6 1999/07/29 01:44:32 assar Exp $
2544dnl
2545dnl check for fields in a structure
2546dnl
2547dnl AC_HAVE_STRUCT_FIELD(struct, field, headers)
2548
2549AC_DEFUN(AC_HAVE_STRUCT_FIELD, [
2550define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_]))
2551AC_CACHE_CHECK([for $2 in $1], cache_val,[
2552AC_TRY_COMPILE([$3],[$1 x; x.$2;],
2553cache_val=yes,
2554cache_val=no)])
2555if test "$cache_val" = yes; then
2556	define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_]))
2557	AC_DEFINE(foo, 1, [Define if $1 has field $2.])
2558	undefine([foo])
2559fi
2560undefine([cache_val])
2561])
2562
2563dnl $Id: broken-getnameinfo.m4,v 1.2 2000/12/05 09:09:00 joda Exp $
2564dnl
2565dnl test for broken AIX getnameinfo
2566
2567AC_DEFUN(rk_BROKEN_GETNAMEINFO,[
2568AC_CACHE_CHECK([if getnameinfo is broken], ac_cv_func_getnameinfo_broken,
2569AC_TRY_RUN([[#include <stdio.h>
2570#include <sys/types.h>
2571#include <sys/socket.h>
2572#include <netinet/in.h>
2573#include <netdb.h>
2574
2575int
2576main(int argc, char **argv)
2577{
2578  struct sockaddr_in sin;
2579  char host[256];
2580  memset(&sin, 0, sizeof(sin));
2581#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
2582  sin.sin_len = sizeof(sin);
2583#endif
2584  sin.sin_family = AF_INET;
2585  sin.sin_addr.s_addr = 0xffffffff;
2586  sin.sin_port = 0;
2587  return getnameinfo((struct sockaddr*)&sin, sizeof(sin), host, sizeof(host),
2588	      NULL, 0, 0);
2589}
2590]], ac_cv_func_getnameinfo_broken=no, ac_cv_func_getnameinfo_broken=yes))])
2591
2592dnl $Id: broken-getaddrinfo.m4,v 1.2 2001/08/22 01:05:29 assar Exp $
2593dnl
2594dnl test if getaddrinfo can handle numeric services
2595
2596AC_DEFUN(rk_BROKEN_GETADDRINFO,[
2597AC_CACHE_CHECK([if getaddrinfo handles numeric services], ac_cv_func_getaddrinfo_numserv,
2598AC_TRY_RUN([[#include <stdio.h>
2599#include <sys/types.h>
2600#include <sys/socket.h>
2601#include <netdb.h>
2602
2603int
2604main(int argc, char **argv)
2605{
2606	struct addrinfo hints, *ai;
2607	memset(&hints, 0, sizeof(hints));
2608	hints.ai_flags = AI_PASSIVE;
2609	hints.ai_socktype = SOCK_STREAM;
2610	hints.ai_family = PF_UNSPEC;
2611	if(getaddrinfo(NULL, "17", &hints, &ai) == EAI_SERVICE)
2612		return 1;
2613	return 0;
2614}
2615]], ac_cv_func_getaddrinfo_numserv=yes, ac_cv_func_getaddrinfo_numserv=no))])
2616
2617dnl
2618dnl $Id: broken-realloc.m4,v 1.1 2000/07/15 18:05:36 joda Exp $
2619dnl
2620dnl Test for realloc that doesn't handle NULL as first parameter
2621dnl
2622AC_DEFUN(rk_BROKEN_REALLOC, [
2623AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
2624ac_cv_func_realloc_broken=no
2625AC_TRY_RUN([
2626#include <stddef.h>
2627#include <stdlib.h>
2628
2629int main()
2630{
2631	return realloc(NULL, 17) == NULL;
2632}
2633],:, ac_cv_func_realloc_broken=yes, :)
2634])
2635if test "$ac_cv_func_realloc_broken" = yes ; then
2636	AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.])
2637fi
2638AH_BOTTOM([#ifdef BROKEN_REALLOC
2639#define realloc(X, Y) isoc_realloc((X), (Y))
2640#define isoc_realloc(X, Y) ((X) ? realloc((X), (Y)) : malloc(Y))
2641#endif])
2642])
2643
2644dnl $Id: proto-compat.m4,v 1.3 1999/03/01 13:03:48 joda Exp $
2645dnl
2646dnl
2647dnl Check if the prototype of a function is compatible with another one
2648dnl
2649
2650dnl AC_PROTO_COMPAT(includes, function, prototype)
2651
2652AC_DEFUN(AC_PROTO_COMPAT, [
2653AC_CACHE_CHECK([if $2 is compatible with system prototype],
2654ac_cv_func_$2_proto_compat,
2655AC_TRY_COMPILE([$1],
2656[$3;],
2657eval "ac_cv_func_$2_proto_compat=yes",
2658eval "ac_cv_func_$2_proto_compat=no"))
2659define([foo], translit($2, [a-z], [A-Z])[_PROTO_COMPATIBLE])
2660if test "$ac_cv_func_$2_proto_compat" = yes; then
2661	AC_DEFINE(foo, 1, [define if prototype of $2 is compatible with
2662	$3])
2663fi
2664undefine([foo])
2665])
2666dnl $Id: check-var.m4,v 1.6 2001/08/21 12:00:16 joda Exp $
2667dnl
2668dnl rk_CHECK_VAR(variable, includes)
2669AC_DEFUN([rk_CHECK_VAR], [
2670AC_MSG_CHECKING(for $1)
2671AC_CACHE_VAL(ac_cv_var_$1, [
2672AC_TRY_LINK([extern int $1;
2673int foo() { return $1; }],
2674	    [foo()],
2675	    ac_cv_var_$1=yes, ac_cv_var_$1=no)
2676])
2677ac_foo=`eval echo \\$ac_cv_var_$1`
2678AC_MSG_RESULT($ac_foo)
2679if test "$ac_foo" = yes; then
2680	AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]$1), 1, 
2681		[Define if you have the `]$1[' variable.])
2682	m4_ifval([$2], AC_CHECK_DECLARATION([$2],[$1]))
2683fi
2684])
2685
2686AC_WARNING_ENABLE([obsolete])
2687AU_DEFUN([AC_CHECK_VAR], [rk_CHECK_VAR([$2], [$1])], [foo])
2688dnl $Id: check-declaration.m4,v 1.3 1999/03/01 13:03:08 joda Exp $
2689dnl
2690dnl
2691dnl Check if we need the declaration of a variable
2692dnl
2693
2694dnl AC_HAVE_DECLARATION(includes, variable)
2695AC_DEFUN(AC_CHECK_DECLARATION, [
2696AC_MSG_CHECKING([if $2 is properly declared])
2697AC_CACHE_VAL(ac_cv_var_$2_declaration, [
2698AC_TRY_COMPILE([$1
2699extern struct { int foo; } $2;],
2700[$2.foo = 1;],
2701eval "ac_cv_var_$2_declaration=no",
2702eval "ac_cv_var_$2_declaration=yes")
2703])
2704
2705define(foo, [HAVE_]translit($2, [a-z], [A-Z])[_DECLARATION])
2706
2707AC_MSG_RESULT($ac_cv_var_$2_declaration)
2708if eval "test \"\$ac_cv_var_$2_declaration\" = yes"; then
2709	AC_DEFINE(foo, 1, [define if your system declares $2])
2710fi
2711undefine([foo])
2712])
2713
2714dnl $Id: krb-struct-winsize.m4,v 1.3 2001/09/01 11:56:05 assar Exp $
2715dnl
2716dnl
2717dnl Search for struct winsize
2718dnl
2719
2720AC_DEFUN(AC_KRB_STRUCT_WINSIZE, [
2721AC_MSG_CHECKING(for struct winsize)
2722AC_CACHE_VAL(ac_cv_struct_winsize, [
2723ac_cv_struct_winsize=no
2724for i in sys/termios.h sys/ioctl.h; do
2725AC_EGREP_HEADER(
2726struct[[ 	]]*winsize,dnl
2727$i, ac_cv_struct_winsize=yes; break)dnl
2728done
2729])
2730if test "$ac_cv_struct_winsize" = "yes"; then
2731  AC_DEFINE(HAVE_STRUCT_WINSIZE, 1, [define if struct winsize is declared in sys/termios.h])
2732fi
2733AC_MSG_RESULT($ac_cv_struct_winsize)
2734AC_EGREP_HEADER(ws_xpixel, termios.h, 
2735	AC_DEFINE(HAVE_WS_XPIXEL, 1, [define if struct winsize has ws_xpixel]))
2736AC_EGREP_HEADER(ws_ypixel, termios.h, 
2737	AC_DEFINE(HAVE_WS_YPIXEL, 1, [define if struct winsize has ws_ypixel]))
2738])
2739
2740dnl $Id: krb-struct-spwd.m4,v 1.3 1999/07/13 21:04:11 assar Exp $
2741dnl
2742dnl Test for `struct spwd'
2743
2744AC_DEFUN(AC_KRB_STRUCT_SPWD, [
2745AC_MSG_CHECKING(for struct spwd)
2746AC_CACHE_VAL(ac_cv_struct_spwd, [
2747AC_TRY_COMPILE(
2748[#include <pwd.h>
2749#ifdef HAVE_SHADOW_H
2750#include <shadow.h>
2751#endif],
2752[struct spwd foo;],
2753ac_cv_struct_spwd=yes,
2754ac_cv_struct_spwd=no)
2755])
2756AC_MSG_RESULT($ac_cv_struct_spwd)
2757
2758if test "$ac_cv_struct_spwd" = "yes"; then
2759  AC_DEFINE(HAVE_STRUCT_SPWD, 1, [define if you have struct spwd])
2760fi
2761])
2762
2763dnl $Id: test-package.m4,v 1.9 2000/12/15 04:54:24 assar Exp $
2764dnl
2765dnl AC_TEST_PACKAGE_NEW(package,headers,libraries,extra libs,default locations, conditional)
2766
2767AC_DEFUN(AC_TEST_PACKAGE,[AC_TEST_PACKAGE_NEW($1,[#include <$2>],$4,,$5)])
2768
2769AC_DEFUN(AC_TEST_PACKAGE_NEW,[
2770AC_ARG_WITH($1,
2771[  --with-$1=dir                use $1 in dir])
2772AC_ARG_WITH($1-lib,
2773[  --with-$1-lib=dir            use $1 libraries in dir],
2774[if test "$withval" = "yes" -o "$withval" = "no"; then
2775  AC_MSG_ERROR([No argument for --with-$1-lib])
2776elif test "X$with_$1" = "X"; then
2777  with_$1=yes
2778fi])
2779AC_ARG_WITH($1-include,
2780[  --with-$1-include=dir        use $1 headers in dir],
2781[if test "$withval" = "yes" -o "$withval" = "no"; then
2782  AC_MSG_ERROR([No argument for --with-$1-include])
2783elif test "X$with_$1" = "X"; then
2784  with_$1=yes
2785fi])
2786
2787AC_MSG_CHECKING(for $1)
2788
2789case "$with_$1" in
2790yes)	;;
2791no)	;;
2792"")	;;
2793*)	if test "$with_$1_include" = ""; then
2794		with_$1_include="$with_$1/include"
2795	fi
2796	if test "$with_$1_lib" = ""; then
2797		with_$1_lib="$with_$1/lib$abilibdirext"
2798	fi
2799	;;
2800esac
2801header_dirs=
2802lib_dirs=
2803d='$5'
2804for i in $d; do
2805	header_dirs="$header_dirs $i/include"
2806	lib_dirs="$lib_dirs $i/lib$abilibdirext"
2807done
2808
2809case "$with_$1_include" in
2810yes) ;;
2811no)  ;;
2812*)   header_dirs="$with_$1_include $header_dirs";;
2813esac
2814case "$with_$1_lib" in
2815yes) ;;
2816no)  ;;
2817*)   lib_dirs="$with_$1_lib $lib_dirs";;
2818esac
2819
2820save_CFLAGS="$CFLAGS"
2821save_LIBS="$LIBS"
2822ires= lres=
2823for i in $header_dirs; do
2824	CFLAGS="-I$i $save_CFLAGS"
2825	AC_TRY_COMPILE([$2],,ires=$i;break)
2826done
2827for i in $lib_dirs; do
2828	LIBS="-L$i $3 $4 $save_LIBS"
2829	AC_TRY_LINK([$2],,lres=$i;break)
2830done
2831CFLAGS="$save_CFLAGS"
2832LIBS="$save_LIBS"
2833
2834if test "$ires" -a "$lres" -a "$with_$1" != "no"; then
2835	$1_includedir="$ires"
2836	$1_libdir="$lres"
2837	INCLUDE_$1="-I$$1_includedir"
2838	LIB_$1="-L$$1_libdir $3"
2839	m4_ifval([$6],
2840		AC_DEFINE_UNQUOTED($6,1,[Define if you have the $1 package.]),
2841		AC_DEFINE_UNQUOTED(upcase($1),1,[Define if you have the $1 package.]))
2842	with_$1=yes
2843	AC_MSG_RESULT([headers $ires, libraries $lres])
2844else
2845	INCLUDE_$1=
2846	LIB_$1=
2847	with_$1=no
2848	AC_MSG_RESULT($with_$1)
2849fi
2850dnl m4_ifval([$6],
2851dnl 	AM_CONDITIONAL($6, test "$with_$1" = yes)
2852dnl 	AM_CONDITIONAL(upcase($1), test "$with_$1" = yes))
2853AC_SUBST(INCLUDE_$1)
2854AC_SUBST(LIB_$1)
2855])
2856
2857dnl $Id: osfc2.m4,v 1.2 1999/03/27 17:28:16 joda Exp $
2858dnl
2859dnl enable OSF C2 stuff
2860
2861AC_DEFUN(AC_CHECK_OSFC2,[
2862AC_ARG_ENABLE(osfc2,
2863[  --enable-osfc2          enable some OSF C2 support])
2864LIB_security=
2865if test "$enable_osfc2" = yes; then
2866	AC_DEFINE(HAVE_OSFC2, 1, [Define to enable basic OSF C2 support.])
2867	LIB_security=-lsecurity
2868fi
2869AC_SUBST(LIB_security)
2870])
2871
2872dnl $Id: check-man.m4,v 1.3 2000/11/30 01:47:17 joda Exp $
2873dnl check how to format manual pages
2874dnl
2875
2876AC_DEFUN(rk_CHECK_MAN,
2877[AC_PATH_PROG(NROFF, nroff)
2878AC_PATH_PROG(GROFF, groff)
2879AC_CACHE_CHECK(how to format man pages,ac_cv_sys_man_format,
2880[cat > conftest.1 << END
2881.Dd January 1, 1970
2882.Dt CONFTEST 1
2883.Sh NAME
2884.Nm conftest
2885.Nd
2886foobar
2887END
2888
2889if test "$NROFF" ; then
2890	for i in "-mdoc" "-mandoc"; do
2891		if "$NROFF" $i conftest.1 2> /dev/null | \
2892			grep Jan > /dev/null 2>&1 ; then
2893			ac_cv_sys_man_format="$NROFF $i"
2894			break
2895		fi
2896	done
2897fi
2898if test "$ac_cv_sys_man_format" = "" -a "$GROFF" ; then
2899	for i in "-mdoc" "-mandoc"; do
2900		if "$GROFF" -Tascii $i conftest.1 2> /dev/null | \
2901			grep Jan > /dev/null 2>&1 ; then
2902			ac_cv_sys_man_format="$GROFF -Tascii $i"
2903			break
2904		fi
2905	done
2906fi
2907if test "$ac_cv_sys_man_format"; then
2908	ac_cv_sys_man_format="$ac_cv_sys_man_format \[$]< > \[$]@"
2909fi
2910])
2911if test "$ac_cv_sys_man_format"; then
2912	CATMAN="$ac_cv_sys_man_format"
2913	AC_SUBST(CATMAN)
2914fi
2915AM_CONDITIONAL(CATMAN, test "$CATMAN")
2916AC_CACHE_CHECK(extension of pre-formatted manual pages,ac_cv_sys_catman_ext,
2917[if grep _suffix /etc/man.conf > /dev/null 2>&1; then
2918	ac_cv_sys_catman_ext=0
2919else
2920	ac_cv_sys_catman_ext=number
2921fi
2922])
2923if test "$ac_cv_sys_catman_ext" = number; then
2924	CATMANEXT='$$section'
2925else
2926	CATMANEXT=0
2927fi
2928AC_SUBST(CATMANEXT)
2929])
2930dnl
2931dnl $Id: krb-bigendian.m4,v 1.6 2000/08/19 15:37:00 assar Exp $
2932dnl
2933
2934dnl check if this computer is little or big-endian
2935dnl if we can figure it out at compile-time then don't define the cpp symbol
2936dnl otherwise test for it and define it.  also allow options for overriding
2937dnl it when cross-compiling
2938
2939AC_DEFUN(KRB_C_BIGENDIAN, [
2940AC_ARG_ENABLE(bigendian,
2941[  --enable-bigendian	the target is big endian],
2942krb_cv_c_bigendian=yes)
2943AC_ARG_ENABLE(littleendian,
2944[  --enable-littleendian	the target is little endian],
2945krb_cv_c_bigendian=no)
2946AC_CACHE_CHECK(whether byte order is known at compile time,
2947krb_cv_c_bigendian_compile,
2948[AC_TRY_COMPILE([
2949#include <sys/types.h>
2950#include <sys/param.h>],[
2951#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
2952 bogus endian macros
2953#endif], krb_cv_c_bigendian_compile=yes, krb_cv_c_bigendian_compile=no)])
2954AC_CACHE_CHECK(whether byte ordering is bigendian, krb_cv_c_bigendian,[
2955  if test "$krb_cv_c_bigendian_compile" = "yes"; then
2956    AC_TRY_COMPILE([
2957#include <sys/types.h>
2958#include <sys/param.h>],[
2959#if BYTE_ORDER != BIG_ENDIAN
2960  not big endian
2961#endif], krb_cv_c_bigendian=yes, krb_cv_c_bigendian=no)
2962  else
2963    AC_TRY_RUN([main () {
2964      /* Are we little or big endian?  From Harbison&Steele.  */
2965      union
2966      {
2967	long l;
2968	char c[sizeof (long)];
2969    } u;
2970    u.l = 1;
2971    exit (u.c[sizeof (long) - 1] == 1);
2972  }], krb_cv_c_bigendian=no, krb_cv_c_bigendian=yes,
2973  AC_MSG_ERROR([specify either --enable-bigendian or --enable-littleendian]))
2974  fi
2975])
2976if test "$krb_cv_c_bigendian" = "yes"; then
2977  AC_DEFINE(WORDS_BIGENDIAN, 1, [define if target is big endian])dnl
2978fi
2979if test "$krb_cv_c_bigendian_compile" = "yes"; then
2980  AC_DEFINE(ENDIANESS_IN_SYS_PARAM_H, 1, [define if sys/param.h defines the endiness])dnl
2981fi
2982])
2983
2984dnl
2985dnl $Id: aix.m4,v 1.5 2000/11/05 17:15:46 joda Exp $
2986dnl
2987
2988AC_DEFUN(KRB_AIX,[
2989aix=no
2990case "$host" in 
2991*-*-aix3*)
2992	aix=3
2993	;;
2994*-*-aix4*)
2995	aix=4
2996	;;
2997esac
2998AM_CONDITIONAL(AIX, test "$aix" != no)dnl
2999AM_CONDITIONAL(AIX4, test "$aix" = 4)
3000aix_dynamic_afs=yes
3001AM_CONDITIONAL(AIX_DYNAMIC_AFS, test "$aix_dynamic_afs" = yes)dnl
3002
3003AC_FIND_FUNC_NO_LIBS(dlopen, dl)
3004
3005if test "$aix" != no; then
3006	if test "$aix_dynamic_afs" = yes; then
3007		if test "$ac_cv_funclib_dlopen" = yes; then
3008			AIX_EXTRA_KAFS=
3009		elif test "$ac_cv_funclib_dlopen" != no; then
3010			AIX_EXTRA_KAFS="$ac_cv_funclib_dlopen"
3011		else
3012			AIX_EXTRA_KAFS=-lld
3013		fi
3014	else
3015		AIX_EXTRA_KAFS=
3016	fi
3017fi
3018
3019AM_CONDITIONAL(HAVE_DLOPEN, test "$ac_cv_funclib_dlopen" != no)dnl
3020AC_SUBST(AIX_EXTRA_KAFS)dnl
3021
3022])
3023dnl
3024dnl $Id: krb-irix.m4,v 1.2 2000/12/13 12:48:45 assar Exp $
3025dnl
3026
3027dnl requires AC_CANONICAL_HOST
3028AC_DEFUN(KRB_IRIX,[
3029irix=no
3030case "$host_os" in
3031irix*) irix=yes ;;
3032esac
3033AM_CONDITIONAL(IRIX, test "$irix" != no)dnl
3034])
3035
3036dnl 
3037dnl See if there is any X11 present
3038dnl
3039dnl $Id: check-x.m4,v 1.2 1999/11/05 04:25:23 assar Exp $
3040
3041AC_DEFUN(KRB_CHECK_X,[
3042AC_PATH_XTRA
3043
3044# try to figure out if we need any additional ld flags, like -R
3045# and yes, the autoconf X test is utterly broken
3046if test "$no_x" != yes; then
3047	AC_CACHE_CHECK(for special X linker flags,krb_cv_sys_x_libs_rpath,[
3048	ac_save_libs="$LIBS"
3049	ac_save_cflags="$CFLAGS"
3050	CFLAGS="$CFLAGS $X_CFLAGS"
3051	krb_cv_sys_x_libs_rpath=""
3052	krb_cv_sys_x_libs=""
3053	for rflag in "" "-R" "-R " "-rpath "; do
3054		if test "$rflag" = ""; then
3055			foo="$X_LIBS"
3056		else
3057			foo=""
3058			for flag in $X_LIBS; do
3059			case $flag in
3060			-L*)
3061				foo="$foo $flag `echo $flag | sed \"s/-L/$rflag/\"`"
3062				;;
3063			*)
3064				foo="$foo $flag"
3065				;;
3066			esac
3067			done
3068		fi
3069		LIBS="$ac_save_libs $foo $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
3070		AC_TRY_RUN([
3071		#include <X11/Xlib.h>
3072		foo()
3073		{
3074		XOpenDisplay(NULL);
3075		}
3076		main()
3077		{
3078		return 0;
3079		}
3080		], krb_cv_sys_x_libs_rpath="$rflag"; krb_cv_sys_x_libs="$foo"; break,:)
3081	done
3082	LIBS="$ac_save_libs"
3083	CFLAGS="$ac_save_cflags"
3084	])
3085	X_LIBS="$krb_cv_sys_x_libs"
3086fi
3087])
3088
3089dnl $Id: check-xau.m4,v 1.3 1999/05/14 01:17:06 assar Exp $
3090dnl
3091dnl check for Xau{Read,Write}Auth and XauFileName
3092dnl
3093AC_DEFUN(AC_CHECK_XAU,[
3094save_CFLAGS="$CFLAGS"
3095CFLAGS="$X_CFLAGS $CFLAGS"
3096save_LIBS="$LIBS"
3097dnl LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
3098LIBS="$X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
3099save_LDFLAGS="$LDFLAGS"
3100LDFLAGS="$LDFLAGS $X_LIBS"
3101
3102
3103AC_FIND_FUNC_NO_LIBS(XauWriteAuth, X11 Xau)
3104ac_xxx="$LIBS"
3105LIBS="$LIB_XauWriteAuth $LIBS"
3106AC_FIND_FUNC_NO_LIBS(XauReadAuth, X11 Xau)
3107LIBS="$LIB_XauReadAauth $LIBS"
3108AC_FIND_FUNC_NO_LIBS(XauFileName, X11 Xau)
3109LIBS="$ac_xxx"
3110
3111case "$ac_cv_funclib_XauWriteAuth" in
3112yes)	;;
3113no)	;;
3114*)	if test "$ac_cv_funclib_XauReadAuth" = yes; then
3115		if test "$ac_cv_funclib_XauFileName" = yes; then
3116			LIB_XauReadAuth="$LIB_XauWriteAuth"
3117		else
3118			LIB_XauReadAuth="$LIB_XauWriteAuth $LIB_XauFileName"
3119		fi
3120	else
3121		if test "$ac_cv_funclib_XauFileName" = yes; then
3122			LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth"
3123		else
3124			LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth $LIB_XauFileName"
3125		fi
3126	fi
3127	;;
3128esac
3129
3130if test "$AUTOMAKE" != ""; then
3131	AM_CONDITIONAL(NEED_WRITEAUTH, test "$ac_cv_func_XauWriteAuth" != "yes")
3132else
3133	AC_SUBST(NEED_WRITEAUTH_TRUE)
3134	AC_SUBST(NEED_WRITEAUTH_FALSE)
3135	if test "$ac_cv_func_XauWriteAuth" != "yes"; then
3136		NEED_WRITEAUTH_TRUE=
3137		NEED_WRITEAUTH_FALSE='#'
3138	else
3139		NEED_WRITEAUTH_TRUE='#'
3140		NEED_WRITEAUTH_FALSE=
3141	fi
3142fi
3143CFLAGS=$save_CFLAGS
3144LIBS=$save_LIBS
3145LDFLAGS=$save_LDFLAGS
3146])
3147
3148dnl
3149dnl $Id: capabilities.m4,v 1.2 1999/09/01 11:02:26 joda Exp $
3150dnl
3151
3152dnl
3153dnl Test SGI capabilities
3154dnl
3155
3156AC_DEFUN(KRB_CAPABILITIES,[
3157
3158AC_CHECK_HEADERS(capability.h sys/capability.h)
3159
3160AC_CHECK_FUNCS(sgi_getcapabilitybyname cap_set_proc)
3161])
3162
3163dnl $Id: check-getpwnam_r-posix.m4,v 1.2 1999/03/23 16:47:31 joda Exp $
3164dnl
3165dnl check for getpwnam_r, and if it's posix or not
3166
3167AC_DEFUN(AC_CHECK_GETPWNAM_R_POSIX,[
3168AC_FIND_FUNC_NO_LIBS(getpwnam_r,c_r)
3169if test "$ac_cv_func_getpwnam_r" = yes; then
3170	AC_CACHE_CHECK(if getpwnam_r is posix,ac_cv_func_getpwnam_r_posix,
3171	ac_libs="$LIBS"
3172	LIBS="$LIBS $LIB_getpwnam_r"
3173	AC_TRY_RUN([
3174#include <pwd.h>
3175int main()
3176{
3177	struct passwd pw, *pwd;
3178	return getpwnam_r("", &pw, NULL, 0, &pwd) < 0;
3179}
3180],ac_cv_func_getpwnam_r_posix=yes,ac_cv_func_getpwnam_r_posix=no,:)
3181LIBS="$ac_libs")
3182if test "$ac_cv_func_getpwnam_r_posix" = yes; then
3183	AC_DEFINE(POSIX_GETPWNAM_R, 1, [Define if getpwnam_r has POSIX flavour.])
3184fi
3185fi
3186])
3187dnl $Id: crypto.m4,v 1.7 2001/08/29 17:02:48 assar Exp $
3188dnl
3189dnl test for crypto libraries:
3190dnl - libcrypto (from openssl)
3191dnl - libdes (from krb4)
3192dnl - own-built libdes
3193
3194AC_DEFUN([KRB_CRYPTO],[
3195crypto_lib=unknown
3196AC_WITH_ALL([openssl])
3197
3198DIR_des=
3199
3200AC_MSG_CHECKING([for crypto library])
3201
3202if test "$crypto_lib" = "unknown" -a "$with_openssl" != "no"; then
3203
3204  save_CPPFLAGS="$CPPFLAGS"
3205  save_LIBS="$LIBS"
3206  INCLUDE_des=
3207  LIB_des=
3208  if test "$with_openssl_include" != ""; then
3209    INCLUDE_des="-I${with_openssl}/include"
3210  fi
3211  if test "$with_openssl_lib" != ""; then
3212    LIB_des="-L${with_openssl}/lib"
3213  fi
3214  CPPFLAGS="${INCLUDE_des} ${CPPFLAGS}"
3215  LIB_des="${LIB_des} -lcrypto"
3216  LIB_des_a="$LIB_des"
3217  LIB_des_so="$LIB_des"
3218  LIB_des_appl="$LIB_des"
3219  LIBS="${LIBS} ${LIB_des}"
3220  AC_TRY_LINK([
3221  #include <openssl/md4.h>
3222  #include <openssl/md5.h>
3223  #include <openssl/sha.h>
3224  #include <openssl/des.h>
3225  #include <openssl/rc4.h>
3226  ],
3227  [
3228    MD4_CTX md4;
3229    MD5_CTX md5;
3230    SHA_CTX sha1;
3231
3232    MD4_Init(&md4);
3233    MD5_Init(&md5);
3234    SHA1_Init(&sha1);
3235
3236    des_cbc_encrypt(0, 0, 0, 0, 0, 0);
3237    RC4(0, 0, 0, 0);
3238  ], [
3239  crypto_lib=libcrypto
3240  AC_DEFINE([HAVE_OPENSSL], 1, [define to use openssl's libcrypto])
3241  AC_MSG_RESULT([libcrypto])])
3242  CPPFLAGS="$save_CPPFLAGS"
3243  LIBS="$save_LIBS"
3244fi
3245
3246if test "$crypto_lib" = "unknown" -a "$with_krb4" != "no"; then
3247
3248  save_CPPFLAGS="$CPPFLAGS"
3249  save_LIBS="$LIBS"
3250  INCLUDE_des="${INCLUDE_krb4}"
3251  LIB_des=
3252  if test "$krb4_libdir"; then
3253    LIB_des="-L${krb4_libdir}"
3254  fi
3255  LIB_des="${LIB_des} -ldes"
3256  CPPFLAGS="${CPPFLAGS} ${INCLUDE_des}"
3257  LIBS="${LIBS} ${LIB_des}"
3258  LIB_des_a="$LIB_des"
3259  LIB_des_so="$LIB_des"
3260  LIB_des_appl="$LIB_des"
3261  LIBS="${LIBS} ${LIB_des}"
3262  AC_TRY_LINK([
3263  #undef KRB5 /* makes md4.h et al unhappy */
3264  #define KRB4
3265  #include <md4.h>
3266  #include <md5.h>
3267  #include <sha.h>
3268  #include <des.h>
3269  #include <rc4.h>
3270  ],
3271  [
3272    MD4_CTX md4;
3273    MD5_CTX md5;
3274    SHA_CTX sha1;
3275
3276    MD4_Init(&md4);
3277    MD5_Init(&md5);
3278    SHA1_Init(&sha1);
3279
3280    des_cbc_encrypt(0, 0, 0, 0, 0, 0);
3281    RC4(0, 0, 0, 0);
3282  ], [crypto_lib=krb4; AC_MSG_RESULT([krb4's libdes])])
3283  CPPFLAGS="$save_CPPFLAGS"
3284  LIBS="$save_LIBS"
3285fi
3286
3287if test "$crypto_lib" = "unknown"; then
3288
3289  DIR_des='des'
3290  LIB_des='$(top_builddir)/lib/des/libdes.la'
3291  LIB_des_a='$(top_builddir)/lib/des/.libs/libdes.a'
3292  LIB_des_so='$(top_builddir)/lib/des/.libs/libdes.so'
3293  LIB_des_appl="-ldes"
3294
3295  AC_MSG_RESULT([included libdes])
3296
3297fi
3298
3299AC_SUBST(DIR_des)
3300AC_SUBST(INCLUDE_des)
3301AC_SUBST(LIB_des)
3302AC_SUBST(LIB_des_a)
3303AC_SUBST(LIB_des_so)
3304AC_SUBST(LIB_des_appl)
3305])
3306
3307dnl
3308dnl $Id: with-all.m4,v 1.1 2001/08/29 17:01:23 assar Exp $
3309dnl
3310
3311dnl AC_WITH_ALL(name)
3312
3313AC_DEFUN([AC_WITH_ALL], [
3314AC_ARG_WITH($1,
3315	AC_HELP_STRING([--with-$1=dir],
3316		[use $1 in dir]))
3317
3318AC_ARG_WITH($1-lib,
3319	AC_HELP_STRING([--with-$1-lib=dir],
3320		[use $1 libraries in dir]),
3321[if test "$withval" = "yes" -o "$withval" = "no"; then
3322  AC_MSG_ERROR([No argument for --with-$1-lib])
3323elif test "X$with_$1" = "X"; then
3324  with_$1=yes
3325fi])
3326
3327AC_ARG_WITH($1-include,
3328	AC_HELP_STRING([--with-$1-include=dir],
3329		[use $1 headers in dir]),
3330[if test "$withval" = "yes" -o "$withval" = "no"; then
3331  AC_MSG_ERROR([No argument for --with-$1-include])
3332elif test "X$with_$1" = "X"; then
3333  with_$1=yes
3334fi])
3335
3336case "$with_$1" in
3337yes)	;;
3338no)	;;
3339"")	;;
3340*)	if test "$with_$1_include" = ""; then
3341		with_$1_include="$with_$1/include"
3342	fi
3343	if test "$with_$1_lib" = ""; then
3344		with_$1_lib="$with_$1/lib$abilibdirext"
3345	fi
3346	;;
3347esac
3348])
3349dnl $Id: krb-readline.m4,v 1.2 2000/11/15 00:47:08 assar Exp $
3350dnl
3351dnl Tests for readline functions
3352dnl
3353
3354dnl el_init
3355
3356AC_DEFUN(KRB_READLINE,[
3357AC_FIND_FUNC_NO_LIBS(el_init, edit, [], [], [$LIB_tgetent])
3358if test "$ac_cv_func_el_init" = yes ; then
3359	AC_CACHE_CHECK(for four argument el_init, ac_cv_func_el_init_four,[
3360		AC_TRY_COMPILE([#include <stdio.h>
3361			#include <histedit.h>],
3362			[el_init("", NULL, NULL, NULL);],
3363			ac_cv_func_el_init_four=yes,
3364			ac_cv_func_el_init_four=no)])
3365	if test "$ac_cv_func_el_init_four" = yes; then
3366		AC_DEFINE(HAVE_FOUR_VALUED_EL_INIT, 1, [Define if el_init takes four arguments.])
3367	fi
3368fi
3369
3370dnl readline
3371
3372ac_foo=no
3373if test "$with_readline" = yes; then
3374	:
3375elif test "$ac_cv_func_readline" = yes; then
3376	:
3377elif test "$ac_cv_func_el_init" = yes; then
3378	ac_foo=yes
3379	LIB_readline="\$(top_builddir)/lib/editline/libel_compat.la $LIB_el_init"
3380else
3381	LIB_readline='$(top_builddir)/lib/editline/libeditline.la'
3382fi
3383AM_CONDITIONAL(el_compat, test "$ac_foo" = yes)
3384if test "$readline_libdir"; then
3385	LIB_readline="-rpath $readline_libdir $LIB_readline"
3386fi
3387LIB_readline="$LIB_readline \$(LIB_tgetent)"
3388AC_DEFINE(HAVE_READLINE, 1, 
3389	[Define if you have a readline compatible library.])dnl
3390
3391])
3392dnl $Id: check-compile-et.m4,v 1.6 2001/09/02 17:08:48 assar Exp $
3393dnl
3394dnl CHECK_COMPILE_ET
3395AC_DEFUN([CHECK_COMPILE_ET], [
3396
3397AC_CHECK_PROG(COMPILE_ET, compile_et, [compile_et])
3398
3399krb_cv_compile_et="no"
3400if test "${COMPILE_ET}" = "compile_et"; then
3401
3402dnl We have compile_et.  Now let's see if it supports `prefix' and `index'.
3403AC_MSG_CHECKING(whether compile_et has the features we need)
3404cat > conftest_et.et <<'EOF'
3405error_table conf
3406prefix CONFTEST
3407index 1
3408error_code CODE1, "CODE1"
3409index 128
3410error_code CODE2, "CODE2"
3411end
3412EOF
3413if ${COMPILE_ET} conftest_et.et >/dev/null 2>&1; then
3414  dnl XXX Some systems have <et/com_err.h>.
3415  save_CPPFLAGS="${save_CPPFLAGS}"
3416  if test -d "/usr/include/et"; then
3417    CPPFLAGS="-I/usr/include/et ${CPPFLAGS}"
3418  fi
3419  dnl Check that the `prefix' and `index' directives were honored.
3420  AC_TRY_RUN([
3421#include <com_err.h>
3422#include <string.h>
3423#include "conftest_et.h"
3424int main(){return (CONFTEST_CODE2 - CONFTEST_CODE1) != 127;}
3425  ], [krb_cv_compile_et="yes"],[CPPFLAGS="${save_CPPFLAGS}"])
3426fi
3427AC_MSG_RESULT(${krb_cv_compile_et})
3428rm -fr conftest*
3429fi
3430
3431if test "${krb_cv_compile_et}" = "yes"; then
3432  dnl Since compile_et seems to work, let's check libcom_err
3433  krb_cv_save_LIBS="${LIBS}"
3434  LIBS="${LIBS} -lcom_err"
3435  AC_MSG_CHECKING(for com_err)
3436  AC_TRY_LINK([#include <com_err.h>],[
3437    const char *p;
3438    p = error_message(0);
3439  ],[krb_cv_com_err="yes"],[krb_cv_com_err="no"; CPPFLAGS="${save_CPPFLAGS}"])
3440  AC_MSG_RESULT(${krb_cv_com_err})
3441  LIBS="${krb_cv_save_LIBS}"
3442else
3443  dnl Since compile_et doesn't work, forget about libcom_err
3444  krb_cv_com_err="no"
3445fi
3446
3447dnl Only use the system's com_err if we found compile_et, libcom_err, and
3448dnl com_err.h.
3449if test "${krb_cv_com_err}" = "yes"; then
3450    DIR_com_err=""
3451    LIB_com_err="-lcom_err"
3452    LIB_com_err_a=""
3453    LIB_com_err_so=""
3454    AC_MSG_NOTICE(Using the already-installed com_err)
3455else
3456    COMPILE_ET="\$(top_builddir)/lib/com_err/compile_et"
3457    DIR_com_err="com_err"
3458    LIB_com_err="\$(top_builddir)/lib/com_err/libcom_err.la"
3459    LIB_com_err_a="\$(top_builddir)/lib/com_err/.libs/libcom_err.a"
3460    LIB_com_err_so="\$(top_builddir)/lib/com_err/.libs/libcom_err.so"
3461    AC_MSG_NOTICE(Using our own com_err)
3462fi
3463AC_SUBST(DIR_com_err)
3464AC_SUBST(LIB_com_err)
3465AC_SUBST(LIB_com_err_a)
3466AC_SUBST(LIB_com_err_so)
3467
3468])
3469
3470dnl $Id: auth-modules.m4,v 1.2 2001/09/01 11:56:05 assar Exp $
3471dnl
3472dnl Figure what authentication modules should be built
3473
3474AC_DEFUN(AC_AUTH_MODULES,[
3475AC_MSG_CHECKING(which authentication modules should be built)
3476
3477LIB_AUTH_SUBDIRS=
3478
3479if test "$ac_cv_header_siad_h" = yes; then
3480	LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS sia"
3481fi
3482
3483if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_shared" = yes; then
3484	LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS pam"
3485fi
3486
3487case "${host}" in
3488*-*-irix[[56]]*) LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS afskauthlib" ;;
3489esac
3490
3491AC_MSG_RESULT($LIB_AUTH_SUBDIRS)
3492
3493AC_SUBST(LIB_AUTH_SUBDIRS)dnl
3494])
3495
3496