dist-xz, dist-bzip2: don't hard-code -9, honor envvar settings
commitc8e01d581a7e7c2445a139def46939a547951746
authorJim Meyering <meyering@redhat.com>
Fri, 9 Dec 2011 22:17:18 +0000 (9 23:17 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 9 Dec 2011 23:25:46 +0000 (10 00:25 +0100)
tree9436dd6965bbe37ff6a99e4492758160a6bceca5
parent7dbb5500f658405e8862a90f1bb17d0c82a27f54
dist-xz, dist-bzip2: don't hard-code -9, honor envvar settings

Before the present change, automake-generated `dist-xz' rule used
a hard-coded `xz -9'.  That was a problem because on this front,
xz differs from gzip and bzip2.  While the latter two don't incur
any run-time decompression penalty for using a higher compression
level, specifying -9 with xz imposes a potentially fatal virtual
memory requirement on any client that wants to decompress your
tar.xz file.
People have complained that a tarball compressed with -9 cannot
be uncompressed in a low-memory environment (wrt-based embedded).
Hence, instead of defaulting to -9, which is useful only for very
large tarballs, it defaults to -e (equivalent to -6e).  This
limits the default memory requirements imposed on decompressors,
yet still gives very good compression ratios.

* lib/am/distdir.am (dist-xz): Do not hard-code xz's -9: that made
it impossible to override.  Actually don't default to -9, either,
since that induced inordinately large virtual memory usage when
merely decompressing.  Instead, use its XZ_OPT envvar, defaulting
to -e if not defined.  Suggested by Lasse Collin.
(dist, dist-all) [?XZ?]: Likewise
(dist-bzip2): Similarly, do not hard-code -9, but do continue to
use -9 by default.  Honor the BZIP2 envvar.
(dist, dist-all) [?BZIP2?]: Likewise
* NEWS: Update.
* doc/automake.texi (The Types of Distributions): Describe the
newly enabled environment variables.

This is inspired to commit v1.11-389-g6da46f3, with additional
changes to reflect that the xz compression level should default
to -e, not -9.
ChangeLog
Makefile.in
NEWS
doc/automake.texi
lib/am/distdir.am