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