xref: /minix/external/bsd/file/dist/aclocal.m4 (revision 835f6802)
1*835f6802SDirk Vogt# generated automatically by aclocal 1.11 -*- Autoconf -*-
2ef01931fSBen Gras
3ef01931fSBen Gras# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4*835f6802SDirk Vogt# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5ef01931fSBen Gras# This file is free software; the Free Software Foundation
6ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
7ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
8ef01931fSBen Gras
9ef01931fSBen Gras# This program is distributed in the hope that it will be useful,
10ef01931fSBen Gras# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11ef01931fSBen Gras# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12ef01931fSBen Gras# PARTICULAR PURPOSE.
13ef01931fSBen Gras
14*835f6802SDirk Vogtm4_ifndef([AC_AUTOCONF_VERSION],
15*835f6802SDirk Vogt  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16*835f6802SDirk Vogtm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],,
17*835f6802SDirk Vogt[m4_warning([this file was generated for autoconf 2.64.
18*835f6802SDirk VogtYou have another version of autoconf.  It may work, but is not guaranteed to.
19*835f6802SDirk VogtIf you have problems, you may need to regenerate the build system entirely.
20*835f6802SDirk VogtTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21ef01931fSBen Gras
22*835f6802SDirk Vogt# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23ef01931fSBen Gras#
24ef01931fSBen Gras# This file is free software; the Free Software Foundation
25ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
26ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
27ef01931fSBen Gras
28ef01931fSBen Gras# AM_AUTOMAKE_VERSION(VERSION)
29ef01931fSBen Gras# ----------------------------
30ef01931fSBen Gras# Automake X.Y traces this macro to ensure aclocal.m4 has been
31ef01931fSBen Gras# generated from the m4 files accompanying Automake X.Y.
32ef01931fSBen Gras# (This private macro should not be called outside this file.)
33ef01931fSBen GrasAC_DEFUN([AM_AUTOMAKE_VERSION],
34*835f6802SDirk Vogt[am__api_version='1.11'
35ef01931fSBen Grasdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36ef01931fSBen Grasdnl require some minimum version.  Point them to the right macro.
37*835f6802SDirk Vogtm4_if([$1], [1.11], [],
38ef01931fSBen Gras      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39ef01931fSBen Gras])
40ef01931fSBen Gras
41ef01931fSBen Gras# _AM_AUTOCONF_VERSION(VERSION)
42ef01931fSBen Gras# -----------------------------
43ef01931fSBen Gras# aclocal traces this macro to find the Autoconf version.
44ef01931fSBen Gras# This is a private macro too.  Using m4_define simplifies
45ef01931fSBen Gras# the logic in aclocal, which can simply ignore this definition.
46ef01931fSBen Grasm4_define([_AM_AUTOCONF_VERSION], [])
47ef01931fSBen Gras
48ef01931fSBen Gras# AM_SET_CURRENT_AUTOMAKE_VERSION
49ef01931fSBen Gras# -------------------------------
50ef01931fSBen Gras# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51*835f6802SDirk Vogt# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52ef01931fSBen GrasAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53*835f6802SDirk Vogt[AM_AUTOMAKE_VERSION([1.11])dnl
54*835f6802SDirk Vogtm4_ifndef([AC_AUTOCONF_VERSION],
55*835f6802SDirk Vogt  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56*835f6802SDirk Vogt_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57ef01931fSBen Gras
58ef01931fSBen Gras# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59ef01931fSBen Gras
60ef01931fSBen Gras# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61ef01931fSBen Gras#
62ef01931fSBen Gras# This file is free software; the Free Software Foundation
63ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
64ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
65ef01931fSBen Gras
66ef01931fSBen Gras# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67ef01931fSBen Gras# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68ef01931fSBen Gras# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69ef01931fSBen Gras#
70ef01931fSBen Gras# Of course, Automake must honor this variable whenever it calls a
71ef01931fSBen Gras# tool from the auxiliary directory.  The problem is that $srcdir (and
72ef01931fSBen Gras# therefore $ac_aux_dir as well) can be either absolute or relative,
73ef01931fSBen Gras# depending on how configure is run.  This is pretty annoying, since
74ef01931fSBen Gras# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75ef01931fSBen Gras# source directory, any form will work fine, but in subdirectories a
76ef01931fSBen Gras# relative path needs to be adjusted first.
77ef01931fSBen Gras#
78ef01931fSBen Gras# $ac_aux_dir/missing
79ef01931fSBen Gras#    fails when called from a subdirectory if $ac_aux_dir is relative
80ef01931fSBen Gras# $top_srcdir/$ac_aux_dir/missing
81ef01931fSBen Gras#    fails if $ac_aux_dir is absolute,
82ef01931fSBen Gras#    fails when called from a subdirectory in a VPATH build with
83ef01931fSBen Gras#          a relative $ac_aux_dir
84ef01931fSBen Gras#
85ef01931fSBen Gras# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86ef01931fSBen Gras# are both prefixed by $srcdir.  In an in-source build this is usually
87ef01931fSBen Gras# harmless because $srcdir is `.', but things will broke when you
88ef01931fSBen Gras# start a VPATH build or use an absolute $srcdir.
89ef01931fSBen Gras#
90ef01931fSBen Gras# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91ef01931fSBen Gras# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92ef01931fSBen Gras#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93ef01931fSBen Gras# and then we would define $MISSING as
94ef01931fSBen Gras#   MISSING="\${SHELL} $am_aux_dir/missing"
95ef01931fSBen Gras# This will work as long as MISSING is not called from configure, because
96ef01931fSBen Gras# unfortunately $(top_srcdir) has no meaning in configure.
97ef01931fSBen Gras# However there are other variables, like CC, which are often used in
98ef01931fSBen Gras# configure, and could therefore not use this "fixed" $ac_aux_dir.
99ef01931fSBen Gras#
100ef01931fSBen Gras# Another solution, used here, is to always expand $ac_aux_dir to an
101ef01931fSBen Gras# absolute PATH.  The drawback is that using absolute paths prevent a
102ef01931fSBen Gras# configured tree to be moved without reconfiguration.
103ef01931fSBen Gras
104ef01931fSBen GrasAC_DEFUN([AM_AUX_DIR_EXPAND],
105ef01931fSBen Gras[dnl Rely on autoconf to set up CDPATH properly.
106ef01931fSBen GrasAC_PREREQ([2.50])dnl
107ef01931fSBen Gras# expand $ac_aux_dir to an absolute path
108ef01931fSBen Grasam_aux_dir=`cd $ac_aux_dir && pwd`
109ef01931fSBen Gras])
110ef01931fSBen Gras
111ef01931fSBen Gras# AM_CONDITIONAL                                            -*- Autoconf -*-
112ef01931fSBen Gras
113*835f6802SDirk Vogt# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114ef01931fSBen Gras# Free Software Foundation, Inc.
115ef01931fSBen Gras#
116ef01931fSBen Gras# This file is free software; the Free Software Foundation
117ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
118ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
119ef01931fSBen Gras
120*835f6802SDirk Vogt# serial 9
121ef01931fSBen Gras
122ef01931fSBen Gras# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123ef01931fSBen Gras# -------------------------------------
124ef01931fSBen Gras# Define a conditional.
125ef01931fSBen GrasAC_DEFUN([AM_CONDITIONAL],
126ef01931fSBen Gras[AC_PREREQ(2.52)dnl
127ef01931fSBen Gras ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128ef01931fSBen Gras	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129ef01931fSBen GrasAC_SUBST([$1_TRUE])dnl
130ef01931fSBen GrasAC_SUBST([$1_FALSE])dnl
131ef01931fSBen Gras_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132ef01931fSBen Gras_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133*835f6802SDirk Vogtm4_define([_AM_COND_VALUE_$1], [$2])dnl
134ef01931fSBen Grasif $2; then
135ef01931fSBen Gras  $1_TRUE=
136ef01931fSBen Gras  $1_FALSE='#'
137ef01931fSBen Graselse
138ef01931fSBen Gras  $1_TRUE='#'
139ef01931fSBen Gras  $1_FALSE=
140ef01931fSBen Grasfi
141ef01931fSBen GrasAC_CONFIG_COMMANDS_PRE(
142ef01931fSBen Gras[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143ef01931fSBen Gras  AC_MSG_ERROR([[conditional "$1" was never defined.
144ef01931fSBen GrasUsually this means the macro was only invoked conditionally.]])
145ef01931fSBen Grasfi])])
146ef01931fSBen Gras
147*835f6802SDirk Vogt# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148ef01931fSBen Gras# Free Software Foundation, Inc.
149ef01931fSBen Gras#
150ef01931fSBen Gras# This file is free software; the Free Software Foundation
151ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
152ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
153ef01931fSBen Gras
154*835f6802SDirk Vogt# serial 10
155ef01931fSBen Gras
156ef01931fSBen Gras# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157ef01931fSBen Gras# written in clear, in which case automake, when reading aclocal.m4,
158ef01931fSBen Gras# will think it sees a *use*, and therefore will trigger all it's
159ef01931fSBen Gras# C support machinery.  Also note that it means that autoscan, seeing
160ef01931fSBen Gras# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161ef01931fSBen Gras
162ef01931fSBen Gras
163ef01931fSBen Gras# _AM_DEPENDENCIES(NAME)
164ef01931fSBen Gras# ----------------------
165ef01931fSBen Gras# See how the compiler implements dependency checking.
166ef01931fSBen Gras# NAME is "CC", "CXX", "GCJ", or "OBJC".
167ef01931fSBen Gras# We try a few techniques and use that to set a single cache variable.
168ef01931fSBen Gras#
169ef01931fSBen Gras# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170ef01931fSBen Gras# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171ef01931fSBen Gras# dependency, and given that the user is not expected to run this macro,
172ef01931fSBen Gras# just rely on AC_PROG_CC.
173ef01931fSBen GrasAC_DEFUN([_AM_DEPENDENCIES],
174ef01931fSBen Gras[AC_REQUIRE([AM_SET_DEPDIR])dnl
175ef01931fSBen GrasAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176ef01931fSBen GrasAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177ef01931fSBen GrasAC_REQUIRE([AM_DEP_TRACK])dnl
178ef01931fSBen Gras
179ef01931fSBen Grasifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180ef01931fSBen Gras       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181ef01931fSBen Gras       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182ef01931fSBen Gras       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183ef01931fSBen Gras       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184ef01931fSBen Gras                   [depcc="$$1"   am_compiler_list=])
185ef01931fSBen Gras
186ef01931fSBen GrasAC_CACHE_CHECK([dependency style of $depcc],
187ef01931fSBen Gras               [am_cv_$1_dependencies_compiler_type],
188ef01931fSBen Gras[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189ef01931fSBen Gras  # We make a subdir and do the tests there.  Otherwise we can end up
190ef01931fSBen Gras  # making bogus files that we don't know about and never remove.  For
191ef01931fSBen Gras  # instance it was reported that on HP-UX the gcc test will end up
192ef01931fSBen Gras  # making a dummy file named `D' -- because `-MD' means `put the output
193ef01931fSBen Gras  # in D'.
194ef01931fSBen Gras  mkdir conftest.dir
195ef01931fSBen Gras  # Copy depcomp to subdir because otherwise we won't find it if we're
196ef01931fSBen Gras  # using a relative directory.
197ef01931fSBen Gras  cp "$am_depcomp" conftest.dir
198ef01931fSBen Gras  cd conftest.dir
199ef01931fSBen Gras  # We will build objects and dependencies in a subdirectory because
200ef01931fSBen Gras  # it helps to detect inapplicable dependency modes.  For instance
201ef01931fSBen Gras  # both Tru64's cc and ICC support -MD to output dependencies as a
202ef01931fSBen Gras  # side effect of compilation, but ICC will put the dependencies in
203ef01931fSBen Gras  # the current directory while Tru64 will put them in the object
204ef01931fSBen Gras  # directory.
205ef01931fSBen Gras  mkdir sub
206ef01931fSBen Gras
207ef01931fSBen Gras  am_cv_$1_dependencies_compiler_type=none
208ef01931fSBen Gras  if test "$am_compiler_list" = ""; then
209ef01931fSBen Gras     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210ef01931fSBen Gras  fi
211*835f6802SDirk Vogt  am__universal=false
212*835f6802SDirk Vogt  m4_case([$1], [CC],
213*835f6802SDirk Vogt    [case " $depcc " in #(
214*835f6802SDirk Vogt     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215*835f6802SDirk Vogt     esac],
216*835f6802SDirk Vogt    [CXX],
217*835f6802SDirk Vogt    [case " $depcc " in #(
218*835f6802SDirk Vogt     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219*835f6802SDirk Vogt     esac])
220*835f6802SDirk Vogt
221ef01931fSBen Gras  for depmode in $am_compiler_list; do
222ef01931fSBen Gras    # Setup a source with many dependencies, because some compilers
223ef01931fSBen Gras    # like to wrap large dependency lists on column 80 (with \), and
224ef01931fSBen Gras    # we should not choose a depcomp mode which is confused by this.
225ef01931fSBen Gras    #
226ef01931fSBen Gras    # We need to recreate these files for each test, as the compiler may
227ef01931fSBen Gras    # overwrite some of them when testing with obscure command lines.
228ef01931fSBen Gras    # This happens at least with the AIX C compiler.
229ef01931fSBen Gras    : > sub/conftest.c
230ef01931fSBen Gras    for i in 1 2 3 4 5 6; do
231ef01931fSBen Gras      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232ef01931fSBen Gras      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233ef01931fSBen Gras      # Solaris 8's {/usr,}/bin/sh.
234ef01931fSBen Gras      touch sub/conftst$i.h
235ef01931fSBen Gras    done
236ef01931fSBen Gras    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237ef01931fSBen Gras
238*835f6802SDirk Vogt    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239*835f6802SDirk Vogt    # mode.  It turns out that the SunPro C++ compiler does not properly
240*835f6802SDirk Vogt    # handle `-M -o', and we need to detect this.  Also, some Intel
241*835f6802SDirk Vogt    # versions had trouble with output in subdirs
242*835f6802SDirk Vogt    am__obj=sub/conftest.${OBJEXT-o}
243*835f6802SDirk Vogt    am__minus_obj="-o $am__obj"
244ef01931fSBen Gras    case $depmode in
245*835f6802SDirk Vogt    gcc)
246*835f6802SDirk Vogt      # This depmode causes a compiler race in universal mode.
247*835f6802SDirk Vogt      test "$am__universal" = false || continue
248*835f6802SDirk Vogt      ;;
249ef01931fSBen Gras    nosideeffect)
250ef01931fSBen Gras      # after this tag, mechanisms are not by side-effect, so they'll
251ef01931fSBen Gras      # only be used when explicitly requested
252ef01931fSBen Gras      if test "x$enable_dependency_tracking" = xyes; then
253ef01931fSBen Gras	continue
254ef01931fSBen Gras      else
255ef01931fSBen Gras	break
256ef01931fSBen Gras      fi
257ef01931fSBen Gras      ;;
258*835f6802SDirk Vogt    msvisualcpp | msvcmsys)
259*835f6802SDirk Vogt      # This compiler won't grok `-c -o', but also, the minuso test has
260*835f6802SDirk Vogt      # not run yet.  These depmodes are late enough in the game, and
261*835f6802SDirk Vogt      # so weak that their functioning should not be impacted.
262*835f6802SDirk Vogt      am__obj=conftest.${OBJEXT-o}
263*835f6802SDirk Vogt      am__minus_obj=
264*835f6802SDirk Vogt      ;;
265ef01931fSBen Gras    none) break ;;
266ef01931fSBen Gras    esac
267ef01931fSBen Gras    if depmode=$depmode \
268*835f6802SDirk Vogt       source=sub/conftest.c object=$am__obj \
269ef01931fSBen Gras       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270*835f6802SDirk Vogt       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271ef01931fSBen Gras         >/dev/null 2>conftest.err &&
272ef01931fSBen Gras       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273ef01931fSBen Gras       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274*835f6802SDirk Vogt       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275ef01931fSBen Gras       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276ef01931fSBen Gras      # icc doesn't choke on unknown options, it will just issue warnings
277ef01931fSBen Gras      # or remarks (even with -Werror).  So we grep stderr for any message
278ef01931fSBen Gras      # that says an option was ignored or not supported.
279ef01931fSBen Gras      # When given -MP, icc 7.0 and 7.1 complain thusly:
280ef01931fSBen Gras      #   icc: Command line warning: ignoring option '-M'; no argument required
281ef01931fSBen Gras      # The diagnosis changed in icc 8.0:
282ef01931fSBen Gras      #   icc: Command line remark: option '-MP' not supported
283ef01931fSBen Gras      if (grep 'ignoring option' conftest.err ||
284ef01931fSBen Gras          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285ef01931fSBen Gras        am_cv_$1_dependencies_compiler_type=$depmode
286ef01931fSBen Gras        break
287ef01931fSBen Gras      fi
288ef01931fSBen Gras    fi
289ef01931fSBen Gras  done
290ef01931fSBen Gras
291ef01931fSBen Gras  cd ..
292ef01931fSBen Gras  rm -rf conftest.dir
293ef01931fSBen Graselse
294ef01931fSBen Gras  am_cv_$1_dependencies_compiler_type=none
295ef01931fSBen Grasfi
296ef01931fSBen Gras])
297ef01931fSBen GrasAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298ef01931fSBen GrasAM_CONDITIONAL([am__fastdep$1], [
299ef01931fSBen Gras  test "x$enable_dependency_tracking" != xno \
300ef01931fSBen Gras  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301ef01931fSBen Gras])
302ef01931fSBen Gras
303ef01931fSBen Gras
304ef01931fSBen Gras# AM_SET_DEPDIR
305ef01931fSBen Gras# -------------
306ef01931fSBen Gras# Choose a directory name for dependency files.
307ef01931fSBen Gras# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308ef01931fSBen GrasAC_DEFUN([AM_SET_DEPDIR],
309ef01931fSBen Gras[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310ef01931fSBen GrasAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311ef01931fSBen Gras])
312ef01931fSBen Gras
313ef01931fSBen Gras
314ef01931fSBen Gras# AM_DEP_TRACK
315ef01931fSBen Gras# ------------
316ef01931fSBen GrasAC_DEFUN([AM_DEP_TRACK],
317ef01931fSBen Gras[AC_ARG_ENABLE(dependency-tracking,
318ef01931fSBen Gras[  --disable-dependency-tracking  speeds up one-time build
319ef01931fSBen Gras  --enable-dependency-tracking   do not reject slow dependency extractors])
320ef01931fSBen Grasif test "x$enable_dependency_tracking" != xno; then
321ef01931fSBen Gras  am_depcomp="$ac_aux_dir/depcomp"
322ef01931fSBen Gras  AMDEPBACKSLASH='\'
323ef01931fSBen Grasfi
324ef01931fSBen GrasAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325ef01931fSBen GrasAC_SUBST([AMDEPBACKSLASH])dnl
326ef01931fSBen Gras_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327ef01931fSBen Gras])
328ef01931fSBen Gras
329ef01931fSBen Gras# Generate code to set up dependency tracking.              -*- Autoconf -*-
330ef01931fSBen Gras
331*835f6802SDirk Vogt# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332ef01931fSBen Gras# Free Software Foundation, Inc.
333ef01931fSBen Gras#
334ef01931fSBen Gras# This file is free software; the Free Software Foundation
335ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
336ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
337ef01931fSBen Gras
338*835f6802SDirk Vogt#serial 5
339ef01931fSBen Gras
340ef01931fSBen Gras# _AM_OUTPUT_DEPENDENCY_COMMANDS
341ef01931fSBen Gras# ------------------------------
342ef01931fSBen GrasAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343*835f6802SDirk Vogt[{
344*835f6802SDirk Vogt  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345*835f6802SDirk Vogt  # are listed without --file.  Let's play safe and only enable the eval
346*835f6802SDirk Vogt  # if we detect the quoting.
347*835f6802SDirk Vogt  case $CONFIG_FILES in
348*835f6802SDirk Vogt  *\'*) eval set x "$CONFIG_FILES" ;;
349*835f6802SDirk Vogt  *)   set x $CONFIG_FILES ;;
350*835f6802SDirk Vogt  esac
351*835f6802SDirk Vogt  shift
352*835f6802SDirk Vogt  for mf
353*835f6802SDirk Vogt  do
354ef01931fSBen Gras    # Strip MF so we end up with the name of the file.
355ef01931fSBen Gras    mf=`echo "$mf" | sed -e 's/:.*$//'`
356ef01931fSBen Gras    # Check whether this is an Automake generated Makefile or not.
357ef01931fSBen Gras    # We used to match only the files named `Makefile.in', but
358ef01931fSBen Gras    # some people rename them; so instead we look at the file content.
359ef01931fSBen Gras    # Grep'ing the first line is not enough: some people post-process
360ef01931fSBen Gras    # each Makefile.in and add a new line on top of each file to say so.
361ef01931fSBen Gras    # Grep'ing the whole file is not good either: AIX grep has a line
362ef01931fSBen Gras    # limit of 2048, but all sed's we know have understand at least 4000.
363*835f6802SDirk Vogt    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364ef01931fSBen Gras      dirpart=`AS_DIRNAME("$mf")`
365ef01931fSBen Gras    else
366ef01931fSBen Gras      continue
367ef01931fSBen Gras    fi
368ef01931fSBen Gras    # Extract the definition of DEPDIR, am__include, and am__quote
369ef01931fSBen Gras    # from the Makefile without running `make'.
370ef01931fSBen Gras    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371ef01931fSBen Gras    test -z "$DEPDIR" && continue
372ef01931fSBen Gras    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373ef01931fSBen Gras    test -z "am__include" && continue
374ef01931fSBen Gras    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375ef01931fSBen Gras    # When using ansi2knr, U may be empty or an underscore; expand it
376ef01931fSBen Gras    U=`sed -n 's/^U = //p' < "$mf"`
377ef01931fSBen Gras    # Find all dependency output files, they are included files with
378ef01931fSBen Gras    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379ef01931fSBen Gras    # simplest approach to changing $(DEPDIR) to its actual value in the
380ef01931fSBen Gras    # expansion.
381ef01931fSBen Gras    for file in `sed -n "
382ef01931fSBen Gras      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383ef01931fSBen Gras	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384ef01931fSBen Gras      # Make sure the directory exists.
385ef01931fSBen Gras      test -f "$dirpart/$file" && continue
386ef01931fSBen Gras      fdir=`AS_DIRNAME(["$file"])`
387ef01931fSBen Gras      AS_MKDIR_P([$dirpart/$fdir])
388ef01931fSBen Gras      # echo "creating $dirpart/$file"
389ef01931fSBen Gras      echo '# dummy' > "$dirpart/$file"
390ef01931fSBen Gras    done
391ef01931fSBen Gras  done
392*835f6802SDirk Vogt}
393ef01931fSBen Gras])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394ef01931fSBen Gras
395ef01931fSBen Gras
396ef01931fSBen Gras# AM_OUTPUT_DEPENDENCY_COMMANDS
397ef01931fSBen Gras# -----------------------------
398ef01931fSBen Gras# This macro should only be invoked once -- use via AC_REQUIRE.
399ef01931fSBen Gras#
400ef01931fSBen Gras# This code is only required when automatic dependency tracking
401ef01931fSBen Gras# is enabled.  FIXME.  This creates each `.P' file that we will
402ef01931fSBen Gras# need in order to bootstrap the dependency handling code.
403ef01931fSBen GrasAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404ef01931fSBen Gras[AC_CONFIG_COMMANDS([depfiles],
405ef01931fSBen Gras     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406ef01931fSBen Gras     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407ef01931fSBen Gras])
408ef01931fSBen Gras
409ef01931fSBen Gras# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
410ef01931fSBen Gras# Free Software Foundation, Inc.
411ef01931fSBen Gras#
412ef01931fSBen Gras# This file is free software; the Free Software Foundation
413ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
414ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
415ef01931fSBen Gras
416ef01931fSBen Gras# serial 8
417ef01931fSBen Gras
418ef01931fSBen Gras# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
419ef01931fSBen GrasAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
420ef01931fSBen Gras
421ef01931fSBen Gras# Do all the work for Automake.                             -*- Autoconf -*-
422ef01931fSBen Gras
423ef01931fSBen Gras# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
424*835f6802SDirk Vogt# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
425ef01931fSBen Gras#
426ef01931fSBen Gras# This file is free software; the Free Software Foundation
427ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
428ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
429ef01931fSBen Gras
430*835f6802SDirk Vogt# serial 16
431ef01931fSBen Gras
432ef01931fSBen Gras# This macro actually does too much.  Some checks are only needed if
433ef01931fSBen Gras# your package does certain things.  But this isn't really a big deal.
434ef01931fSBen Gras
435ef01931fSBen Gras# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
436ef01931fSBen Gras# AM_INIT_AUTOMAKE([OPTIONS])
437ef01931fSBen Gras# -----------------------------------------------
438ef01931fSBen Gras# The call with PACKAGE and VERSION arguments is the old style
439ef01931fSBen Gras# call (pre autoconf-2.50), which is being phased out.  PACKAGE
440ef01931fSBen Gras# and VERSION should now be passed to AC_INIT and removed from
441ef01931fSBen Gras# the call to AM_INIT_AUTOMAKE.
442ef01931fSBen Gras# We support both call styles for the transition.  After
443ef01931fSBen Gras# the next Automake release, Autoconf can make the AC_INIT
444ef01931fSBen Gras# arguments mandatory, and then we can depend on a new Autoconf
445ef01931fSBen Gras# release and drop the old call support.
446ef01931fSBen GrasAC_DEFUN([AM_INIT_AUTOMAKE],
447*835f6802SDirk Vogt[AC_PREREQ([2.62])dnl
448ef01931fSBen Grasdnl Autoconf wants to disallow AM_ names.  We explicitly allow
449ef01931fSBen Grasdnl the ones we care about.
450ef01931fSBen Grasm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
451ef01931fSBen GrasAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
452ef01931fSBen GrasAC_REQUIRE([AC_PROG_INSTALL])dnl
453ef01931fSBen Grasif test "`cd $srcdir && pwd`" != "`pwd`"; then
454ef01931fSBen Gras  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
455ef01931fSBen Gras  # is not polluted with repeated "-I."
456ef01931fSBen Gras  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
457ef01931fSBen Gras  # test to see if srcdir already configured
458ef01931fSBen Gras  if test -f $srcdir/config.status; then
459ef01931fSBen Gras    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
460ef01931fSBen Gras  fi
461ef01931fSBen Grasfi
462ef01931fSBen Gras
463ef01931fSBen Gras# test whether we have cygpath
464ef01931fSBen Grasif test -z "$CYGPATH_W"; then
465ef01931fSBen Gras  if (cygpath --version) >/dev/null 2>/dev/null; then
466ef01931fSBen Gras    CYGPATH_W='cygpath -w'
467ef01931fSBen Gras  else
468ef01931fSBen Gras    CYGPATH_W=echo
469ef01931fSBen Gras  fi
470ef01931fSBen Grasfi
471ef01931fSBen GrasAC_SUBST([CYGPATH_W])
472ef01931fSBen Gras
473ef01931fSBen Gras# Define the identity of the package.
474ef01931fSBen Grasdnl Distinguish between old-style and new-style calls.
475ef01931fSBen Grasm4_ifval([$2],
476ef01931fSBen Gras[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
477ef01931fSBen Gras AC_SUBST([PACKAGE], [$1])dnl
478ef01931fSBen Gras AC_SUBST([VERSION], [$2])],
479ef01931fSBen Gras[_AM_SET_OPTIONS([$1])dnl
480ef01931fSBen Grasdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
481ef01931fSBen Grasm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
482ef01931fSBen Gras  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
483ef01931fSBen Gras AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
484ef01931fSBen Gras AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
485ef01931fSBen Gras
486ef01931fSBen Gras_AM_IF_OPTION([no-define],,
487ef01931fSBen Gras[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
488ef01931fSBen Gras AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
489ef01931fSBen Gras
490ef01931fSBen Gras# Some tools Automake needs.
491ef01931fSBen GrasAC_REQUIRE([AM_SANITY_CHECK])dnl
492ef01931fSBen GrasAC_REQUIRE([AC_ARG_PROGRAM])dnl
493ef01931fSBen GrasAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
494ef01931fSBen GrasAM_MISSING_PROG(AUTOCONF, autoconf)
495ef01931fSBen GrasAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
496ef01931fSBen GrasAM_MISSING_PROG(AUTOHEADER, autoheader)
497ef01931fSBen GrasAM_MISSING_PROG(MAKEINFO, makeinfo)
498*835f6802SDirk VogtAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
499*835f6802SDirk VogtAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
500ef01931fSBen GrasAC_REQUIRE([AM_PROG_MKDIR_P])dnl
501ef01931fSBen Gras# We need awk for the "check" target.  The system "awk" is bad on
502ef01931fSBen Gras# some platforms.
503ef01931fSBen GrasAC_REQUIRE([AC_PROG_AWK])dnl
504ef01931fSBen GrasAC_REQUIRE([AC_PROG_MAKE_SET])dnl
505ef01931fSBen GrasAC_REQUIRE([AM_SET_LEADING_DOT])dnl
506ef01931fSBen Gras_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
507ef01931fSBen Gras	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
508ef01931fSBen Gras			     [_AM_PROG_TAR([v7])])])
509ef01931fSBen Gras_AM_IF_OPTION([no-dependencies],,
510ef01931fSBen Gras[AC_PROVIDE_IFELSE([AC_PROG_CC],
511ef01931fSBen Gras		  [_AM_DEPENDENCIES(CC)],
512ef01931fSBen Gras		  [define([AC_PROG_CC],
513ef01931fSBen Gras			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
514ef01931fSBen GrasAC_PROVIDE_IFELSE([AC_PROG_CXX],
515ef01931fSBen Gras		  [_AM_DEPENDENCIES(CXX)],
516ef01931fSBen Gras		  [define([AC_PROG_CXX],
517ef01931fSBen Gras			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
518ef01931fSBen GrasAC_PROVIDE_IFELSE([AC_PROG_OBJC],
519ef01931fSBen Gras		  [_AM_DEPENDENCIES(OBJC)],
520ef01931fSBen Gras		  [define([AC_PROG_OBJC],
521ef01931fSBen Gras			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
522ef01931fSBen Gras])
523*835f6802SDirk Vogt_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
524*835f6802SDirk Vogtdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
525*835f6802SDirk Vogtdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
526*835f6802SDirk Vogtdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
527*835f6802SDirk VogtAC_CONFIG_COMMANDS_PRE(dnl
528*835f6802SDirk Vogt[m4_provide_if([_AM_COMPILER_EXEEXT],
529*835f6802SDirk Vogt  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
530ef01931fSBen Gras])
531ef01931fSBen Gras
532*835f6802SDirk Vogtdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
533*835f6802SDirk Vogtdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
534*835f6802SDirk Vogtdnl mangled by Autoconf and run in a shell conditional statement.
535*835f6802SDirk Vogtm4_define([_AC_COMPILER_EXEEXT],
536*835f6802SDirk Vogtm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
537*835f6802SDirk Vogt
538ef01931fSBen Gras
539ef01931fSBen Gras# When config.status generates a header, we must update the stamp-h file.
540ef01931fSBen Gras# This file resides in the same directory as the config header
541ef01931fSBen Gras# that is generated.  The stamp files are numbered to have different names.
542ef01931fSBen Gras
543ef01931fSBen Gras# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
544ef01931fSBen Gras# loop where config.status creates the headers, so we can generate
545ef01931fSBen Gras# our stamp files there.
546ef01931fSBen GrasAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
547ef01931fSBen Gras[# Compute $1's index in $config_headers.
548*835f6802SDirk Vogt_am_arg=$1
549ef01931fSBen Gras_am_stamp_count=1
550ef01931fSBen Grasfor _am_header in $config_headers :; do
551ef01931fSBen Gras  case $_am_header in
552*835f6802SDirk Vogt    $_am_arg | $_am_arg:* )
553ef01931fSBen Gras      break ;;
554ef01931fSBen Gras    * )
555ef01931fSBen Gras      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
556ef01931fSBen Gras  esac
557ef01931fSBen Grasdone
558*835f6802SDirk Vogtecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
559ef01931fSBen Gras
560*835f6802SDirk Vogt# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
561ef01931fSBen Gras#
562ef01931fSBen Gras# This file is free software; the Free Software Foundation
563ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
564ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
565ef01931fSBen Gras
566ef01931fSBen Gras# AM_PROG_INSTALL_SH
567ef01931fSBen Gras# ------------------
568ef01931fSBen Gras# Define $install_sh.
569ef01931fSBen GrasAC_DEFUN([AM_PROG_INSTALL_SH],
570ef01931fSBen Gras[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
571*835f6802SDirk Vogtif test x"${install_sh}" != xset; then
572*835f6802SDirk Vogt  case $am_aux_dir in
573*835f6802SDirk Vogt  *\ * | *\	*)
574*835f6802SDirk Vogt    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
575*835f6802SDirk Vogt  *)
576*835f6802SDirk Vogt    install_sh="\${SHELL} $am_aux_dir/install-sh"
577*835f6802SDirk Vogt  esac
578*835f6802SDirk Vogtfi
579ef01931fSBen GrasAC_SUBST(install_sh)])
580ef01931fSBen Gras
581ef01931fSBen Gras# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
582ef01931fSBen Gras#
583ef01931fSBen Gras# This file is free software; the Free Software Foundation
584ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
585ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
586ef01931fSBen Gras
587ef01931fSBen Gras# serial 2
588ef01931fSBen Gras
589ef01931fSBen Gras# Check whether the underlying file-system supports filenames
590ef01931fSBen Gras# with a leading dot.  For instance MS-DOS doesn't.
591ef01931fSBen GrasAC_DEFUN([AM_SET_LEADING_DOT],
592ef01931fSBen Gras[rm -rf .tst 2>/dev/null
593ef01931fSBen Grasmkdir .tst 2>/dev/null
594ef01931fSBen Grasif test -d .tst; then
595ef01931fSBen Gras  am__leading_dot=.
596ef01931fSBen Graselse
597ef01931fSBen Gras  am__leading_dot=_
598ef01931fSBen Grasfi
599ef01931fSBen Grasrmdir .tst 2>/dev/null
600ef01931fSBen GrasAC_SUBST([am__leading_dot])])
601ef01931fSBen Gras
602*835f6802SDirk Vogt# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
603*835f6802SDirk Vogt# From Jim Meyering
604ef01931fSBen Gras
605*835f6802SDirk Vogt# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
606*835f6802SDirk Vogt# Free Software Foundation, Inc.
607ef01931fSBen Gras#
608ef01931fSBen Gras# This file is free software; the Free Software Foundation
609ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
610ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
611ef01931fSBen Gras
612*835f6802SDirk Vogt# serial 5
613*835f6802SDirk Vogt
614*835f6802SDirk Vogt# AM_MAINTAINER_MODE([DEFAULT-MODE])
615*835f6802SDirk Vogt# ----------------------------------
616*835f6802SDirk Vogt# Control maintainer-specific portions of Makefiles.
617*835f6802SDirk Vogt# Default is to disable them, unless `enable' is passed literally.
618*835f6802SDirk Vogt# For symmetry, `disable' may be passed as well.  Anyway, the user
619*835f6802SDirk Vogt# can override the default with the --enable/--disable switch.
620*835f6802SDirk VogtAC_DEFUN([AM_MAINTAINER_MODE],
621*835f6802SDirk Vogt[m4_case(m4_default([$1], [disable]),
622*835f6802SDirk Vogt       [enable], [m4_define([am_maintainer_other], [disable])],
623*835f6802SDirk Vogt       [disable], [m4_define([am_maintainer_other], [enable])],
624*835f6802SDirk Vogt       [m4_define([am_maintainer_other], [enable])
625*835f6802SDirk Vogt        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
626*835f6802SDirk VogtAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
627*835f6802SDirk Vogt  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
628*835f6802SDirk Vogt  AC_ARG_ENABLE([maintainer-mode],
629*835f6802SDirk Vogt[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
630*835f6802SDirk Vogt			  (and sometimes confusing) to the casual installer],
631*835f6802SDirk Vogt      [USE_MAINTAINER_MODE=$enableval],
632*835f6802SDirk Vogt      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
633*835f6802SDirk Vogt  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
634*835f6802SDirk Vogt  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
635*835f6802SDirk Vogt  MAINT=$MAINTAINER_MODE_TRUE
636*835f6802SDirk Vogt  AC_SUBST([MAINT])dnl
637*835f6802SDirk Vogt]
638*835f6802SDirk Vogt)
639*835f6802SDirk Vogt
640*835f6802SDirk VogtAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
641*835f6802SDirk Vogt
642*835f6802SDirk Vogt# Check to see how 'make' treats includes.	            -*- Autoconf -*-
643*835f6802SDirk Vogt
644*835f6802SDirk Vogt# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
645*835f6802SDirk Vogt#
646*835f6802SDirk Vogt# This file is free software; the Free Software Foundation
647*835f6802SDirk Vogt# gives unlimited permission to copy and/or distribute it,
648*835f6802SDirk Vogt# with or without modifications, as long as this notice is preserved.
649*835f6802SDirk Vogt
650*835f6802SDirk Vogt# serial 4
651ef01931fSBen Gras
652ef01931fSBen Gras# AM_MAKE_INCLUDE()
653ef01931fSBen Gras# -----------------
654ef01931fSBen Gras# Check to see how make treats includes.
655ef01931fSBen GrasAC_DEFUN([AM_MAKE_INCLUDE],
656ef01931fSBen Gras[am_make=${MAKE-make}
657ef01931fSBen Grascat > confinc << 'END'
658ef01931fSBen Grasam__doit:
659*835f6802SDirk Vogt	@echo this is the am__doit target
660ef01931fSBen Gras.PHONY: am__doit
661ef01931fSBen GrasEND
662ef01931fSBen Gras# If we don't find an include directive, just comment out the code.
663ef01931fSBen GrasAC_MSG_CHECKING([for style of include used by $am_make])
664ef01931fSBen Grasam__include="#"
665ef01931fSBen Grasam__quote=
666ef01931fSBen Gras_am_result=none
667ef01931fSBen Gras# First try GNU make style include.
668ef01931fSBen Grasecho "include confinc" > confmf
669*835f6802SDirk Vogt# Ignore all kinds of additional output from `make'.
670*835f6802SDirk Vogtcase `$am_make -s -f confmf 2> /dev/null` in #(
671*835f6802SDirk Vogt*the\ am__doit\ target*)
672ef01931fSBen Gras  am__include=include
673ef01931fSBen Gras  am__quote=
674ef01931fSBen Gras  _am_result=GNU
675*835f6802SDirk Vogt  ;;
676*835f6802SDirk Vogtesac
677ef01931fSBen Gras# Now try BSD make style include.
678ef01931fSBen Grasif test "$am__include" = "#"; then
679ef01931fSBen Gras   echo '.include "confinc"' > confmf
680*835f6802SDirk Vogt   case `$am_make -s -f confmf 2> /dev/null` in #(
681*835f6802SDirk Vogt   *the\ am__doit\ target*)
682ef01931fSBen Gras     am__include=.include
683ef01931fSBen Gras     am__quote="\""
684ef01931fSBen Gras     _am_result=BSD
685*835f6802SDirk Vogt     ;;
686*835f6802SDirk Vogt   esac
687ef01931fSBen Grasfi
688ef01931fSBen GrasAC_SUBST([am__include])
689ef01931fSBen GrasAC_SUBST([am__quote])
690ef01931fSBen GrasAC_MSG_RESULT([$_am_result])
691ef01931fSBen Grasrm -f confinc confmf
692ef01931fSBen Gras])
693ef01931fSBen Gras
694*835f6802SDirk Vogt# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
695ef01931fSBen Gras# Free Software Foundation, Inc.
696ef01931fSBen Gras#
697ef01931fSBen Gras# This file is free software; the Free Software Foundation
698ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
699ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
700ef01931fSBen Gras
701*835f6802SDirk Vogt# serial 6
702ef01931fSBen Gras
703ef01931fSBen Gras# AM_PROG_CC_C_O
704ef01931fSBen Gras# --------------
705ef01931fSBen Gras# Like AC_PROG_CC_C_O, but changed for automake.
706ef01931fSBen GrasAC_DEFUN([AM_PROG_CC_C_O],
707ef01931fSBen Gras[AC_REQUIRE([AC_PROG_CC_C_O])dnl
708ef01931fSBen GrasAC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
709ef01931fSBen GrasAC_REQUIRE_AUX_FILE([compile])dnl
710ef01931fSBen Gras# FIXME: we rely on the cache variable name because
711ef01931fSBen Gras# there is no other way.
712ef01931fSBen Grasset dummy $CC
713*835f6802SDirk Vogtam_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
714*835f6802SDirk Vogteval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
715*835f6802SDirk Vogtif test "$am_t" != yes; then
716ef01931fSBen Gras   # Losing compiler, so override with the script.
717ef01931fSBen Gras   # FIXME: It is wrong to rewrite CC.
718ef01931fSBen Gras   # But if we don't then we get into trouble of one sort or another.
719ef01931fSBen Gras   # A longer-term fix would be to have automake use am__CC in this case,
720ef01931fSBen Gras   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
721ef01931fSBen Gras   CC="$am_aux_dir/compile $CC"
722ef01931fSBen Grasfi
723ef01931fSBen Grasdnl Make sure AC_PROG_CC is never called again, or it will override our
724ef01931fSBen Grasdnl setting of CC.
725ef01931fSBen Grasm4_define([AC_PROG_CC],
726ef01931fSBen Gras          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
727ef01931fSBen Gras])
728ef01931fSBen Gras
729ef01931fSBen Gras# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
730ef01931fSBen Gras
731*835f6802SDirk Vogt# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
732ef01931fSBen Gras# Free Software Foundation, Inc.
733ef01931fSBen Gras#
734ef01931fSBen Gras# This file is free software; the Free Software Foundation
735ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
736ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
737ef01931fSBen Gras
738*835f6802SDirk Vogt# serial 6
739ef01931fSBen Gras
740ef01931fSBen Gras# AM_MISSING_PROG(NAME, PROGRAM)
741ef01931fSBen Gras# ------------------------------
742ef01931fSBen GrasAC_DEFUN([AM_MISSING_PROG],
743ef01931fSBen Gras[AC_REQUIRE([AM_MISSING_HAS_RUN])
744ef01931fSBen Gras$1=${$1-"${am_missing_run}$2"}
745ef01931fSBen GrasAC_SUBST($1)])
746ef01931fSBen Gras
747ef01931fSBen Gras
748ef01931fSBen Gras# AM_MISSING_HAS_RUN
749ef01931fSBen Gras# ------------------
750ef01931fSBen Gras# Define MISSING if not defined so far and test if it supports --run.
751ef01931fSBen Gras# If it does, set am_missing_run to use it, otherwise, to nothing.
752ef01931fSBen GrasAC_DEFUN([AM_MISSING_HAS_RUN],
753ef01931fSBen Gras[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
754ef01931fSBen GrasAC_REQUIRE_AUX_FILE([missing])dnl
755*835f6802SDirk Vogtif test x"${MISSING+set}" != xset; then
756*835f6802SDirk Vogt  case $am_aux_dir in
757*835f6802SDirk Vogt  *\ * | *\	*)
758*835f6802SDirk Vogt    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
759*835f6802SDirk Vogt  *)
760*835f6802SDirk Vogt    MISSING="\${SHELL} $am_aux_dir/missing" ;;
761*835f6802SDirk Vogt  esac
762*835f6802SDirk Vogtfi
763ef01931fSBen Gras# Use eval to expand $SHELL
764ef01931fSBen Grasif eval "$MISSING --run true"; then
765ef01931fSBen Gras  am_missing_run="$MISSING --run "
766ef01931fSBen Graselse
767ef01931fSBen Gras  am_missing_run=
768ef01931fSBen Gras  AC_MSG_WARN([`missing' script is too old or missing])
769ef01931fSBen Grasfi
770ef01931fSBen Gras])
771ef01931fSBen Gras
772ef01931fSBen Gras# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
773ef01931fSBen Gras#
774ef01931fSBen Gras# This file is free software; the Free Software Foundation
775ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
776ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
777ef01931fSBen Gras
778ef01931fSBen Gras# AM_PROG_MKDIR_P
779ef01931fSBen Gras# ---------------
780ef01931fSBen Gras# Check for `mkdir -p'.
781ef01931fSBen GrasAC_DEFUN([AM_PROG_MKDIR_P],
782ef01931fSBen Gras[AC_PREREQ([2.60])dnl
783ef01931fSBen GrasAC_REQUIRE([AC_PROG_MKDIR_P])dnl
784ef01931fSBen Grasdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
785ef01931fSBen Grasdnl while keeping a definition of mkdir_p for backward compatibility.
786ef01931fSBen Grasdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
787ef01931fSBen Grasdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
788ef01931fSBen Grasdnl Makefile.ins that do not define MKDIR_P, so we do our own
789ef01931fSBen Grasdnl adjustment using top_builddir (which is defined more often than
790ef01931fSBen Grasdnl MKDIR_P).
791ef01931fSBen GrasAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
792ef01931fSBen Grascase $mkdir_p in
793ef01931fSBen Gras  [[\\/$]]* | ?:[[\\/]]*) ;;
794ef01931fSBen Gras  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
795ef01931fSBen Grasesac
796ef01931fSBen Gras])
797ef01931fSBen Gras
798ef01931fSBen Gras# Helper functions for option handling.                     -*- Autoconf -*-
799ef01931fSBen Gras
800*835f6802SDirk Vogt# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
801ef01931fSBen Gras#
802ef01931fSBen Gras# This file is free software; the Free Software Foundation
803ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
804ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
805ef01931fSBen Gras
806*835f6802SDirk Vogt# serial 4
807ef01931fSBen Gras
808ef01931fSBen Gras# _AM_MANGLE_OPTION(NAME)
809ef01931fSBen Gras# -----------------------
810ef01931fSBen GrasAC_DEFUN([_AM_MANGLE_OPTION],
811ef01931fSBen Gras[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
812ef01931fSBen Gras
813ef01931fSBen Gras# _AM_SET_OPTION(NAME)
814ef01931fSBen Gras# ------------------------------
815ef01931fSBen Gras# Set option NAME.  Presently that only means defining a flag for this option.
816ef01931fSBen GrasAC_DEFUN([_AM_SET_OPTION],
817ef01931fSBen Gras[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
818ef01931fSBen Gras
819ef01931fSBen Gras# _AM_SET_OPTIONS(OPTIONS)
820ef01931fSBen Gras# ----------------------------------
821ef01931fSBen Gras# OPTIONS is a space-separated list of Automake options.
822ef01931fSBen GrasAC_DEFUN([_AM_SET_OPTIONS],
823*835f6802SDirk Vogt[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
824ef01931fSBen Gras
825ef01931fSBen Gras# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
826ef01931fSBen Gras# -------------------------------------------
827ef01931fSBen Gras# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
828ef01931fSBen GrasAC_DEFUN([_AM_IF_OPTION],
829ef01931fSBen Gras[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
830ef01931fSBen Gras
831ef01931fSBen Gras# Check to make sure that the build environment is sane.    -*- Autoconf -*-
832ef01931fSBen Gras
833*835f6802SDirk Vogt# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
834ef01931fSBen Gras# Free Software Foundation, Inc.
835ef01931fSBen Gras#
836ef01931fSBen Gras# This file is free software; the Free Software Foundation
837ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
838ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
839ef01931fSBen Gras
840*835f6802SDirk Vogt# serial 5
841ef01931fSBen Gras
842ef01931fSBen Gras# AM_SANITY_CHECK
843ef01931fSBen Gras# ---------------
844ef01931fSBen GrasAC_DEFUN([AM_SANITY_CHECK],
845ef01931fSBen Gras[AC_MSG_CHECKING([whether build environment is sane])
846ef01931fSBen Gras# Just in case
847ef01931fSBen Grassleep 1
848ef01931fSBen Grasecho timestamp > conftest.file
849*835f6802SDirk Vogt# Reject unsafe characters in $srcdir or the absolute working directory
850*835f6802SDirk Vogt# name.  Accept space and tab only in the latter.
851*835f6802SDirk Vogtam_lf='
852*835f6802SDirk Vogt'
853*835f6802SDirk Vogtcase `pwd` in
854*835f6802SDirk Vogt  *[[\\\"\#\$\&\'\`$am_lf]]*)
855*835f6802SDirk Vogt    AC_MSG_ERROR([unsafe absolute working directory name]);;
856*835f6802SDirk Vogtesac
857*835f6802SDirk Vogtcase $srcdir in
858*835f6802SDirk Vogt  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
859*835f6802SDirk Vogt    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
860*835f6802SDirk Vogtesac
861*835f6802SDirk Vogt
862ef01931fSBen Gras# Do `set' in a subshell so we don't clobber the current shell's
863ef01931fSBen Gras# arguments.  Must try -L first in case configure is actually a
864ef01931fSBen Gras# symlink; some systems play weird games with the mod time of symlinks
865ef01931fSBen Gras# (eg FreeBSD returns the mod time of the symlink's containing
866ef01931fSBen Gras# directory).
867ef01931fSBen Grasif (
868*835f6802SDirk Vogt   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
869ef01931fSBen Gras   if test "$[*]" = "X"; then
870ef01931fSBen Gras      # -L didn't work.
871*835f6802SDirk Vogt      set X `ls -t "$srcdir/configure" conftest.file`
872ef01931fSBen Gras   fi
873ef01931fSBen Gras   rm -f conftest.file
874ef01931fSBen Gras   if test "$[*]" != "X $srcdir/configure conftest.file" \
875ef01931fSBen Gras      && test "$[*]" != "X conftest.file $srcdir/configure"; then
876ef01931fSBen Gras
877ef01931fSBen Gras      # If neither matched, then we have a broken ls.  This can happen
878ef01931fSBen Gras      # if, for instance, CONFIG_SHELL is bash and it inherits a
879ef01931fSBen Gras      # broken ls alias from the environment.  This has actually
880ef01931fSBen Gras      # happened.  Such a system could not be considered "sane".
881ef01931fSBen Gras      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
882ef01931fSBen Grasalias in your environment])
883ef01931fSBen Gras   fi
884ef01931fSBen Gras
885ef01931fSBen Gras   test "$[2]" = conftest.file
886ef01931fSBen Gras   )
887ef01931fSBen Grasthen
888ef01931fSBen Gras   # Ok.
889ef01931fSBen Gras   :
890ef01931fSBen Graselse
891ef01931fSBen Gras   AC_MSG_ERROR([newly created file is older than distributed files!
892ef01931fSBen GrasCheck your system clock])
893ef01931fSBen Grasfi
894ef01931fSBen GrasAC_MSG_RESULT(yes)])
895ef01931fSBen Gras
896*835f6802SDirk Vogt# Copyright (C) 2009  Free Software Foundation, Inc.
897*835f6802SDirk Vogt#
898*835f6802SDirk Vogt# This file is free software; the Free Software Foundation
899*835f6802SDirk Vogt# gives unlimited permission to copy and/or distribute it,
900*835f6802SDirk Vogt# with or without modifications, as long as this notice is preserved.
901*835f6802SDirk Vogt
902*835f6802SDirk Vogt# serial 1
903*835f6802SDirk Vogt
904*835f6802SDirk Vogt# AM_SILENT_RULES([DEFAULT])
905*835f6802SDirk Vogt# --------------------------
906*835f6802SDirk Vogt# Enable less verbose build rules; with the default set to DEFAULT
907*835f6802SDirk Vogt# (`yes' being less verbose, `no' or empty being verbose).
908*835f6802SDirk VogtAC_DEFUN([AM_SILENT_RULES],
909*835f6802SDirk Vogt[AC_ARG_ENABLE([silent-rules],
910*835f6802SDirk Vogt[  --enable-silent-rules          less verbose build output (undo: `make V=1')
911*835f6802SDirk Vogt  --disable-silent-rules         verbose build output (undo: `make V=0')])
912*835f6802SDirk Vogtcase $enable_silent_rules in
913*835f6802SDirk Vogtyes) AM_DEFAULT_VERBOSITY=0;;
914*835f6802SDirk Vogtno)  AM_DEFAULT_VERBOSITY=1;;
915*835f6802SDirk Vogt*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
916*835f6802SDirk Vogtesac
917*835f6802SDirk VogtAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
918*835f6802SDirk VogtAM_BACKSLASH='\'
919*835f6802SDirk VogtAC_SUBST([AM_BACKSLASH])dnl
920*835f6802SDirk Vogt_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
921*835f6802SDirk Vogt])
922*835f6802SDirk Vogt
923ef01931fSBen Gras# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
924ef01931fSBen Gras#
925ef01931fSBen Gras# This file is free software; the Free Software Foundation
926ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
927ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
928ef01931fSBen Gras
929ef01931fSBen Gras# AM_PROG_INSTALL_STRIP
930ef01931fSBen Gras# ---------------------
931ef01931fSBen Gras# One issue with vendor `install' (even GNU) is that you can't
932ef01931fSBen Gras# specify the program used to strip binaries.  This is especially
933ef01931fSBen Gras# annoying in cross-compiling environments, where the build's strip
934ef01931fSBen Gras# is unlikely to handle the host's binaries.
935ef01931fSBen Gras# Fortunately install-sh will honor a STRIPPROG variable, so we
936ef01931fSBen Gras# always use install-sh in `make install-strip', and initialize
937ef01931fSBen Gras# STRIPPROG with the value of the STRIP variable (set by the user).
938ef01931fSBen GrasAC_DEFUN([AM_PROG_INSTALL_STRIP],
939ef01931fSBen Gras[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
940ef01931fSBen Gras# Installed binaries are usually stripped using `strip' when the user
941ef01931fSBen Gras# run `make install-strip'.  However `strip' might not be the right
942ef01931fSBen Gras# tool to use in cross-compilation environments, therefore Automake
943ef01931fSBen Gras# will honor the `STRIP' environment variable to overrule this program.
944ef01931fSBen Grasdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
945ef01931fSBen Grasif test "$cross_compiling" != no; then
946ef01931fSBen Gras  AC_CHECK_TOOL([STRIP], [strip], :)
947ef01931fSBen Grasfi
948ef01931fSBen GrasINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
949ef01931fSBen GrasAC_SUBST([INSTALL_STRIP_PROGRAM])])
950ef01931fSBen Gras
951*835f6802SDirk Vogt# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
952ef01931fSBen Gras#
953ef01931fSBen Gras# This file is free software; the Free Software Foundation
954ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
955ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
956ef01931fSBen Gras
957*835f6802SDirk Vogt# serial 2
958*835f6802SDirk Vogt
959ef01931fSBen Gras# _AM_SUBST_NOTMAKE(VARIABLE)
960ef01931fSBen Gras# ---------------------------
961*835f6802SDirk Vogt# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
962ef01931fSBen Gras# This macro is traced by Automake.
963ef01931fSBen GrasAC_DEFUN([_AM_SUBST_NOTMAKE])
964ef01931fSBen Gras
965*835f6802SDirk Vogt# AM_SUBST_NOTMAKE(VARIABLE)
966*835f6802SDirk Vogt# ---------------------------
967*835f6802SDirk Vogt# Public sister of _AM_SUBST_NOTMAKE.
968*835f6802SDirk VogtAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
969*835f6802SDirk Vogt
970ef01931fSBen Gras# Check how to create a tarball.                            -*- Autoconf -*-
971ef01931fSBen Gras
972ef01931fSBen Gras# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
973ef01931fSBen Gras#
974ef01931fSBen Gras# This file is free software; the Free Software Foundation
975ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
976ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
977ef01931fSBen Gras
978ef01931fSBen Gras# serial 2
979ef01931fSBen Gras
980ef01931fSBen Gras# _AM_PROG_TAR(FORMAT)
981ef01931fSBen Gras# --------------------
982ef01931fSBen Gras# Check how to create a tarball in format FORMAT.
983ef01931fSBen Gras# FORMAT should be one of `v7', `ustar', or `pax'.
984ef01931fSBen Gras#
985ef01931fSBen Gras# Substitute a variable $(am__tar) that is a command
986ef01931fSBen Gras# writing to stdout a FORMAT-tarball containing the directory
987ef01931fSBen Gras# $tardir.
988ef01931fSBen Gras#     tardir=directory && $(am__tar) > result.tar
989ef01931fSBen Gras#
990ef01931fSBen Gras# Substitute a variable $(am__untar) that extract such
991ef01931fSBen Gras# a tarball read from stdin.
992ef01931fSBen Gras#     $(am__untar) < result.tar
993ef01931fSBen GrasAC_DEFUN([_AM_PROG_TAR],
994ef01931fSBen Gras[# Always define AMTAR for backward compatibility.
995ef01931fSBen GrasAM_MISSING_PROG([AMTAR], [tar])
996ef01931fSBen Grasm4_if([$1], [v7],
997ef01931fSBen Gras     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
998ef01931fSBen Gras     [m4_case([$1], [ustar],, [pax],,
999ef01931fSBen Gras              [m4_fatal([Unknown tar format])])
1000ef01931fSBen GrasAC_MSG_CHECKING([how to create a $1 tar archive])
1001ef01931fSBen Gras# Loop over all known methods to create a tar archive until one works.
1002ef01931fSBen Gras_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1003ef01931fSBen Gras_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1004ef01931fSBen Gras# Do not fold the above two line into one, because Tru64 sh and
1005ef01931fSBen Gras# Solaris sh will not grok spaces in the rhs of `-'.
1006ef01931fSBen Grasfor _am_tool in $_am_tools
1007ef01931fSBen Grasdo
1008ef01931fSBen Gras  case $_am_tool in
1009ef01931fSBen Gras  gnutar)
1010ef01931fSBen Gras    for _am_tar in tar gnutar gtar;
1011ef01931fSBen Gras    do
1012ef01931fSBen Gras      AM_RUN_LOG([$_am_tar --version]) && break
1013ef01931fSBen Gras    done
1014ef01931fSBen Gras    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1015ef01931fSBen Gras    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1016ef01931fSBen Gras    am__untar="$_am_tar -xf -"
1017ef01931fSBen Gras    ;;
1018ef01931fSBen Gras  plaintar)
1019ef01931fSBen Gras    # Must skip GNU tar: if it does not support --format= it doesn't create
1020ef01931fSBen Gras    # ustar tarball either.
1021ef01931fSBen Gras    (tar --version) >/dev/null 2>&1 && continue
1022ef01931fSBen Gras    am__tar='tar chf - "$$tardir"'
1023ef01931fSBen Gras    am__tar_='tar chf - "$tardir"'
1024ef01931fSBen Gras    am__untar='tar xf -'
1025ef01931fSBen Gras    ;;
1026ef01931fSBen Gras  pax)
1027ef01931fSBen Gras    am__tar='pax -L -x $1 -w "$$tardir"'
1028ef01931fSBen Gras    am__tar_='pax -L -x $1 -w "$tardir"'
1029ef01931fSBen Gras    am__untar='pax -r'
1030ef01931fSBen Gras    ;;
1031ef01931fSBen Gras  cpio)
1032ef01931fSBen Gras    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1033ef01931fSBen Gras    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1034ef01931fSBen Gras    am__untar='cpio -i -H $1 -d'
1035ef01931fSBen Gras    ;;
1036ef01931fSBen Gras  none)
1037ef01931fSBen Gras    am__tar=false
1038ef01931fSBen Gras    am__tar_=false
1039ef01931fSBen Gras    am__untar=false
1040ef01931fSBen Gras    ;;
1041ef01931fSBen Gras  esac
1042ef01931fSBen Gras
1043ef01931fSBen Gras  # If the value was cached, stop now.  We just wanted to have am__tar
1044ef01931fSBen Gras  # and am__untar set.
1045ef01931fSBen Gras  test -n "${am_cv_prog_tar_$1}" && break
1046ef01931fSBen Gras
1047ef01931fSBen Gras  # tar/untar a dummy directory, and stop if the command works
1048ef01931fSBen Gras  rm -rf conftest.dir
1049ef01931fSBen Gras  mkdir conftest.dir
1050ef01931fSBen Gras  echo GrepMe > conftest.dir/file
1051ef01931fSBen Gras  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1052ef01931fSBen Gras  rm -rf conftest.dir
1053ef01931fSBen Gras  if test -s conftest.tar; then
1054ef01931fSBen Gras    AM_RUN_LOG([$am__untar <conftest.tar])
1055ef01931fSBen Gras    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1056ef01931fSBen Gras  fi
1057ef01931fSBen Grasdone
1058ef01931fSBen Grasrm -rf conftest.dir
1059ef01931fSBen Gras
1060ef01931fSBen GrasAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1061ef01931fSBen GrasAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1062ef01931fSBen GrasAC_SUBST([am__tar])
1063ef01931fSBen GrasAC_SUBST([am__untar])
1064ef01931fSBen Gras]) # _AM_PROG_TAR
1065ef01931fSBen Gras
1066*835f6802SDirk Vogtm4_include([m4/libtool.m4])
1067*835f6802SDirk Vogtm4_include([m4/ltoptions.m4])
1068*835f6802SDirk Vogtm4_include([m4/ltsugar.m4])
1069*835f6802SDirk Vogtm4_include([m4/ltversion.m4])
1070*835f6802SDirk Vogtm4_include([m4/lt~obsolete.m4])
1071ef01931fSBen Grasm4_include([acinclude.m4])
1072