Add support for using the zstd compression algorithm.
Use a default compression setting of -19, and ".zst" as the suffix.
* bin/automake.in (handle_dist): Add zstd to the list of known dist-
suffixes.
(preprocess_file): Map ZSTD to dist-zstd.
* doc/automake.texi: Document the new option.
* lib/Automake/Options.pm (_is_valid_easy_option): Add dist-zstd.
* lib/am/distdir.am (dist-zstd): New rule.
(?ZSTD?DIST_TARGETS): Add definition.
(distcheck): Add a case for *.tar.zst*.
* t/dist-formats.tap: Add tests.
* NEWS: Mention the change.
New in ?.?.?:
+* New features added
+
+ - add zstd support and the automake option, dist-zstd.
+
* Miscellaneous changes
- automake no longer requires a @setfilename in each .texi file
{
my $archive_defined = option 'no-dist-gzip' ? 0 : 1;
$archive_defined ||=
- grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzip xz);
+ grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzip xz zstd);
error (option 'no-dist-gzip',
"no-dist-gzip specified but no dist-* specified,\n"
. "at least one archive format must be enabled")
'GZIP' => ! option 'no-dist-gzip',
'SHAR' => !! option 'dist-shar',
'ZIP' => !! option 'dist-zip',
+ 'ZSTD' => !! option 'dist-zstd',
'INSTALL-INFO' => ! option 'no-installinfo',
'INSTALL-MAN' => ! option 'no-installman',
in Automake 2.0.
@trindex dist-shar
+@vindex ZSTD_OPT
+@vindex ZSTD_CLEVEL
+@item @code{dist-zstd}
+Generate a @samp{zstd} tar archive of the distribution. By default, this
+rule makes @samp{zstd} use a compression option of @option{-19}. To
+make it use a different one, set the @env{ZSTD_OPT} environment variable.
+For example, run this command to use the default compression ratio,
+but with a progress indicator: @samp{make dist-zstd ZSTD_OPT=-19v}.
+However, note that for compatibility with zstd itself, you may instead set the @env{ZSTD_CLEVEL} environment variable, in which case, any @env{ZSTD_OPT} setting is ignored.
+@trindex dist-zstd
+
@end table
The rule @code{dist} (and its historical synonym @code{dist-all})
Hook @code{dist-zip} to @code{dist}.
@trindex dist-zip
+@item @option{dist-zstd}
+@cindex Option, @option{dist-zstd}
+@opindex dist-zstd
+Hook @code{dist-zstd} to @code{dist}.
+@trindex dist-zstd
+
@item @option{dist-shar}
@cindex Option, @option{dist-shar}
@opindex dist-shar
These three mutually exclusive options select the tar format to use
when generating tarballs with @samp{make dist}. (The tar file created
is then compressed according to the set of @option{no-dist-gzip},
-@option{dist-bzip2}, @option{dist-lzip}, @option{dist-xz} and
-@option{dist-tarZ} options in use.)
+@option{dist-bzip2}, @option{dist-lzip}, @option{dist-xz},
+@option{dist-zstd} and @option{dist-tarZ} options in use.)
These options must be passed as arguments to @code{AM_INIT_AUTOMAKE}
(@pxref{Macros}) because they can require additional configure checks.
@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
-@c LocalWords: barexec Pinard's automatize initialize lzip xz cscope
+@c LocalWords: barexec Pinard's automatize initialize lzip xz zstd cscope
dist-lzip
dist-xz
dist-zip
+ dist-zstd
info-in-builddir
no-define
no-dependencies
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
+?ZSTD?DIST_ARCHIVES += $(distdir).tar.zst
+.PHONY: dist-zstd
+dist-zstd: distdir
+ tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
+ $(am__post_remove_distdir)
+
?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z
.PHONY: dist-tarZ
dist-tarZ: distdir
?BZIP2?DIST_TARGETS += dist-bzip2
?GZIP?DIST_TARGETS += dist-gzip
?ZIP?DIST_TARGETS += dist-zip
+?ZSTD?DIST_TARGETS += dist-zstd
?COMPRESS?DIST_TARGETS += dist-tarZ
endif %?TOPDIR_P%
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
+ *.tar.zst*) \
+ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
esac
## Make the new source tree read-only. Distributions ought to work in
## this case. However, make the top-level directory writable so we
am_create_testdir=empty
. test-init.sh
-plan_ 66
+plan_ 75
# ---------------------------------------------------- #
# Common and/or auxiliary subroutines and variables. #
xz) suffix=tar.xz compressor=xz ;;
bzip2) suffix=tar.bz2 compressor=bzip2 ;;
zip) suffix=zip compressor=zip ;;
+ zstd) suffix=tar.zst compressor=zstd ;;
*) fatal_ "invalid compression format '$1'";;
esac
}
return 0
}
-all_compression_formats='gzip lzip xz bzip2 zip'
+all_compression_formats='gzip lzip xz bzip2 zip zstd'
all_compressors=$(
for x in $all_compression_formats; do
nogzip in ac and xz in am
nogzip in am and lzip in ac
nogzip in ac and zip in ac
+nogzip in ac and zstd in ac
# ----------------------------------------------------------- #