]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
For PR automake/414:
authorAlexandre Duret-Lutz <adl@gnu.org>
Mon, 19 Apr 2004 23:20:08 +0000 (23:20 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Mon, 19 Apr 2004 23:20:08 +0000 (23:20 +0000)
Introduce options tar-v7, tar-ustar, and tar-pax to select
tar format.
* doc/automake.texi (Options): Document them.
* lib/Automake/Options.pm (_process_option_list): Process
these new options.
* lib/am/distdir.am (dist-gzip, dist-bzip2, dist-tarZ, dist,
distcheck): Adjust to use am__tar and am__untar.
* m4/tar.m4: New file.
* m4/Makefile.am (dist_m4data_DATA): Add tar.m4.
* m4/init.m4 (AM_INIT_AUTOMAKE): Support the new options
and call _AM_PROG_TAR.
* tests/tar.test, tests/tar2.test, tests/tar3.test: New files.
* tests/Makefile.am (TESTS): Add them.

24 files changed:
ChangeLog
Makefile.in
NEWS
aclocal.m4
configure
doc/Makefile.in
doc/automake.texi
doc/stamp-vti
doc/version.texi
lib/Automake/Makefile.in
lib/Automake/Options.pm
lib/Automake/tests/Makefile.in
lib/Makefile.in
lib/am/Makefile.in
lib/am/distdir.am
m4/Makefile.am
m4/Makefile.in
m4/init.m4
m4/tar.m4 [new file with mode: 0644]
tests/Makefile.am
tests/Makefile.in
tests/tar.test [new file with mode: 0755]
tests/tar2.test [new file with mode: 0755]
tests/tar3.test [new file with mode: 0755]

index b9327e978846f47b3512d25c9cf8b481f301b45d..ec525bca76aefde98792fdbde392fd914e5ee567 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2004-04-20  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       For PR automake/414:
+       Introduce options tar-v7, tar-ustar, and tar-pax to select
+       tar format.
+       * doc/automake.texi (Options): Document them.
+       * lib/Automake/Options.pm (_process_option_list): Process
+       these new options.
+       * lib/am/distdir.am (dist-gzip, dist-bzip2, dist-tarZ, dist,
+       distcheck): Adjust to use am__tar and am__untar.
+       * m4/tar.m4: New file.
+       * m4/Makefile.am (dist_m4data_DATA): Add tar.m4.
+       * m4/init.m4 (AM_INIT_AUTOMAKE): Support the new options
+       and call _AM_PROG_TAR.
+       * tests/tar.test, tests/tar2.test, tests/tar3.test: New files.
+       * tests/Makefile.am (TESTS): Add them.
+
 2004-04-18  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * lib/am/distdir.am (distcheck): Typo in shar decompression.
index f1f5f7325fa065383b3622436d72d8207d819224..4e61c31d313fba28156bc233fcdb319249a35895 100644 (file)
@@ -45,7 +45,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
        $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -117,6 +117,8 @@ TEX = @TEX@
 VERSION = @VERSION@
 ac_ct_STRIP = @ac_ct_STRIP@
 am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -392,14 +394,14 @@ distdir: $(DISTFILES)
          ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
        || chmod -R a+r $(distdir)
 dist-gzip: distdir
-       $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
        $(am__remove_distdir)
 dist-bzip2: distdir
-       $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
+       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
        $(am__remove_distdir)
 
 dist-tarZ: distdir
-       $(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z
+       tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
        $(am__remove_distdir)
 
 dist-shar: distdir
@@ -412,8 +414,8 @@ dist-zip: distdir
        $(am__remove_distdir)
 
 dist dist-all: distdir
-       $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-       $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
        $(am__remove_distdir)
 
 # This target untars the dist file and tries a VPATH configuration.  Then
@@ -422,13 +424,13 @@ dist dist-all: distdir
 distcheck: dist
        case '$(DIST_ARCHIVES)' in \
        *.tar.gz*) \
-         GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - ;;\
+         GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
        *.tar.bz2*) \
