From fd047ad7744c46c5d662548d2e9fcda7e0ac2509 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Mon, 19 Apr 2004 23:20:06 +0000 Subject: [PATCH] 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. --- ChangeLog | 17 ++++++ Makefile.in | 22 +++---- NEWS | 3 + aclocal.m4 | 1 + configure | 16 +++-- doc/Makefile.in | 4 +- doc/automake.texi | 40 +++++++++++++ doc/stamp-vti | 2 +- doc/version.texi | 2 +- lib/Automake/Makefile.in | 4 +- lib/Automake/Options.pm | 18 +++++- lib/Automake/tests/Makefile.in | 4 +- lib/Makefile.in | 4 +- lib/am/Makefile.in | 4 +- lib/am/distdir.am | 18 +++--- m4/Makefile.am | 3 +- m4/Makefile.in | 7 ++- m4/init.m4 | 7 ++- m4/tar.m4 | 103 +++++++++++++++++++++++++++++++++ tests/Makefile.am | 3 + tests/Makefile.in | 7 ++- tests/tar.test | 41 +++++++++++++ tests/tar2.test | 41 +++++++++++++ tests/tar3.test | 52 +++++++++++++++++ 24 files changed, 384 insertions(+), 39 deletions(-) create mode 100644 m4/tar.m4 create mode 100755 tests/tar.test create mode 100755 tests/tar2.test create mode 100755 tests/tar3.test diff --git a/ChangeLog b/ChangeLog index b9327e97..ec525bca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2004-04-20 Alexandre Duret-Lutz + + 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 * lib/am/distdir.am (distcheck): Typo in shar decompression. diff --git a/Makefile.in b/Makefile.in index f1f5f732..4e61c31d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 58da9927..6939fb73 100644 --- 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. + New in 1.8: diff --git a/aclocal.m4 b/aclocal.m4 index 8d9c152b..6387e06b 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -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]) diff --git a/configure b/configure index ec0b2f85..e3c326f6 100755 --- 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 diff --git a/doc/Makefile.in b/doc/Makefile.in index 8883e86d..d29cb3f6 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -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@ diff --git a/doc/automake.texi b/doc/automake.texi index 254c3913..e40744fa 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -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 diff --git a/doc/stamp-vti b/doc/stamp-vti index a6946560..0d3a2687 100644 --- a/doc/stamp-vti +++ b/doc/stamp-vti @@ -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 diff --git a/doc/version.texi b/doc/version.texi index a6946560..0d3a2687 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -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 diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index 4ad249a0..4b9abe97 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -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@ diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm index cb066726..85fd3a25 100644 --- a/lib/Automake/Options.pm +++ b/lib/Automake/Options.pm @@ -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. diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index d41b55b5..1c03540c 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -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@ diff --git a/lib/Makefile.in b/lib/Makefile.in index 38ed90e1..b11bd931 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -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@ diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index 6b2eb785..f694e45c 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -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@ diff --git a/lib/am/distdir.am b/lib/am/distdir.am index 0ed05935..8561c185 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -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*) \ diff --git a/m4/Makefile.am b/m4/Makefile.am index c4970cb9..105c6380 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -53,7 +53,8 @@ python.m4 \ regex.m4 \ runlog.m4 \ sanity.m4 \ -strip.m4 +strip.m4 \ +tar.m4 EXTRA_DIST = dirlist amversion.in diff --git a/m4/Makefile.in b/m4/Makefile.in index 0a386063..a8166454 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -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 diff --git a/m4/init.m4 b/m4/init.m4 index 3465dac8..0c497377 100644 --- a/m4/init.m4 +++ b/m4/init.m4 @@ -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 index 00000000..27020cfe --- /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 /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 diff --git a/tests/Makefile.am b/tests/Makefile.am index 817dff18..3a690d66 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 8583b241..94b08ac3 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 index 00000000..16d54f49 --- /dev/null +++ b/tests/tar.test @@ -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 index 00000000..9539c318 --- /dev/null +++ b/tests/tar2.test @@ -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 index 00000000..8d4b9c65 --- /dev/null +++ b/tests/tar3.test @@ -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 -- 2.43.5