1# generated automatically by aclocal 1.12.2 -*- Autoconf -*-
2
3# Copyright (C) 1996-2012 Free Software Foundation, Inc.
4
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14m4_ifndef([AC_AUTOCONF_VERSION],
15  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
17[m4_warning([this file was generated for autoconf 2.69.
18You have another version of autoconf.  It may work, but is not guaranteed to.
19If you have problems, you may need to regenerate the build system entirely.
20To do so, use the procedure documented by the package, typically 'autoreconf'.])])
21
22# Copyright (C) 2002-2012 Free Software Foundation, Inc.
23#
24# This file is free software; the Free Software Foundation
25# gives unlimited permission to copy and/or distribute it,
26# with or without modifications, as long as this notice is preserved.
27
28# serial 8
29
30# AM_AUTOMAKE_VERSION(VERSION)
31# ----------------------------
32# Automake X.Y traces this macro to ensure aclocal.m4 has been
33# generated from the m4 files accompanying Automake X.Y.
34# (This private macro should not be called outside this file.)
35AC_DEFUN([AM_AUTOMAKE_VERSION],
36[am__api_version='1.12'
37dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
38dnl require some minimum version.  Point them to the right macro.
39m4_if([$1], [1.12.2], [],
40      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
41])
42
43# _AM_AUTOCONF_VERSION(VERSION)
44# -----------------------------
45# aclocal traces this macro to find the Autoconf version.
46# This is a private macro too.  Using m4_define simplifies
47# the logic in aclocal, which can simply ignore this definition.
48m4_define([_AM_AUTOCONF_VERSION], [])
49
50# AM_SET_CURRENT_AUTOMAKE_VERSION
51# -------------------------------
52# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
53# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
54AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
55[AM_AUTOMAKE_VERSION([1.12.2])dnl
56m4_ifndef([AC_AUTOCONF_VERSION],
57  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
58_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
59
60# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
61
62# Copyright (C) 2001-2012 Free Software Foundation, Inc.
63#
64# This file is free software; the Free Software Foundation
65# gives unlimited permission to copy and/or distribute it,
66# with or without modifications, as long as this notice is preserved.
67
68# serial 2
69
70# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
71# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
72# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
73#
74# Of course, Automake must honor this variable whenever it calls a
75# tool from the auxiliary directory.  The problem is that $srcdir (and
76# therefore $ac_aux_dir as well) can be either absolute or relative,
77# depending on how configure is run.  This is pretty annoying, since
78# it makes $ac_aux_dir quite unusable in subdirectories: in the top
79# source directory, any form will work fine, but in subdirectories a
80# relative path needs to be adjusted first.
81#
82# $ac_aux_dir/missing
83#    fails when called from a subdirectory if $ac_aux_dir is relative
84# $top_srcdir/$ac_aux_dir/missing
85#    fails if $ac_aux_dir is absolute,
86#    fails when called from a subdirectory in a VPATH build with
87#          a relative $ac_aux_dir
88#
89# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
90# are both prefixed by $srcdir.  In an in-source build this is usually
91# harmless because $srcdir is '.', but things will broke when you
92# start a VPATH build or use an absolute $srcdir.
93#
94# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
95# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
96#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
97# and then we would define $MISSING as
98#   MISSING="\${SHELL} $am_aux_dir/missing"
99# This will work as long as MISSING is not called from configure, because
100# unfortunately $(top_srcdir) has no meaning in configure.
101# However there are other variables, like CC, which are often used in
102# configure, and could therefore not use this "fixed" $ac_aux_dir.
103#
104# Another solution, used here, is to always expand $ac_aux_dir to an
105# absolute PATH.  The drawback is that using absolute paths prevent a
106# configured tree to be moved without reconfiguration.
107
108AC_DEFUN([AM_AUX_DIR_EXPAND],
109[dnl Rely on autoconf to set up CDPATH properly.
110AC_PREREQ([2.50])dnl
111# expand $ac_aux_dir to an absolute path
112am_aux_dir=`cd $ac_aux_dir && pwd`
113])
114
115# Do all the work for Automake.                             -*- Autoconf -*-
116
117# Copyright (C) 1996-2012 Free Software Foundation, Inc.
118#
119# This file is free software; the Free Software Foundation
120# gives unlimited permission to copy and/or distribute it,
121# with or without modifications, as long as this notice is preserved.
122
123# serial 19
124
125# This macro actually does too much.  Some checks are only needed if
126# your package does certain things.  But this isn't really a big deal.
127
128# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
129# AM_INIT_AUTOMAKE([OPTIONS])
130# -----------------------------------------------
131# The call with PACKAGE and VERSION arguments is the old style
132# call (pre autoconf-2.50), which is being phased out.  PACKAGE
133# and VERSION should now be passed to AC_INIT and removed from
134# the call to AM_INIT_AUTOMAKE.
135# We support both call styles for the transition.  After
136# the next Automake release, Autoconf can make the AC_INIT
137# arguments mandatory, and then we can depend on a new Autoconf
138# release and drop the old call support.
139AC_DEFUN([AM_INIT_AUTOMAKE],
140[AC_PREREQ([2.62])dnl
141dnl Autoconf wants to disallow AM_ names.  We explicitly allow
142dnl the ones we care about.
143m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
144AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
145AC_REQUIRE([AC_PROG_INSTALL])dnl
146if test "`cd $srcdir && pwd`" != "`pwd`"; then
147  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
148  # is not polluted with repeated "-I."
149  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
150  # test to see if srcdir already configured
151  if test -f $srcdir/config.status; then
152    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
153  fi
154fi
155
156# test whether we have cygpath
157if test -z "$CYGPATH_W"; then
158  if (cygpath --version) >/dev/null 2>/dev/null; then
159    CYGPATH_W='cygpath -w'
160  else
161    CYGPATH_W=echo
162  fi
163fi
164AC_SUBST([CYGPATH_W])
165
166# Define the identity of the package.
167dnl Distinguish between old-style and new-style calls.
168m4_ifval([$2],
169[AC_DIAGNOSE([obsolete],
170[$0: two- and three-arguments forms are deprecated.  For more info, see:
171http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
172m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
173 AC_SUBST([PACKAGE], [$1])dnl
174 AC_SUBST([VERSION], [$2])],
175[_AM_SET_OPTIONS([$1])dnl
176dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
177m4_if(
178  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
179  [ok:ok],,
180  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
181 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
182 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
183
184_AM_IF_OPTION([no-define],,
185[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
186 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
187
188# Some tools Automake needs.
189AC_REQUIRE([AM_SANITY_CHECK])dnl
190AC_REQUIRE([AC_ARG_PROGRAM])dnl
191AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
192AM_MISSING_PROG([AUTOCONF], [autoconf])
193AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
194AM_MISSING_PROG([AUTOHEADER], [autoheader])
195AM_MISSING_PROG([MAKEINFO], [makeinfo])
196AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
197AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
198AC_REQUIRE([AC_PROG_MKDIR_P])dnl
199# For better backward compatibility.  To be removed once Automake 1.9.x
200# dies out for good.  For more background, see:
201# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
202# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
203AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
204# We need awk for the "check" target.  The system "awk" is bad on
205# some platforms.
206AC_REQUIRE([AC_PROG_AWK])dnl
207AC_REQUIRE([AC_PROG_MAKE_SET])dnl
208AC_REQUIRE([AM_SET_LEADING_DOT])dnl
209_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
210	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
211			     [_AM_PROG_TAR([v7])])])
212_AM_IF_OPTION([no-dependencies],,
213[AC_PROVIDE_IFELSE([AC_PROG_CC],
214		  [_AM_DEPENDENCIES([CC])],
215		  [m4_define([AC_PROG_CC],
216			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
217AC_PROVIDE_IFELSE([AC_PROG_CXX],
218		  [_AM_DEPENDENCIES([CXX])],
219		  [m4_define([AC_PROG_CXX],
220			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
221AC_PROVIDE_IFELSE([AC_PROG_OBJC],
222		  [_AM_DEPENDENCIES([OBJC])],
223		  [m4_define([AC_PROG_OBJC],
224			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
225dnl Support for Objective C++ was only introduced in Autoconf 2.65,
226dnl but we still cater to Autoconf 2.62.
227m4_ifdef([AC_PROG_OBJCXX],
228[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
229		  [_AM_DEPENDENCIES([OBJCXX])],
230		  [m4_define([AC_PROG_OBJCXX],
231			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
232])
233_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
234dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
235dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
236dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
237AC_CONFIG_COMMANDS_PRE(dnl
238[m4_provide_if([_AM_COMPILER_EXEEXT],
239  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
240])
241
242dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
243dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
244dnl mangled by Autoconf and run in a shell conditional statement.
245m4_define([_AC_COMPILER_EXEEXT],
246m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
247
248
249# When config.status generates a header, we must update the stamp-h file.
250# This file resides in the same directory as the config header
251# that is generated.  The stamp files are numbered to have different names.
252
253# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
254# loop where config.status creates the headers, so we can generate
255# our stamp files there.
256AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
257[# Compute $1's index in $config_headers.
258_am_arg=$1
259_am_stamp_count=1
260for _am_header in $config_headers :; do
261  case $_am_header in
262    $_am_arg | $_am_arg:* )
263      break ;;
264    * )
265      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
266  esac
267done
268echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
269
270# Copyright (C) 2001-2012 Free Software Foundation, Inc.
271#
272# This file is free software; the Free Software Foundation
273# gives unlimited permission to copy and/or distribute it,
274# with or without modifications, as long as this notice is preserved.
275
276# serial 8
277
278# AM_PROG_INSTALL_SH
279# ------------------
280# Define $install_sh.
281AC_DEFUN([AM_PROG_INSTALL_SH],
282[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
283if test x"${install_sh}" != xset; then
284  case $am_aux_dir in
285  *\ * | *\	*)
286    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
287  *)
288    install_sh="\${SHELL} $am_aux_dir/install-sh"
289  esac
290fi
291AC_SUBST([install_sh])])
292
293# Copyright (C) 2003-2012 Free Software Foundation, Inc.
294#
295# This file is free software; the Free Software Foundation
296# gives unlimited permission to copy and/or distribute it,
297# with or without modifications, as long as this notice is preserved.
298
299# serial 2
300
301# Check whether the underlying file-system supports filenames
302# with a leading dot.  For instance MS-DOS doesn't.
303AC_DEFUN([AM_SET_LEADING_DOT],
304[rm -rf .tst 2>/dev/null
305mkdir .tst 2>/dev/null
306if test -d .tst; then
307  am__leading_dot=.
308else
309  am__leading_dot=_
310fi
311rmdir .tst 2>/dev/null
312AC_SUBST([am__leading_dot])])
313
314# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
315
316# Copyright (C) 1997-2012 Free Software Foundation, Inc.
317#
318# This file is free software; the Free Software Foundation
319# gives unlimited permission to copy and/or distribute it,
320# with or without modifications, as long as this notice is preserved.
321
322# serial 7
323
324# AM_MISSING_PROG(NAME, PROGRAM)
325# ------------------------------
326AC_DEFUN([AM_MISSING_PROG],
327[AC_REQUIRE([AM_MISSING_HAS_RUN])
328$1=${$1-"${am_missing_run}$2"}
329AC_SUBST($1)])
330
331
332# AM_MISSING_HAS_RUN
333# ------------------
334# Define MISSING if not defined so far and test if it supports --run.
335# If it does, set am_missing_run to use it, otherwise, to nothing.
336AC_DEFUN([AM_MISSING_HAS_RUN],
337[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
338AC_REQUIRE_AUX_FILE([missing])dnl
339if test x"${MISSING+set}" != xset; then
340  case $am_aux_dir in
341  *\ * | *\	*)
342    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
343  *)
344    MISSING="\${SHELL} $am_aux_dir/missing" ;;
345  esac
346fi
347# Use eval to expand $SHELL
348if eval "$MISSING --run true"; then
349  am_missing_run="$MISSING --run "
350else
351  am_missing_run=
352  AC_MSG_WARN(['missing' script is too old or missing])
353fi
354])
355
356# Helper functions for option handling.                     -*- Autoconf -*-
357
358# Copyright (C) 2001-2012 Free Software Foundation, Inc.
359#
360# This file is free software; the Free Software Foundation
361# gives unlimited permission to copy and/or distribute it,
362# with or without modifications, as long as this notice is preserved.
363
364# serial 6
365
366# _AM_MANGLE_OPTION(NAME)
367# -----------------------
368AC_DEFUN([_AM_MANGLE_OPTION],
369[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
370
371# _AM_SET_OPTION(NAME)
372# --------------------
373# Set option NAME.  Presently that only means defining a flag for this option.
374AC_DEFUN([_AM_SET_OPTION],
375[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
376
377# _AM_SET_OPTIONS(OPTIONS)
378# ------------------------
379# OPTIONS is a space-separated list of Automake options.
380AC_DEFUN([_AM_SET_OPTIONS],
381[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
382
383# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
384# -------------------------------------------
385# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
386AC_DEFUN([_AM_IF_OPTION],
387[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
388
389# Check to make sure that the build environment is sane.    -*- Autoconf -*-
390
391# Copyright (C) 1996-2012 Free Software Foundation, Inc.
392#
393# This file is free software; the Free Software Foundation
394# gives unlimited permission to copy and/or distribute it,
395# with or without modifications, as long as this notice is preserved.
396
397# serial 9
398
399# AM_SANITY_CHECK
400# ---------------
401AC_DEFUN([AM_SANITY_CHECK],
402[AC_MSG_CHECKING([whether build environment is sane])
403# Reject unsafe characters in $srcdir or the absolute working directory
404# name.  Accept space and tab only in the latter.
405am_lf='
406'
407case `pwd` in
408  *[[\\\"\#\$\&\'\`$am_lf]]*)
409    AC_MSG_ERROR([unsafe absolute working directory name]);;
410esac
411case $srcdir in
412  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
413    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
414esac
415
416# Do 'set' in a subshell so we don't clobber the current shell's
417# arguments.  Must try -L first in case configure is actually a
418# symlink; some systems play weird games with the mod time of symlinks
419# (eg FreeBSD returns the mod time of the symlink's containing
420# directory).
421if (
422   am_has_slept=no
423   for am_try in 1 2; do
424     echo "timestamp, slept: $am_has_slept" > conftest.file
425     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
426     if test "$[*]" = "X"; then
427	# -L didn't work.
428	set X `ls -t "$srcdir/configure" conftest.file`
429     fi
430     if test "$[*]" != "X $srcdir/configure conftest.file" \
431	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
432
433	# If neither matched, then we have a broken ls.  This can happen
434	# if, for instance, CONFIG_SHELL is bash and it inherits a
435	# broken ls alias from the environment.  This has actually
436	# happened.  Such a system could not be considered "sane".
437	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
438  alias in your environment])
439     fi
440     if test "$[2]" = conftest.file || test $am_try -eq 2; then
441       break
442     fi
443     # Just in case.
444     sleep 1
445     am_has_slept=yes
446   done
447   test "$[2]" = conftest.file
448   )
449then
450   # Ok.
451   :
452else
453   AC_MSG_ERROR([newly created file is older than distributed files!
454Check your system clock])
455fi
456AC_MSG_RESULT([yes])
457# If we didn't sleep, we still need to ensure time stamps of config.status and
458# generated files are strictly newer.
459am_sleep_pid=
460if grep 'slept: no' conftest.file >/dev/null 2>&1; then
461  ( sleep 1 ) &
462  am_sleep_pid=$!
463fi
464AC_CONFIG_COMMANDS_PRE(
465  [AC_MSG_CHECKING([that generated files are newer than configure])
466   if test -n "$am_sleep_pid"; then
467     # Hide warnings about reused PIDs.
468     wait $am_sleep_pid 2>/dev/null
469   fi
470   AC_MSG_RESULT([done])])
471rm -f conftest.file
472])
473
474# Copyright (C) 2001-2012 Free Software Foundation, Inc.
475#
476# This file is free software; the Free Software Foundation
477# gives unlimited permission to copy and/or distribute it,
478# with or without modifications, as long as this notice is preserved.
479
480# serial 2
481
482# AM_PROG_INSTALL_STRIP
483# ---------------------
484# One issue with vendor 'install' (even GNU) is that you can't
485# specify the program used to strip binaries.  This is especially
486# annoying in cross-compiling environments, where the build's strip
487# is unlikely to handle the host's binaries.
488# Fortunately install-sh will honor a STRIPPROG variable, so we
489# always use install-sh in "make install-strip", and initialize
490# STRIPPROG with the value of the STRIP variable (set by the user).
491AC_DEFUN([AM_PROG_INSTALL_STRIP],
492[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
493# Installed binaries are usually stripped using 'strip' when the user
494# run "make install-strip".  However 'strip' might not be the right
495# tool to use in cross-compilation environments, therefore Automake
496# will honor the 'STRIP' environment variable to overrule this program.
497dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
498if test "$cross_compiling" != no; then
499  AC_CHECK_TOOL([STRIP], [strip], :)
500fi
501INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
502AC_SUBST([INSTALL_STRIP_PROGRAM])])
503
504# Copyright (C) 2006-2012 Free Software Foundation, Inc.
505#
506# This file is free software; the Free Software Foundation
507# gives unlimited permission to copy and/or distribute it,
508# with or without modifications, as long as this notice is preserved.
509
510# serial 3
511
512# _AM_SUBST_NOTMAKE(VARIABLE)
513# ---------------------------
514# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
515# This macro is traced by Automake.
516AC_DEFUN([_AM_SUBST_NOTMAKE])
517
518# AM_SUBST_NOTMAKE(VARIABLE)
519# --------------------------
520# Public sister of _AM_SUBST_NOTMAKE.
521AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
522
523# Check how to create a tarball.                            -*- Autoconf -*-
524
525# Copyright (C) 2004-2012 Free Software Foundation, Inc.
526#
527# This file is free software; the Free Software Foundation
528# gives unlimited permission to copy and/or distribute it,
529# with or without modifications, as long as this notice is preserved.
530
531# serial 3
532
533# _AM_PROG_TAR(FORMAT)
534# --------------------
535# Check how to create a tarball in format FORMAT.
536# FORMAT should be one of 'v7', 'ustar', or 'pax'.
537#
538# Substitute a variable $(am__tar) that is a command
539# writing to stdout a FORMAT-tarball containing the directory
540# $tardir.
541#     tardir=directory && $(am__tar) > result.tar
542#
543# Substitute a variable $(am__untar) that extract such
544# a tarball read from stdin.
545#     $(am__untar) < result.tar
546AC_DEFUN([_AM_PROG_TAR],
547[# Always define AMTAR for backward compatibility.  Yes, it's still used
548# in the wild :-(  We should find a proper way to deprecate it ...
549AC_SUBST([AMTAR], ['$${TAR-tar}'])
550m4_if([$1], [v7],
551     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
552     [m4_case([$1], [ustar],, [pax],,
553              [m4_fatal([Unknown tar format])])
554AC_MSG_CHECKING([how to create a $1 tar archive])
555# Loop over all known methods to create a tar archive until one works.
556_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
557_am_tools=${am_cv_prog_tar_$1-$_am_tools}
558# Do not fold the above two line into one, because Tru64 sh and
559# Solaris sh will not grok spaces in the rhs of '-'.
560for _am_tool in $_am_tools
561do
562  case $_am_tool in
563  gnutar)
564    for _am_tar in tar gnutar gtar;
565    do
566      AM_RUN_LOG([$_am_tar --version]) && break
567    done
568    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
569    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
570    am__untar="$_am_tar -xf -"
571    ;;
572  plaintar)
573    # Must skip GNU tar: if it does not support --format= it doesn't create
574    # ustar tarball either.
575    (tar --version) >/dev/null 2>&1 && continue
576    am__tar='tar chf - "$$tardir"'
577    am__tar_='tar chf - "$tardir"'
578    am__untar='tar xf -'
579    ;;
580  pax)
581    am__tar='pax -L -x $1 -w "$$tardir"'
582    am__tar_='pax -L -x $1 -w "$tardir"'
583    am__untar='pax -r'
584    ;;
585  cpio)
586    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
587    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
588    am__untar='cpio -i -H $1 -d'
589    ;;
590  none)
591    am__tar=false
592    am__tar_=false
593    am__untar=false
594    ;;
595  esac
596
597  # If the value was cached, stop now.  We just wanted to have am__tar
598  # and am__untar set.
599  test -n "${am_cv_prog_tar_$1}" && break
600
601  # tar/untar a dummy directory, and stop if the command works
602  rm -rf conftest.dir
603  mkdir conftest.dir
604  echo GrepMe > conftest.dir/file
605  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
606  rm -rf conftest.dir
607  if test -s conftest.tar; then
608    AM_RUN_LOG([$am__untar <conftest.tar])
609    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
610  fi
611done
612rm -rf conftest.dir
613
614AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
615AC_MSG_RESULT([$am_cv_prog_tar_$1])])
616AC_SUBST([am__tar])
617AC_SUBST([am__untar])
618]) # _AM_PROG_TAR
619
620