From 6da46f316146c3c6c5ea1741a69e16ecd40620d0 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 2 Oct 2010 22:30:02 +0200 Subject: [PATCH] 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. --- ChangeLog | 13 +++++++++++++ NEWS | 5 +++++ doc/automake.texi | 9 +++++++++ lib/am/distdir.am | 4 ++-- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 49af987b2..de880cbd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2010-10-05 Jim Meyering + + 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 Add support for newer python versions. diff --git a/NEWS b/NEWS index 121989fa4..c64ec14d0 100644 --- 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. diff --git a/doc/automake.texi b/doc/automake.texi index 22c2f27bd..60e450f2f 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -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} diff --git a/lib/am/distdir.am b/lib/am/distdir.am index a11d3a43e..185d34cd9 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -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 -- 2.47.2