-         bunzip2 -c $(distdir).tar.bz2 | $(AMTAR) xf - ;;\
+         bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
        *.tar.Z*) \
-         uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
        *.shar.gz*) \
-         GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | unshar ;;\
+         GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
        *.zip*) \
          unzip $(distdir).zip ;;\
        esac
diff --git a/NEWS b/NEWS
index 58da99272b96cf882d65b41475f46f8edcdb6646..6939fb73ecc334f35cb84cefe931c2ca69de760e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -44,6 +44,9 @@ New in 1.8a:
 
 * Diagnose AC_CONFIG_AUX_DIR calls following AM_INIT_AUTOMAKE. (PR/49)
 
+* Tar format can be chosen with the new options tar-v7, tar-ustar, and
+  tar-pax.
+
 \f
 New in 1.8:
 
index 8d9c152b7b63c3a9dc122290a8a8f09f625caffc..6387e06b886fafd7114d41a8b55e89e5bcabf706 100644 (file)
@@ -22,3 +22,4 @@ m4_include([m4/options.m4])
 m4_include([m4/runlog.m4])
 m4_include([m4/sanity.m4])
 m4_include([m4/strip.m4])
+m4_include([m4/tar.m4])
index ec0b2f85ffc9b23eb6973987c5d1ec1229ab2d29..e3c326f6ed7190160418d7f0fdb491ca468ad8d7 100755 (executable)
--- a/configure
+++ b/configure
@@ -497,7 +497,7 @@ PACKAGE_STRING='GNU Automake 1.8a'
 PACKAGE_BUGREPORT='bug-automake@gnu.org'
 
 ac_unique_file="automake.in"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot APIVERSION pkgvdatadir PERL TEX LN MODIFICATION_DELAY GREP EGREP FGREP LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar APIVERSION pkgvdatadir PERL TEX LN MODIFICATION_DELAY GREP EGREP FGREP LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -1832,9 +1832,6 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
 install_sh=${install_sh-"$am_aux_dir/install-sh"}
 
 # Installed binaries are usually stripped using `strip' when the user
@@ -1938,6 +1935,13 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
 
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
 
 
 
@@ -3129,7 +3133,6 @@ s,@AUTOCONF@,$AUTOCONF,;t t
 s,@AUTOMAKE@,$AUTOMAKE,;t t
 s,@AUTOHEADER@,$AUTOHEADER,;t t
 s,@MAKEINFO@,$MAKEINFO,;t t
-s,@AMTAR@,$AMTAR,;t t
 s,@install_sh@,$install_sh,;t t
 s,@STRIP@,$STRIP,;t t
 s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
@@ -3138,6 +3141,9 @@ s,@mkdir_p@,$mkdir_p,;t t
 s,@AWK@,$AWK,;t t
 s,@SET_MAKE@,$SET_MAKE,;t t
 s,@am__leading_dot@,$am__leading_dot,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@am__tar@,$am__tar,;t t
+s,@am__untar@,$am__untar,;t t
 s,@APIVERSION@,$APIVERSION,;t t
 s,@pkgvdatadir@,$pkgvdatadir,;t t
 s,@PERL@,$PERL,;t t
index 8883e86d3b7b5f120abe3922d1c09bc908dfeebc..d29cb3f6818c6a30cd8eaaf62edbf0742bf74eb0 100644 (file)
@@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
        $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
@@ -108,6 +108,8 @@ TEX = @TEX@
 VERSION = @VERSION@
 ac_ct_STRIP = @ac_ct_STRIP@
 am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
index 254c391350cd86c9608714a761170a0614e18038..e40744fa1059dad53e85ac74009b4200bbfe07ce 100644 (file)
@@ -5916,6 +5916,46 @@ the source file.  For instance if the source file is
 @file{subdir/file.cxx}, then the output file would be
 @file{subdir/file.o}.
 
