automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Add xz compression support.


From: Jim Meyering
Subject: [PATCH] Add xz compression support.
Date: Wed, 12 Nov 2008 22:33:19 +0100

Hi Ralf,

lzma-utils is morphing into xz, and will yield a beta (aka stable API)
release of the xz package in the not too distant future.
What do you think of adding support for xz in automake?

Jim

>From dcd36adf4f987036417374c8436275fbbc596b67 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 29 Oct 2008 16:24:06 +0100
Subject: [PATCH]  Add xz compression support.

* NEWS: Mention xz, as well lzma (xz will displace lzma).
* automake.in (handle_dist): Recognize dist-xz.
(make_paragraphs): Map XZ to dist-xz.
* doc/automake.texi (Dist): Add dist-xz.
(Options): Likewise.
* lib/Automake/Options.pm (_process_option_list):
* lib/am/distdir.am (dist-xz): New rule.
(dist dist-all): Add command to create an xz-compressed tarball.
(distcheck): Handle xz-compressed tarballs just like the others.
* tests/xz.test: New file, based on nogzip.test.
* tests/Makefile.am (TESTS): Add xz.test.
---
 NEWS                    |    3 ++-
 aclocal.m4              |    4 ++--
 automake.in             |    3 ++-
 doc/automake.texi       |    8 +++++++-
 lib/Automake/Options.pm |    4 ++--
 lib/am/distdir.am       |    9 +++++++++
 tests/Makefile.am       |    1 +
 tests/Makefile.in       |    1 +
 8 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/NEWS b/NEWS
index 7ccc3e1..1878ced 100644
--- a/NEWS
+++ b/NEWS
@@ -53,7 +53,8 @@ New in 1.10a:
       cvs -d :pserver:address@hidden:/automake.git \
           checkout -d automake HEAD

-  - "make dist" can now create lzma-compressed tarballs.
+  - "make dist" can now create xz-compressed tarballs,
+    as well as (deprecated?) lzma-compressed tarballs.

   - Automake is licensed under GPLv3+.  `automake --add-missing' will
     by default install the GPLv3 file as COPYING if it is missing.
diff --git a/aclocal.m4 b/aclocal.m4
index b275e43..d695c01 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -13,8 +13,8 @@

 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
-[m4_warning([this file was generated for autoconf 2.63.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63.107-cde7-dirty],,
+[m4_warning([this file was generated for autoconf 2.63.107-cde7-dirty.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 
`autoreconf'.])])
diff --git a/automake.in b/automake.in
index 66633df..c58f534 100755
--- a/automake.in
+++ b/automake.in
@@ -3723,7 +3723,7 @@ sub handle_dist ()
     {
       my $archive_defined = option 'no-dist-gzip' ? 0 : 1;
       $archive_defined ||=
-       grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzma);
+       grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzma xz);
       error (option 'no-dist-gzip',
             "no-dist-gzip specified but no dist-* specified, "
             . "at least one archive format must be enabled")
@@ -6631,6 +6631,7 @@ sub make_paragraphs ($%)
                 'MAINTAINER-MODE'
                 => $seen_maint_mode ? subst ('MAINTAINER_MODE_TRUE') : '',

+                'XZ'          => !! option 'dist-xz',
                 'LZMA'        => !! option 'dist-lzma',
                 'BZIP2'       => !! option 'dist-bzip2',
                 'COMPRESS'    => !! option 'dist-tarZ',
diff --git a/doc/automake.texi b/doc/automake.texi
index e9aebc8..2c687b8 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8256,6 +8256,12 @@ frequently smaller than @command{bzip2}-compressed 
archives.
 Generate a shar archive of the distribution.
 @trindex dist-shar

address@hidden @code{dist-xz}
+Generate an xz tar archive of the distribution.  xz archives are
+frequently smaller than @command{bzip2}-compressed archives.
+The xz format will soon (early 2009) displace the lzma format.
address@hidden dist-xz
+
 @item @code{dist-zip}
 Generate a zip archive of the distribution.
 @trindex dist-zip
@@ -12308,4 +12314,4 @@ parentheses is the number of generated test cases.
 @c  LocalWords:  LTALLOCA MALLOC malloc memcmp strdup alloca libcompat xyz DFOO
 @c  LocalWords:  unprefixed buildable preprocessed DBAZ DDATADIR WARNINGCFLAGS
 @c  LocalWords:  LIBFOOCFLAGS LIBFOOLDFLAGS ftable testSubDir obj LIBTOOLFLAGS
address@hidden  LocalWords:  barexec Pinard's automatize initialize lzma
address@hidden  LocalWords:  barexec Pinard's automatize initialize lzma xz
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index 1705981..5750cd1 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2004, 2006, 2007  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2006, 2007, 2008  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
@@ -259,7 +259,7 @@ sub _process_option_list (\%$@)
       elsif ($_ eq 'no-installman' || $_ eq 'no-installinfo'
             || $_ eq 'dist-shar' || $_ eq 'dist-zip'
             || $_ eq 'dist-tarZ' || $_ eq 'dist-bzip2'
-            || $_ eq 'dist-lzma'
+            || $_ eq 'dist-lzma' || $_ eq 'dist-xz'
             || $_ eq 'no-dist-gzip' || $_ eq 'no-dist'
             || $_ eq 'dejagnu' || $_ eq 'no-texinfo.tex'
             || $_ eq 'readme-alpha' || $_ eq 'check-news'
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index 6f48293..218e65a 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -304,6 +304,12 @@ dist-lzma: distdir
        tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
        $(am__remove_distdir)

+?XZ?DIST_ARCHIVES += $(distdir).tar.xz
+.PHONY: dist-xz
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(am__remove_distdir)
+
 ?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z
 .PHONY: dist-tarZ
 dist-tarZ: distdir
@@ -341,6 +347,7 @@ dist dist-all: distdir
 ?GZIP? tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c 
>$(distdir).tar.gz
 ?BZIP2?        tardir=$(distdir) && $(am__tar) | bzip2 -9 -c 
>$(distdir).tar.bz2
 ?LZMA? tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+?XZ?   tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
 ?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
@@ -368,6 +375,8 @@ distcheck: dist
          bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
        *.tar.lzma*) \
          unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
        *.tar.Z*) \
          uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
        *.shar.gz*) \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 023e1f7..0bf918c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -653,6 +653,7 @@ werror.test \
 werror2.test \
 whoami.test \
 xsource.test \
+xz.test \
 yacc.test \
 yacc2.test \
 yacc3.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 4207f6c..1aedd97 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -806,6 +806,7 @@ werror.test \
 werror2.test \
 whoami.test \
 xsource.test \
+xz.test \
 yacc.test \
 yacc2.test \
 yacc3.test \
--
1.6.0.4.879.g9d19a




reply via email to

[Prev in Thread] Current Thread [Next in Thread]