]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
dist-xz, dist-bzip2: don't hard-code -9: honor envvar settings
authorJim Meyering <meyering@redhat.com>
Sat, 2 Oct 2010 20:30:02 +0000 (22:30 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 5 Oct 2010 17:07:24 +0000 (19:07 +0200)
* lib/am/distdir.am (dist-xz): Do not hard-code xz's -9: that
made it impossible to override.  Instead, use its XZ_OPT envvar,
defaulting to -9 if not defined.  Thus no change in behavior
when XZ_OPT is not set, and now, this rule honors the setting
of that envvar when it is set.  Suggested by Lasse Collin.
(dist-bzip2): Likewise for it's corresponding envvar: BZIP2.
* NEWS (Miscellaneous changes): Mention it.
* doc/automake.texi (The Types of Distributions): Describe the
newly enabled environment variables.

ChangeLog
NEWS
doc/automake.texi
lib/am/distdir.am

index 49af987b2a6a2d6488cdaa16f1e0ec4a0d1e8d17..de880cbd0075b0be179b81f7ce185b3faeb4a3b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-10-05  Jim Meyering  <meyering@redhat.com>
+
+       dist-xz, dist-bzip2: don't hard-code -9: honor envvar settings
+       * lib/am/distdir.am (dist-xz): Do not hard-code xz's -9: that
+       made it impossible to override.  Instead, use its XZ_OPT envvar,
+       defaulting to -9 if not defined.  Thus no change in behavior
+       when XZ_OPT is not set, and now, this rule honors the setting
+       of that envvar when it is set.  Suggested by Lasse Collin.
+       (dist-bzip2): Likewise for it's corresponding envvar: BZIP2.
+       * NEWS (Miscellaneous changes): Mention it.
+       * doc/automake.texi (The Types of Distributions): Describe the
+       newly enabled environment variables.
+
 2010-10-04  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Add support for newer python versions.
diff --git a/NEWS b/NEWS
index 121989fa448764e5b70265ccd81e458b3844dcef..c64ec14d027ddeaeb45d97a617dfd62c41fb93bf 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,11 @@ New in 1.11a:
 
   - "make dist" can now create lzip-compressed tarballs.
 
+  - You may adjust the compression options used in dist-xz and dist-bzip2.
+    The default is still -9 for each, but you may specify a different
+    level via the XZ_OPT and BZIP2 envvars respectively.  E.g.,
+    "make dist-xz XZ_OPT=-7" or "make dist-xz BZIP2=-5"
+
   - Messages of types warning or error from `automake' and `aclocal' are now
     prefixed with the respective type, and presence of -Werror is noted.
 
index 22c2f27bd439744daf69433adcecfa598feb59bb..60e450f2fca7020c5186e16f017c4dea8828c387 100644 (file)
@@ -8458,9 +8458,13 @@ Automake generates rules to provide archives of the project for
 distributions in various formats.  Their targets are:
 
 @table @asis
+@vindex BZIP2
 @item @code{dist-bzip2}
 Generate a bzip2 tar archive of the distribution.  bzip2 archives are
 frequently smaller than gzipped archives.
+By default, this rule makes @samp{bzip2} use a compression option of @option{-9}.
+To make it use a different one, set the @env{BZIP2} environment variable.
+For example, @samp{make dist-bzip2 BZIP2=-7}.
 @trindex dist-bzip2
 
 @item @code{dist-gzip}
@@ -8483,10 +8487,15 @@ instead.
 Generate a shar archive of the distribution.
 @trindex dist-shar
 
+@vindex XZ_OPT
 @item @code{dist-xz}
 Generate an @samp{xz} tar archive of the distribution.  @command{xz}
 archives are frequently smaller than @command{bzip2}-compressed archives.
 The @samp{xz} format displaces the obsolete @samp{lzma} format.
+By default, this rule makes @samp{xz} use a compression option of @option{-9}.
+To make it use a different one, set the @env{XZ_OPT} environment variable.
+For example, run this command to use the default compression ratio, but
+with a progress indicator: @samp{make dist-xz XZ_OPT=-7e}.
 @trindex dist-xz
 
 @item @code{dist-zip}
index a11d3a43e7c39cab5cdf5d5411af156729f10200..185d34cd91d5dfb69b0cf8423dcfbcf517bf2974 100644 (file)
@@ -345,7 +345,7 @@ dist-gzip: distdir
 ?BZIP2?DIST_ARCHIVES += $(distdir).tar.bz2
 .PHONY: dist-bzip2
 dist-bzip2: distdir
-       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+       tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
        $(am__post_remove_distdir)
 
 ?LZIP?DIST_ARCHIVES += $(distdir).tar.lz
@@ -363,7 +363,7 @@ dist-lzma: distdir
 ?XZ?DIST_ARCHIVES += $(distdir).tar.xz
 .PHONY: dist-xz
 dist-xz: distdir
-       tardir=$(distdir) && $(am__tar) | xz -9 -c >$(distdir).tar.xz
+       tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--9} xz -c >$(distdir).tar.xz
        $(am__post_remove_distdir)
 
 ?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z