+@item @code{tar-v7}
+@itemx @code{tar-ustar}
+@itemx @code{tar-pax}
+These three mutually exclusive options select the tar format to use
+when generating tarballs with @code{make dist}.  (The tar file created
+is then compressed according to the set of @code{no-dist-gzip},
+@code{dist-bzip2} and @code{dist-tarZ} options in use.)
+
+These options must be passed as argument to @code{AM_INIT_AUTOMAKE}
+(@xref{Macros}) because they can causes new configure check to be
+performed.  Automake will complain if it sees such option in a
+@code{AUTOMAKE_OPTIONS} variable.
+
+@code{tar-v7} selects the old V7 tar format.  This is the historical
+default.  This antiquated format is understood by all tar
+implementations and supports filenames with up to 99 characters. When
+given longer filenames some tar implementations will diagnose the
+problem while other will generate broken tarballs or use non-portable
+extensions.  Furthermore, the V7 format cannot store empty
+directories.
+
+@code{tar-ustar} selects the ustar format defined by POSIX
+1003.1-1988.  This format is believed to be old enough to be portable.
+It fully supports directories, and stores filenames with up to 255
+characters.  However you may run against broken tar implementations
+that incorrectly handle filenames longer than 99 characters (please
+report them to @email{bug-automake@@gnu.org} so we can document this
+accurately).
+
+@code{tar-pax} selects the new pax interchange format defined by POSIX
+1003.1-2001.  It does not limit the length of filenames.  However,
+this format is very young and should probably be restricted to
+packages which target only very modern platforms.  There are moves to
+change the pax format in an upward-compatible way, so this option may
+refer to a more recent version in the future.
+
+@code{configure} knows several ways to construct these formats.  It
+will not abort if it cannot find a tool up to the task (so that the
+package can still be built), but @code{make dist} will fail.
+
 @item @var{version}
 @cindex Option, version
 A version number (e.g. @samp{0.30}) can be specified.  If Automake is not
index a69465602ba855c9876ae2254f60106d0de9ce8f..0d3a2687ba3d2204dbbd32a0126b34e6e1e78d3c 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 2 April 2004
+@set UPDATED 20 April 2004
 @set UPDATED-MONTH April 2004
 @set EDITION 1.8a
 @set VERSION 1.8a
index a69465602ba855c9876ae2254f60106d0de9ce8f..0d3a2687ba3d2204dbbd32a0126b34e6e1e78d3c 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 2 April 2004
+@set UPDATED 20 April 2004
 @set UPDATED-MONTH April 2004
 @set EDITION 1.8a
 @set VERSION 1.8a
index 4ad249a0f8b4f9ab6ba9d61b6a9660fa6b079356..4b9abe978f4adb617ffa18c8ac73c53461b20768 100644 (file)
@@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
        $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
@@ -111,6 +111,8 @@ TEX = @TEX@
 VERSION = @VERSION@
 ac_ct_STRIP = @ac_ct_STRIP@
 am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
index cb06672634ba4b0189f899786c33c10f37f73102..85fd3a25a7aeedeeb34255ebe632894452c5eec9 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004  Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -271,6 +271,22 @@ sub _process_option_list (\%$@)
        {
          # Explicitly recognize these.
        }
