* m4/optional.m4: New file. AM_OPTIONAL_AUTOMAKE(OPTIONS) makes
`make dist' build the listed dist-XXX archives when their tool is
available and skip them otherwise, without failing. Supports
all the available compression options:
dist-bzip2, dist-bzip3, dist-xz, dist-lzip, dist-zstd, dist-zip,
dist-shar, dist-tarZ. dist-shar is handled separately: shar is
run to an intermediate file before gzip so a missing shar cannot
leave a bogus .shar.gz behind.
* m4/local.mk (dist_automake_ac_DATA): Add m4/optional.m4.
* doc/automake.texi (Public Macros): Document it. Cross-reference
it from dist-bzip3, dist-lzip and dist-zstd.
* t/am-optional-automake.sh: New test, including a distcheck case.
* t/list-of-tests.mk: Add it.
* NEWS: Mention the new macro.