aclocal.m4 revision 106163
1106163Sroberto# ./aclocal.m4 generated automatically by aclocal 1.5
254359Sroberto
3106163Sroberto# Copyright 1996, 1997, 1998, 1999, 2000, 2001
482498Sroberto# Free Software Foundation, Inc.
582498Sroberto# This file is free software; the Free Software Foundation
682498Sroberto# gives unlimited permission to copy and/or distribute it,
782498Sroberto# with or without modifications, as long as this notice is preserved.
854359Sroberto
982498Sroberto# This program is distributed in the hope that it will be useful,
1082498Sroberto# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1182498Sroberto# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1282498Sroberto# PARTICULAR PURPOSE.
1354359Sroberto
1482498SrobertoAC_DEFUN(hs_ULONG_CONST,
1582498Sroberto[ AC_EGREP_CPP(Circus,
1682498Sroberto [#define ACAT(a,b)a ## b
1782498SrobertoACAT(Cir,cus)
1882498Sroberto], AC_DEFINE([ULONG_CONST(a)], [a ## UL]),
1982498Sroberto    AC_EGREP_CPP(Reiser,
2082498Sroberto[#define RCAT(a,b)a/**/b
2182498SrobertoRCAT(Rei,ser)
2282498Sroberto], AC_DEFINE([ULONG_CONST(a)], [a/**/L]),
2382498Sroberto    AC_MSG_ERROR([How do we create an unsigned long constant?])))])
2482498Srobertodnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
2582498Srobertodnl
2682498Srobertodnl This macro defines (with AC_DEFINE) VARNAME to the expansion of the DIR
2782498Srobertodnl variable, taking care of fixing up ${prefix} and such.
2882498Srobertodnl
2982498Srobertodnl Note that the 3 argument form is only supported with autoconf 2.13 and
3082498Srobertodnl later (i.e. only where AC_DEFINE supports 3 arguments).
3182498Srobertodnl
3282498Srobertodnl Examples:
3382498Srobertodnl
3482498Srobertodnl    AC_DEFINE_DIR(DATADIR, datadir)
3582498Srobertodnl    AC_DEFINE_DIR(PROG_PATH, bindir, [Location of installed binaries])
3682498Srobertodnl
37106163Srobertodnl @version $Id$
3882498Srobertodnl @author Alexandre Oliva <oliva@lsd.ic.unicamp.br>
3982498Sroberto
4082498SrobertoAC_DEFUN(AC_DEFINE_DIR, [
4182498Sroberto	ac_expanded=`(
4282498Sroberto	    test "x$prefix" = xNONE && prefix="$ac_default_prefix"
4382498Sroberto	    test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
4482498Sroberto	    eval echo \""[$]$2"\"
4582498Sroberto        )`
4682498Sroberto	ifelse($3, ,
4782498Sroberto	  AC_DEFINE_UNQUOTED($1, "$ac_expanded"),
4882498Sroberto	  AC_DEFINE_UNQUOTED($1, "$ac_expanded", $3))
4982498Sroberto])
5082498Sroberto
5154359Sroberto# Like AC_CONFIG_HEADER, but automatically create stamp file.
5254359Sroberto
5382498Sroberto# serial 3
5454359Sroberto
5582498Sroberto# When config.status generates a header, we must update the stamp-h file.
5682498Sroberto# This file resides in the same directory as the config header
5782498Sroberto# that is generated.  We must strip everything past the first ":",
5882498Sroberto# and everything past the last "/".
5982498Sroberto
6082498SrobertoAC_PREREQ([2.12])
6182498Sroberto
6282498SrobertoAC_DEFUN([AM_CONFIG_HEADER],
63106163Sroberto[ifdef([AC_FOREACH],dnl
64106163Sroberto	 [dnl init our file count if it isn't already
65106163Sroberto	 m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
66106163Sroberto	 dnl prepare to store our destination file list for use in config.status
67106163Sroberto	 AC_FOREACH([_AM_File], [$1],
68106163Sroberto		    [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
69106163Sroberto		    m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
70106163Sroberto		    dnl and add it to the list of files AC keeps track of, along
71106163Sroberto		    dnl with our hook
72106163Sroberto		    AC_CONFIG_HEADERS(_AM_File,
73106163Srobertodnl COMMANDS, [, INIT-CMDS]
74106163Sroberto[# update the timestamp
75106163Srobertoecho timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
76106163Sroberto][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
77106163Sroberto		    m4_popdef([_AM_Dest])])],dnl
7882498Sroberto[AC_CONFIG_HEADER([$1])
7982498Sroberto  AC_OUTPUT_COMMANDS(
8082498Sroberto   ifelse(patsubst([$1], [[^ ]], []),
8182498Sroberto	  [],
8282498Sroberto	  [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
83106163Sroberto	   patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
84106163Sroberto[am_indx=1
85106163Srobertofor am_file in $1; do
86106163Sroberto  case " \$CONFIG_HEADERS " in
87106163Sroberto  *" \$am_file "*)
88106163Sroberto    am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
89106163Sroberto    if test -n "\$am_dir"; then
90106163Sroberto      am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
91106163Sroberto      for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
92106163Sroberto        am_tmpdir=\$am_tmpdir\$am_subdir/
93106163Sroberto        if test ! -d \$am_tmpdir; then
94106163Sroberto          mkdir \$am_tmpdir
95106163Sroberto        fi
96106163Sroberto      done
97106163Sroberto    fi
98106163Sroberto    echo timestamp > "\$am_dir"stamp-h\$am_indx
99106163Sroberto    ;;
100106163Sroberto  esac
101106163Sroberto  am_indx=\`expr \$am_indx + 1\`
102106163Srobertodone])
103106163Sroberto])]) # AM_CONFIG_HEADER
10482498Sroberto
105106163Sroberto# _AM_DIRNAME(PATH)
106106163Sroberto# -----------------
107106163Sroberto# Like AS_DIRNAME, only do it during macro expansion
108106163SrobertoAC_DEFUN([_AM_DIRNAME],
109106163Sroberto       [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
110106163Sroberto	      m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
111106163Sroberto		    m4_if(m4_regexp([$1], [^/.*]), -1,
112106163Sroberto			  [.],
113106163Sroberto			  m4_patsubst([$1], [^\(/\).*], [\1])),
114106163Sroberto		    m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
115106163Sroberto	      m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
116106163Sroberto]) # _AM_DIRNAME
117106163Sroberto
11854359Sroberto# Do all the work for Automake.  This macro actually does too much --
11954359Sroberto# some checks are only needed if your package does certain things.
12054359Sroberto# But this isn't really a big deal.
12154359Sroberto
12282498Sroberto# serial 5
12354359Sroberto
12482498Sroberto# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
12582498Sroberto# written in clear, in which case automake, when reading aclocal.m4,
12682498Sroberto# will think it sees a *use*, and therefore will trigger all it's
12782498Sroberto# C support machinery.  Also note that it means that autoscan, seeing
12882498Sroberto# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
12954359Sroberto
13082498Sroberto
13182498Sroberto# We require 2.13 because we rely on SHELL being computed by configure.
13254359SrobertoAC_PREREQ([2.13])
13382498Sroberto
13482498Sroberto# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
13582498Sroberto# -----------------------------------------------------------
13682498Sroberto# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
13782498Sroberto# The purpose of this macro is to provide the user with a means to
13882498Sroberto# check macros which are provided without letting her know how the
13982498Sroberto# information is coded.
14082498Sroberto# If this macro is not defined by Autoconf, define it here.
14182498Srobertoifdef([AC_PROVIDE_IFELSE],
14282498Sroberto      [],
14382498Sroberto      [define([AC_PROVIDE_IFELSE],
14482498Sroberto              [ifdef([AC_PROVIDE_$1],
14582498Sroberto                     [$2], [$3])])])
14682498Sroberto
14782498Sroberto
14882498Sroberto# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
14982498Sroberto# ----------------------------------------------
15082498SrobertoAC_DEFUN([AM_INIT_AUTOMAKE],
15182498Sroberto[AC_REQUIRE([AC_PROG_INSTALL])dnl
15282498Sroberto# test to see if srcdir already configured
15382498Srobertoif test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
15456746Sroberto   test -f $srcdir/config.status; then
15582498Sroberto  AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
15654359Srobertofi
15782498Sroberto
15882498Sroberto# Define the identity of the package.
15982498SrobertoPACKAGE=$1
16082498SrobertoAC_SUBST(PACKAGE)dnl
16182498SrobertoVERSION=$2
16282498SrobertoAC_SUBST(VERSION)dnl
16354359Srobertoifelse([$3],,
16482498Sroberto[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
16582498SrobertoAC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
16682498Sroberto
16782498Sroberto# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
16882498Sroberto# the ones we care about.
16982498Srobertoifdef([m4_pattern_allow],
170106163Sroberto      [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
17182498Sroberto
172106163Sroberto# Autoconf 2.50 always computes EXEEXT.  However we need to be
173106163Sroberto# compatible with 2.13, for now.  So we always define EXEEXT, but we
174106163Sroberto# don't compute it.
175106163SrobertoAC_SUBST(EXEEXT)
176106163Sroberto# Similar for OBJEXT -- only we only use OBJEXT if the user actually
177106163Sroberto# requests that it be used.  This is a bit dumb.
178106163Sroberto: ${OBJEXT=o}
179106163SrobertoAC_SUBST(OBJEXT)
180106163Sroberto
18182498Sroberto# Some tools Automake needs.
18282498SrobertoAC_REQUIRE([AM_SANITY_CHECK])dnl
18382498SrobertoAC_REQUIRE([AC_ARG_PROGRAM])dnl
18456746SrobertoAM_MISSING_PROG(ACLOCAL, aclocal)
18556746SrobertoAM_MISSING_PROG(AUTOCONF, autoconf)
18656746SrobertoAM_MISSING_PROG(AUTOMAKE, automake)
18756746SrobertoAM_MISSING_PROG(AUTOHEADER, autoheader)
18856746SrobertoAM_MISSING_PROG(MAKEINFO, makeinfo)
18956746SrobertoAM_MISSING_PROG(AMTAR, tar)
190106163SrobertoAM_PROG_INSTALL_SH
19182498SrobertoAM_PROG_INSTALL_STRIP
19282498Sroberto# We need awk for the "check" target.  The system "awk" is bad on
19382498Sroberto# some platforms.
19482498SrobertoAC_REQUIRE([AC_PROG_AWK])dnl
19582498SrobertoAC_REQUIRE([AC_PROG_MAKE_SET])dnl
19682498SrobertoAC_REQUIRE([AM_DEP_TRACK])dnl
19782498SrobertoAC_REQUIRE([AM_SET_DEPDIR])dnl
19882498SrobertoAC_PROVIDE_IFELSE([AC_PROG_][CC],
199106163Sroberto                  [_AM_DEPENDENCIES(CC)],
20082498Sroberto                  [define([AC_PROG_][CC],
201106163Sroberto                          defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
20282498SrobertoAC_PROVIDE_IFELSE([AC_PROG_][CXX],
203106163Sroberto                  [_AM_DEPENDENCIES(CXX)],
20482498Sroberto                  [define([AC_PROG_][CXX],
205106163Sroberto                          defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
20656746Sroberto])
20754359Sroberto
20854359Sroberto#
20954359Sroberto# Check to make sure that the build environment is sane.
21054359Sroberto#
21154359Sroberto
21282498Sroberto# serial 3
21382498Sroberto
21482498Sroberto# AM_SANITY_CHECK
21582498Sroberto# ---------------
21682498SrobertoAC_DEFUN([AM_SANITY_CHECK],
21754359Sroberto[AC_MSG_CHECKING([whether build environment is sane])
21854359Sroberto# Just in case
21954359Srobertosleep 1
22082498Srobertoecho timestamp > conftest.file
22154359Sroberto# Do `set' in a subshell so we don't clobber the current shell's
22254359Sroberto# arguments.  Must try -L first in case configure is actually a
22354359Sroberto# symlink; some systems play weird games with the mod time of symlinks
22454359Sroberto# (eg FreeBSD returns the mod time of the symlink's containing
22554359Sroberto# directory).
22654359Srobertoif (
22782498Sroberto   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
22882498Sroberto   if test "$[*]" = "X"; then
22954359Sroberto      # -L didn't work.
23082498Sroberto      set X `ls -t $srcdir/configure conftest.file`
23154359Sroberto   fi
232106163Sroberto   rm -f conftest.file
23382498Sroberto   if test "$[*]" != "X $srcdir/configure conftest.file" \
23482498Sroberto      && test "$[*]" != "X conftest.file $srcdir/configure"; then
23554359Sroberto
23654359Sroberto      # If neither matched, then we have a broken ls.  This can happen
23754359Sroberto      # if, for instance, CONFIG_SHELL is bash and it inherits a
23854359Sroberto      # broken ls alias from the environment.  This has actually
23954359Sroberto      # happened.  Such a system could not be considered "sane".
24054359Sroberto      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
24154359Srobertoalias in your environment])
24254359Sroberto   fi
24354359Sroberto
24482498Sroberto   test "$[2]" = conftest.file
24554359Sroberto   )
24654359Srobertothen
24754359Sroberto   # Ok.
24854359Sroberto   :
24954359Srobertoelse
25054359Sroberto   AC_MSG_ERROR([newly created file is older than distributed files!
25154359SrobertoCheck your system clock])
25254359Srobertofi
25354359SrobertoAC_MSG_RESULT(yes)])
25454359Sroberto
25582498Sroberto
25682498Sroberto# serial 2
25782498Sroberto
25882498Sroberto# AM_MISSING_PROG(NAME, PROGRAM)
25982498Sroberto# ------------------------------
26082498SrobertoAC_DEFUN([AM_MISSING_PROG],
26182498Sroberto[AC_REQUIRE([AM_MISSING_HAS_RUN])
26256746Sroberto$1=${$1-"${am_missing_run}$2"}
26356746SrobertoAC_SUBST($1)])
26456746Sroberto
26582498Sroberto
26682498Sroberto# AM_MISSING_HAS_RUN
26782498Sroberto# ------------------
26882498Sroberto# Define MISSING if not defined so far and test if it supports --run.
26982498Sroberto# If it does, set am_missing_run to use it, otherwise, to nothing.
27082498SrobertoAC_DEFUN([AM_MISSING_HAS_RUN],
271106163Sroberto[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
272106163Srobertotest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
27382498Sroberto# Use eval to expand $SHELL
274106163Srobertoif eval "$MISSING --run true"; then
27556746Sroberto  am_missing_run="$MISSING --run "
27654359Srobertoelse
27756746Sroberto  am_missing_run=
27882498Sroberto  am_backtick='`'
27982498Sroberto  AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
28054359Srobertofi
28156746Sroberto])
28254359Sroberto
28382498Sroberto# AM_AUX_DIR_EXPAND
28454359Sroberto
28582498Sroberto# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
286106163Sroberto# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
287106163Sroberto# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
28882498Sroberto#
289106163Sroberto# Of course, Automake must honor this variable whenever it calls a
290106163Sroberto# tool from the auxiliary directory.  The problem is that $srcdir (and
291106163Sroberto# therefore $ac_aux_dir as well) can be either absolute or relative,
292106163Sroberto# depending on how configure is run.  This is pretty annoying, since
293106163Sroberto# it makes $ac_aux_dir quite unusable in subdirectories: in the top
294106163Sroberto# source directory, any form will work fine, but in subdirectories a
295106163Sroberto# relative path needs to be adjusted first.
296106163Sroberto#
297106163Sroberto# $ac_aux_dir/missing
298106163Sroberto#    fails when called from a subdirectory if $ac_aux_dir is relative
299106163Sroberto# $top_srcdir/$ac_aux_dir/missing
300106163Sroberto#    fails if $ac_aux_dir is absolute,
301106163Sroberto#    fails when called from a subdirectory in a VPATH build with
302106163Sroberto#          a relative $ac_aux_dir
303106163Sroberto#
304106163Sroberto# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
305106163Sroberto# are both prefixed by $srcdir.  In an in-source build this is usually
306106163Sroberto# harmless because $srcdir is `.', but things will broke when you
307106163Sroberto# start a VPATH build or use an absolute $srcdir.
308106163Sroberto#
309106163Sroberto# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
310106163Sroberto# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
311106163Sroberto#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
312106163Sroberto# and then we would define $MISSING as
313106163Sroberto#   MISSING="\${SHELL} $am_aux_dir/missing"
314106163Sroberto# This will work as long as MISSING is not called from configure, because
315106163Sroberto# unfortunately $(top_srcdir) has no meaning in configure.
316106163Sroberto# However there are other variables, like CC, which are often used in
317106163Sroberto# configure, and could therefore not use this "fixed" $ac_aux_dir.
318106163Sroberto#
319106163Sroberto# Another solution, used here, is to always expand $ac_aux_dir to an
320106163Sroberto# absolute PATH.  The drawback is that using absolute paths prevent a
321106163Sroberto# configured tree to be moved without reconfiguration.
32256746Sroberto
32382498SrobertoAC_DEFUN([AM_AUX_DIR_EXPAND], [
32482498Sroberto# expand $ac_aux_dir to an absolute path
32582498Srobertoam_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
32682498Sroberto])
32782498Sroberto
328106163Sroberto# AM_PROG_INSTALL_SH
329106163Sroberto# ------------------
330106163Sroberto# Define $install_sh.
331106163SrobertoAC_DEFUN([AM_PROG_INSTALL_SH],
332106163Sroberto[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
333106163Srobertoinstall_sh=${install_sh-"$am_aux_dir/install-sh"}
334106163SrobertoAC_SUBST(install_sh)])
335106163Sroberto
33682498Sroberto# One issue with vendor `install' (even GNU) is that you can't
33782498Sroberto# specify the program used to strip binaries.  This is especially
338106163Sroberto# annoying in cross-compiling environments, where the build's strip
33982498Sroberto# is unlikely to handle the host's binaries.
340106163Sroberto# Fortunately install-sh will honor a STRIPPROG variable, so we
341106163Sroberto# always use install-sh in `make install-strip', and initialize
342106163Sroberto# STRIPPROG with the value of the STRIP variable (set by the user).
34382498SrobertoAC_DEFUN([AM_PROG_INSTALL_STRIP],
344106163Sroberto[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
345106163SrobertoINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
346106163SrobertoAC_SUBST([INSTALL_STRIP_PROGRAM])])
34782498Sroberto
348106163Sroberto# serial 4						-*- Autoconf -*-
34982498Sroberto
35082498Sroberto
35182498Sroberto
35282498Sroberto# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
35382498Sroberto# written in clear, in which case automake, when reading aclocal.m4,
35482498Sroberto# will think it sees a *use*, and therefore will trigger all it's
35582498Sroberto# C support machinery.  Also note that it means that autoscan, seeing
35682498Sroberto# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
35782498Sroberto
358106163Sroberto
359106163Sroberto
360106163Sroberto# _AM_DEPENDENCIES(NAME)
36182498Sroberto# ---------------------
36282498Sroberto# See how the compiler implements dependency checking.
36382498Sroberto# NAME is "CC", "CXX" or "OBJC".
36482498Sroberto# We try a few techniques and use that to set a single cache variable.
365106163Sroberto#
366106163Sroberto# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
367106163Sroberto# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
368106163Sroberto# dependency, and given that the user is not expected to run this macro,
369106163Sroberto# just rely on AC_PROG_CC.
370106163SrobertoAC_DEFUN([_AM_DEPENDENCIES],
37182498Sroberto[AC_REQUIRE([AM_SET_DEPDIR])dnl
37282498SrobertoAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
373106163SrobertoAC_REQUIRE([AM_MAKE_INCLUDE])dnl
374106163SrobertoAC_REQUIRE([AM_DEP_TRACK])dnl
37556746Sroberto
376106163Srobertoifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
377106163Sroberto       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
378106163Sroberto       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
379106163Sroberto       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
380106163Sroberto                   [depcc="$$1"   am_compiler_list=])
38182498Sroberto
38282498SrobertoAC_CACHE_CHECK([dependency style of $depcc],
38382498Sroberto               [am_cv_$1_dependencies_compiler_type],
384106163Sroberto[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
38582498Sroberto  # We make a subdir and do the tests there.  Otherwise we can end up
38682498Sroberto  # making bogus files that we don't know about and never remove.  For
38782498Sroberto  # instance it was reported that on HP-UX the gcc test will end up
38882498Sroberto  # making a dummy file named `D' -- because `-MD' means `put the output
38982498Sroberto  # in D'.
390106163Sroberto  mkdir conftest.dir
39182498Sroberto  # Copy depcomp to subdir because otherwise we won't find it if we're
39282498Sroberto  # using a relative directory.
393106163Sroberto  cp "$am_depcomp" conftest.dir
394106163Sroberto  cd conftest.dir
39582498Sroberto
39682498Sroberto  am_cv_$1_dependencies_compiler_type=none
397106163Sroberto  if test "$am_compiler_list" = ""; then
398106163Sroberto     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
399106163Sroberto  fi
400106163Sroberto  for depmode in $am_compiler_list; do
40182498Sroberto    # We need to recreate these files for each test, as the compiler may
40282498Sroberto    # overwrite some of them when testing with obscure command lines.
40382498Sroberto    # This happens at least with the AIX C compiler.
40482498Sroberto    echo '#include "conftest.h"' > conftest.c
40582498Sroberto    echo 'int i;' > conftest.h
406106163Sroberto    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
40782498Sroberto
408106163Sroberto    case $depmode in
40956746Sroberto    nosideeffect)
41056746Sroberto      # after this tag, mechanisms are not by side-effect, so they'll
41156746Sroberto      # only be used when explicitly requested
41256746Sroberto      if test "x$enable_dependency_tracking" = xyes; then
41356746Sroberto	continue
41456746Sroberto      else
41556746Sroberto	break
41656746Sroberto      fi
41756746Sroberto      ;;
41856746Sroberto    none) break ;;
41956746Sroberto    esac
42082498Sroberto    # We check with `-c' and `-o' for the sake of the "dashmstdout"
42182498Sroberto    # mode.  It turns out that the SunPro C++ compiler does not properly
42282498Sroberto    # handle `-M -o', and we need to detect this.
423106163Sroberto    if depmode=$depmode \
42456746Sroberto       source=conftest.c object=conftest.o \
42556746Sroberto       depfile=conftest.Po tmpdepfile=conftest.TPo \
42682498Sroberto       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
427106163Sroberto       grep conftest.h conftest.Po > /dev/null 2>&1 &&
428106163Sroberto       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
429106163Sroberto      am_cv_$1_dependencies_compiler_type=$depmode
43056746Sroberto      break
43156746Sroberto    fi
43256746Sroberto  done
43356746Sroberto
43482498Sroberto  cd ..
435106163Sroberto  rm -rf conftest.dir
43656746Srobertoelse
43782498Sroberto  am_cv_$1_dependencies_compiler_type=none
43856746Srobertofi
43956746Sroberto])
44082498Sroberto$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
44182498SrobertoAC_SUBST([$1DEPMODE])
44256746Sroberto])
44356746Sroberto
44456746Sroberto
44582498Sroberto# AM_SET_DEPDIR
44682498Sroberto# -------------
44782498Sroberto# Choose a directory name for dependency files.
448106163Sroberto# This macro is AC_REQUIREd in _AM_DEPENDENCIES
44982498SrobertoAC_DEFUN([AM_SET_DEPDIR],
450106163Sroberto[rm -f .deps 2>/dev/null
451106163Srobertomkdir .deps 2>/dev/null
452106163Srobertoif test -d .deps; then
45356746Sroberto  DEPDIR=.deps
45456746Srobertoelse
455106163Sroberto  # MS-DOS does not allow filenames that begin with a dot.
45656746Sroberto  DEPDIR=_deps
45756746Srobertofi
458106163Srobertormdir .deps 2>/dev/null
45956746SrobertoAC_SUBST(DEPDIR)
46056746Sroberto])
46156746Sroberto
46282498Sroberto
46382498Sroberto# AM_DEP_TRACK
46482498Sroberto# ------------
46582498SrobertoAC_DEFUN([AM_DEP_TRACK],
46682498Sroberto[AC_ARG_ENABLE(dependency-tracking,
46756746Sroberto[  --disable-dependency-tracking Speeds up one-time builds
46856746Sroberto  --enable-dependency-tracking  Do not reject slow dependency extractors])
469106163Srobertoif test "x$enable_dependency_tracking" != xno; then
47056746Sroberto  am_depcomp="$ac_aux_dir/depcomp"
47156746Sroberto  AMDEPBACKSLASH='\'
47256746Srobertofi
473106163SrobertoAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
47456746Srobertopushdef([subst], defn([AC_SUBST]))
47556746Srobertosubst(AMDEPBACKSLASH)
47656746Srobertopopdef([subst])
47756746Sroberto])
47856746Sroberto
47982498Sroberto# Generate code to set up dependency tracking.
48082498Sroberto# This macro should only be invoked once -- use via AC_REQUIRE.
48182498Sroberto# Usage:
48282498Sroberto# AM_OUTPUT_DEPENDENCY_COMMANDS
48356746Sroberto
48482498Sroberto#
48582498Sroberto# This code is only required when automatic dependency tracking
48682498Sroberto# is enabled.  FIXME.  This creates each `.P' file that we will
48782498Sroberto# need in order to bootstrap the dependency handling code.
48882498SrobertoAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
48956746SrobertoAC_OUTPUT_COMMANDS([
490106163Srobertotest x"$AMDEP_TRUE" != x"" ||
49156746Srobertofor mf in $CONFIG_FILES; do
49256746Sroberto  case "$mf" in
49356746Sroberto  Makefile) dirpart=.;;
49456746Sroberto  */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
49556746Sroberto  *) continue;;
49656746Sroberto  esac
49756746Sroberto  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
49856746Sroberto  # Extract the definition of DEP_FILES from the Makefile without
49956746Sroberto  # running `make'.
50056746Sroberto  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
50156746Sroberto  test -z "$DEPDIR" && continue
50256746Sroberto  # When using ansi2knr, U may be empty or an underscore; expand it
50356746Sroberto  U=`sed -n -e '/^U = / s///p' < "$mf"`
50456746Sroberto  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
50556746Sroberto  # We invoke sed twice because it is the simplest approach to
50656746Sroberto  # changing $(DEPDIR) to its actual value in the expansion.
50756746Sroberto  for file in `sed -n -e '
50856746Sroberto    /^DEP_FILES = .*\\\\$/ {
50956746Sroberto      s/^DEP_FILES = //
51056746Sroberto      :loop
51156746Sroberto	s/\\\\$//
51256746Sroberto	p
51356746Sroberto	n
51456746Sroberto	/\\\\$/ b loop
51556746Sroberto      p
51656746Sroberto    }
51756746Sroberto    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
51856746Sroberto       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
51956746Sroberto    # Make sure the directory exists.
52056746Sroberto    test -f "$dirpart/$file" && continue
52156746Sroberto    fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
52256746Sroberto    $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
52356746Sroberto    # echo "creating $dirpart/$file"
52456746Sroberto    echo '# dummy' > "$dirpart/$file"
52556746Sroberto  done
52656746Srobertodone
527106163Sroberto], [AMDEP_TRUE="$AMDEP_TRUE"
52856746Srobertoac_aux_dir="$ac_aux_dir"])])
52956746Sroberto
53082498Sroberto# AM_MAKE_INCLUDE()
53182498Sroberto# -----------------
53282498Sroberto# Check to see how make treats includes.
53382498SrobertoAC_DEFUN([AM_MAKE_INCLUDE],
53482498Sroberto[am_make=${MAKE-make}
53582498Srobertocat > confinc << 'END'
53682498Srobertodoit:
53782498Sroberto	@echo done
53882498SrobertoEND
53982498Sroberto# If we don't find an include directive, just comment out the code.
54082498SrobertoAC_MSG_CHECKING([for style of include used by $am_make])
541106163Srobertoam__include='#'
542106163Srobertoam__quote=
543106163Sroberto_am_result=none
544106163Sroberto# First try GNU make style include.
545106163Srobertoecho "include confinc" > confmf
546106163Sroberto# We grep out `Entering directory' and `Leaving directory'
547106163Sroberto# messages which can occur if `w' ends up in MAKEFLAGS.
548106163Sroberto# In particular we don't look at `^make:' because GNU make might
549106163Sroberto# be invoked under some other name (usually "gmake"), in which
550106163Sroberto# case it prints its new name instead of `make'.
551106163Srobertoif test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
552106163Sroberto   am__include=include
553106163Sroberto   am__quote=
554106163Sroberto   _am_result=GNU
555106163Srobertofi
556106163Sroberto# Now try BSD make style include.
557106163Srobertoif test "$am__include" = "#"; then
558106163Sroberto   echo '.include "confinc"' > confmf
559106163Sroberto   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
560106163Sroberto      am__include=.include
561106163Sroberto      am__quote='"'
562106163Sroberto      _am_result=BSD
56382498Sroberto   fi
564106163Srobertofi
565106163SrobertoAC_SUBST(am__include)
566106163SrobertoAC_SUBST(am__quote)
567106163SrobertoAC_MSG_RESULT($_am_result)
56882498Srobertorm -f confinc confmf
56982498Sroberto])
57056746Sroberto
571106163Sroberto# serial 3
57282498Sroberto
573106163Sroberto# AM_CONDITIONAL(NAME, SHELL-CONDITION)
574106163Sroberto# -------------------------------------
575106163Sroberto# Define a conditional.
576106163Sroberto#
577106163Sroberto# FIXME: Once using 2.50, use this:
578106163Sroberto# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
579106163SrobertoAC_DEFUN([AM_CONDITIONAL],
580106163Sroberto[ifelse([$1], [TRUE],
581106163Sroberto        [errprint(__file__:__line__: [$0: invalid condition: $1
582106163Sroberto])dnl
583106163Srobertom4exit(1)])dnl
584106163Srobertoifelse([$1], [FALSE],
585106163Sroberto       [errprint(__file__:__line__: [$0: invalid condition: $1
586106163Sroberto])dnl
587106163Srobertom4exit(1)])dnl
588106163SrobertoAC_SUBST([$1_TRUE])
589106163SrobertoAC_SUBST([$1_FALSE])
590106163Srobertoif $2; then
591106163Sroberto  $1_TRUE=
592106163Sroberto  $1_FALSE='#'
593106163Srobertoelse
594106163Sroberto  $1_TRUE='#'
595106163Sroberto  $1_FALSE=
596106163Srobertofi])
597106163Sroberto
598106163Sroberto
59954359Sroberto# serial 1
60054359Sroberto
60182498SrobertoAC_DEFUN([AM_C_PROTOTYPES],
60254359Sroberto[AC_REQUIRE([AM_PROG_CC_STDC])
60354359SrobertoAC_REQUIRE([AC_PROG_CPP])
60454359SrobertoAC_MSG_CHECKING([for function prototypes])
60554359Srobertoif test "$am_cv_prog_cc_stdc" != no; then
60654359Sroberto  AC_MSG_RESULT(yes)
60754359Sroberto  AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
60854359Sroberto  U= ANSI2KNR=
60954359Srobertoelse
61054359Sroberto  AC_MSG_RESULT(no)
61154359Sroberto  U=_ ANSI2KNR=./ansi2knr
61254359Srobertofi
61382498Sroberto# Ensure some checks needed by ansi2knr itself.
61482498SrobertoAC_HEADER_STDC
61582498SrobertoAC_CHECK_HEADERS(string.h)
61654359SrobertoAC_SUBST(U)dnl
61754359SrobertoAC_SUBST(ANSI2KNR)dnl
61854359Sroberto])
61954359Sroberto
62054359Sroberto
62154359Sroberto# serial 1
62254359Sroberto
62354359Sroberto# @defmac AC_PROG_CC_STDC
62454359Sroberto# @maindex PROG_CC_STDC
62554359Sroberto# @ovindex CC
62654359Sroberto# If the C compiler in not in ANSI C mode by default, try to add an option
62754359Sroberto# to output variable @code{CC} to make it so.  This macro tries various
62854359Sroberto# options that select ANSI C on some system or another.  It considers the
62954359Sroberto# compiler to be in ANSI C mode if it handles function prototypes correctly.
63054359Sroberto#
63154359Sroberto# If you use this macro, you should check after calling it whether the C
63254359Sroberto# compiler has been set to accept ANSI C; if not, the shell variable
63354359Sroberto# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
63454359Sroberto# code in ANSI C, you can make an un-ANSIfied copy of it by using the
63554359Sroberto# program @code{ansi2knr}, which comes with Ghostscript.
63654359Sroberto# @end defmac
63754359Sroberto
63882498SrobertoAC_DEFUN([AM_PROG_CC_STDC],
63954359Sroberto[AC_REQUIRE([AC_PROG_CC])
64054359SrobertoAC_BEFORE([$0], [AC_C_INLINE])
64154359SrobertoAC_BEFORE([$0], [AC_C_CONST])
64254359Srobertodnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
64354359Srobertodnl a magic option to avoid problems with ANSI preprocessor commands
64454359Srobertodnl like #elif.
64554359Srobertodnl FIXME: can't do this because then AC_AIX won't work due to a
64654359Srobertodnl circular dependency.
64754359Srobertodnl AC_BEFORE([$0], [AC_PROG_CPP])
64882498SrobertoAC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
64954359SrobertoAC_CACHE_VAL(am_cv_prog_cc_stdc,
65054359Sroberto[am_cv_prog_cc_stdc=no
65154359Srobertoac_save_CC="$CC"
65254359Sroberto# Don't try gcc -ansi; that turns off useful extensions and
65354359Sroberto# breaks some systems' header files.
65454359Sroberto# AIX			-qlanglvl=ansi
65554359Sroberto# Ultrix and OSF/1	-std1
65654359Sroberto# HP-UX 10.20 and later	-Ae
65754359Sroberto# HP-UX older versions	-Aa -D_HPUX_SOURCE
65854359Sroberto# SVR4			-Xc -D__EXTENSIONS__
65954359Srobertofor ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
66054359Srobertodo
66154359Sroberto  CC="$ac_save_CC $ac_arg"
66254359Sroberto  AC_TRY_COMPILE(
66354359Sroberto[#include <stdarg.h>
66454359Sroberto#include <stdio.h>
66554359Sroberto#include <sys/types.h>
66654359Sroberto#include <sys/stat.h>
66754359Sroberto/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
66854359Srobertostruct buf { int x; };
66954359SrobertoFILE * (*rcsopen) (struct buf *, struct stat *, int);
67054359Srobertostatic char *e (p, i)
67154359Sroberto     char **p;
67254359Sroberto     int i;
67354359Sroberto{
67454359Sroberto  return p[i];
67554359Sroberto}
67654359Srobertostatic char *f (char * (*g) (char **, int), char **p, ...)
67754359Sroberto{
67854359Sroberto  char *s;
67954359Sroberto  va_list v;
68054359Sroberto  va_start (v,p);
68154359Sroberto  s = g (p, va_arg (v,int));
68254359Sroberto  va_end (v);
68354359Sroberto  return s;
68454359Sroberto}
68554359Srobertoint test (int i, double x);
68654359Srobertostruct s1 {int (*f) (int a);};
68754359Srobertostruct s2 {int (*f) (double a);};
68854359Srobertoint pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
68954359Srobertoint argc;
69054359Srobertochar **argv;
69154359Sroberto], [
69254359Srobertoreturn f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
69354359Sroberto],
69454359Sroberto[am_cv_prog_cc_stdc="$ac_arg"; break])
69554359Srobertodone
69654359SrobertoCC="$ac_save_CC"
69754359Sroberto])
69854359Srobertoif test -z "$am_cv_prog_cc_stdc"; then
69954359Sroberto  AC_MSG_RESULT([none needed])
70054359Srobertoelse
70182498Sroberto  AC_MSG_RESULT([$am_cv_prog_cc_stdc])
70254359Srobertofi
70354359Srobertocase "x$am_cv_prog_cc_stdc" in
70454359Sroberto  x|xno) ;;
70554359Sroberto  *) CC="$CC $am_cv_prog_cc_stdc" ;;
70654359Srobertoesac
70754359Sroberto])
70854359Sroberto
709