+      elsif ($_ eq 'tar-v7' || $_ eq 'tar-ustar' || $_ eq 'tar-pax')
+       {
+         error ($where,
+                "option `$_' must be an argument of AM_INIT_AUTOMAKE")
+           if $where->get !~ /^configure\./;
+         for my $opt ('tar-v7', 'tar-ustar', 'tar-pax')
+           {
+             next if $opt eq $_;
+             if (exists $options->{$opt})
+               {
+                 error ($where,
+                        "options `$_' and `$opt' are mutually exclusive");
+                 last;
+               }
+           }
+       }
       elsif (/^\d+\.\d+(?:\.\d+)?[a-z]?(?:-[A-Za-z0-9]+)?$/)
        {
          # Got a version number.
index d41b55b51c43675af0400c55634869b63790f50e..1c03540c93ea5819923324f24758e29e87bf03ea 100644 (file)
@@ -42,7 +42,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
        $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
@@ -90,6 +90,8 @@ TEX = @TEX@
 VERSION = @VERSION@
 ac_ct_STRIP = @ac_ct_STRIP@
 am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
index 38ed90e1369d72099696a6f34bf4c0308ea4b389..b11bd931af9e14306f878b86bc9073603cb0ffbb 100644 (file)
@@ -47,7 +47,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
        $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
@@ -114,6 +114,8 @@ TEX = @TEX@
 VERSION = @VERSION@
 ac_ct_STRIP = @ac_ct_STRIP@
 am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
index 6b2eb7856c3b1e77b520342e64beccf88d04507a..f694e45c2869eec3ca2cf2a7e0f48fb0703c008c 100644 (file)
@@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
        $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
@@ -101,6 +101,8 @@ TEX = @TEX@
 VERSION = @VERSION@
 ac_ct_STRIP = @ac_ct_STRIP@
 am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
index 0ed05935da20e916e69930c6cf3633a9ed77198c..8561c1857bda5e9c5daacd96efe5f6d1344d5749 100644 (file)
@@ -238,19 +238,19 @@ if %?TOPDIR_P%
 GZIP_ENV = --best
 .PHONY: dist-gzip
 dist-gzip: distdir
-       $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
        $(am__remove_distdir)
 
 ?BZIP2?DIST_ARCHIVES += $(distdir).tar.bz2
 .PHONY: dist-bzip2
 dist-bzip2: distdir
-       $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
+       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
        $(am__remove_distdir)
 
 ?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z
 .PHONY: dist-tarZ
 dist-tarZ: distdir
-       $(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z
+       tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
        $(am__remove_distdir)
 
 ?SHAR?DIST_ARCHIVES += $(distdir).shar.gz
@@ -281,9 +281,9 @@ if %?TOPDIR_P%
 
 .PHONY: dist dist-all
 dist dist-all: distdir
-?GZIP? $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-?BZIP2?        $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
-?COMPRESS?     $(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z
+?GZIP? tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+?BZIP2?        tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+?COMPRESS?     tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 ?SHAR? shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
 ?ZIP?  -rm -f $(distdir).zip
 ?ZIP?  zip -rq $(distdir).zip $(distdir)
@@ -305,11 +305,11 @@ if %?TOPDIR_P%
 distcheck: dist
        case '$(DIST_ARCHIVES)' in \
        *.tar.gz*) \
-         GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - ;;\
+         GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
        *.tar.bz2*) \
-         bunzip2 -c $(distdir).tar.bz2 | $(AMTAR) xf - ;;\
+         bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
        *.tar.Z*) \
-         uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
        *.shar.gz*) \
          GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
        *.zip*) \
index c4970cb9c6e21fb9f67a0e417960e46aab7488e0..105c6380e507695878f1d871b6738230d608dfe1 100644 (file)
@@ -53,7 +53,8 @@ python.m4 \
 regex.m4 \
 runlog.m4 \
 sanity.m4 \
-strip.m4
+strip.m4 \
+tar.m4
 
 EXTRA_DIST = dirlist amversion.in
 
index 0a3860633d66545cb3e7dc54201c41e4fd20aac7..a8166454f6719bd5c4b6319a62c4364739a6421b 100644 (file)
@@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
        $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
@@ -101,6 +101,8 @@ TEX = @TEX@
 VERSION = @VERSION@
 ac_ct_STRIP = @ac_ct_STRIP@
 am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -158,7 +160,8 @@ python.m4 \
 regex.m4 \
 runlog.m4 \
 sanity.m4 \
-strip.m4
+strip.m4 \
+tar.m4
 
 EXTRA_DIST = dirlist amversion.in
 all: all-am
index 3465dac8157539f2e8f69f1a538ac7c3228ba714..0c4973771630436c0e2e9815076f6002f99774e2 100644 (file)
@@ -3,7 +3,7 @@
 # This macro actually does too much some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
 # Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -79,7 +79,6 @@ AM_MISSING_PROG(AUTOCONF, autoconf)
 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
 AM_MISSING_PROG(AUTOHEADER, autoheader)
 AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_MISSING_PROG(AMTAR, tar)
 AM_PROG_INSTALL_SH
 AM_PROG_INSTALL_STRIP
 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
@@ -88,7 +87,9 @@ AC_REQUIRE([AM_PROG_MKDIR_P])dnl
 AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+                            [_AM_PROG_TAR([v7])])])
 _AM_IF_OPTION([no-dependencies],,
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
                   [_AM_DEPENDENCIES(CC)],
diff --git a/m4/tar.m4 b/m4/tar.m4
new file mode 100644 (file)
index 0000000..27020cf
--- /dev/null
+++ b/m4/tar.m4
@@ -0,0 +1,103 @@
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004  Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 1
+
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+for _am_tool in ${am_cv_prog_tar_$1-gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none}
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -H $1 -L -o'
+    am__tar_='find "$tardir" -print | cpio -H $1 -L -o'
+    am__untar='cpio -H $1 -i'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
index 817dff18f68ce15151fc1a1fcca94630fd2c2e4a..3a690d66991b6ca7d556e30575998a9c8b084e00 100644 (file)
@@ -484,6 +484,9 @@ symlink3.test \
 syntax.test \
 tags.test \
 tagsub.test \
+tar.test \
+tar2.test \
+tar3.test \
 target-cflags.test \
 targetclash.test \
 txinfo.test \
index 8583b2415230510cf49209b055a1961d5671e54c..94b08ac3188f63dedc6fc9addb1fb61c58ee6829 100644 (file)
@@ -43,7 +43,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
        $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
@@ -91,6 +91,8 @@ TEX = @TEX@
 VERSION = @VERSION@
 ac_ct_STRIP = @ac_ct_STRIP@
 am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -599,6 +601,9 @@ symlink3.test \
 syntax.test \
 tags.test \
 tagsub.test \
+tar.test \
+tar2.test \
+tar3.test \
 target-cflags.test \
 targetclash.test \
 txinfo.test \
diff --git a/tests/tar.test b/tests/tar.test
new file mode 100755 (executable)
index 0000000..16d54f4
--- /dev/null
@@ -0,0 +1,41 @@
+#! /bin/sh
+# Copyright (C) 2004  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check the tar-ustar option.
+
+. ./defs || exit 1
+
+set -e
+
+cat > configure.in << 'END'
+AC_INIT([tar], [1.0])
+AM_INIT_AUTOMAKE([tar-ustar])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+: > Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE distcheck
+test -f tar-1.0.tar.gz
diff --git a/tests/tar2.test b/tests/tar2.test
new file mode 100755 (executable)
index 0000000..9539c31
--- /dev/null
@@ -0,0 +1,41 @@
+#! /bin/sh
+# Copyright (C) 2004  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check the tar-pax option.
+
+. ./defs || exit 1
+
+set -e
+
+cat > configure.in << 'END'
+AC_INIT([tar2], [1.0])
+AM_INIT_AUTOMAKE([tar-pax])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+: > Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE distcheck
+test -f tar2-1.0.tar.gz
diff --git a/tests/tar3.test b/tests/tar3.test
new file mode 100755 (executable)
index 0000000..8d4b9c6
--- /dev/null
@@ -0,0 +1,52 @@
+#! /bin/sh
+# Copyright (C) 2004  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check the tar options diagnostics.
+
+. ./defs || exit 1
+
+set -e
+
+cat > configure.in << 'END'
+AC_INIT([tar2], [1.0])
+AM_INIT_AUTOMAKE([tar-pax tar-v7])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+: > Makefile.am
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 'configure.in:2:.*mutually exclusive' stderr
+
+rm -rf autom4te.cache
+
+cat > configure.in << 'END'
+AC_INIT([tar2], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+echo 'AUTOMAKE_OPTIONS = tar-pax' > Makefile.am
+
+AUTOMAKE_fails
+grep 'Makefile.am:1:.*tar-pax.*AM_INIT_AUTOMAKE' stderr