Compare commits

..

156 Commits
master ... v5.0

Author SHA1 Message Date
Adrien Nader 265e5ffb70 po/fr: improve wording for help for --lzma1/--lzma2. 2014-12-21 17:06:21 +02:00
Adrien Nader 3dfa915cd1 po/fr: missing line in translation of --extreme. 2014-12-21 17:06:21 +02:00
Lasse Collin 6b65e84bd4 xz: Fix a comment. 2014-12-21 14:08:08 +02:00
Lasse Collin 4da8e1d833 Bump version and soname for 5.0.8. 2014-12-21 13:50:08 +02:00
Lasse Collin f6dc9996b0 Update NEWS for 5.0.8. 2014-12-21 13:48:45 +02:00
Lasse Collin 67d62a375a Translations: Update the French translation.
Thanks to Adrien Nader.
2014-12-20 20:49:49 +02:00
Lasse Collin 283c03fe5b Update THANKS. 2014-12-18 21:33:33 +02:00
Lasse Collin 0c7fe9f227 Update INSTALL about a "make check" failure in test_scripts.sh. 2014-12-18 21:27:52 +02:00
Lasse Collin b46fe3ced9 Build: Update m4/ax_pthread.m4 from Autoconf Archive. 2014-12-18 21:27:41 +02:00
Lasse Collin 6ed0554a15 Build: Replace obsolete AC_HELP_STRING with AS_HELP_STRING. 2014-12-18 21:27:35 +02:00
Lasse Collin 0ab300ec52 Build: Fix Autoconf warnings about escaped backquotes. 2014-12-18 21:26:20 +02:00
Lasse Collin b274ad02c4 Update THANKS. 2014-12-17 21:15:02 +02:00
Lasse Collin 4fdcccd85e Add support for AmigaOS/AROS to tuklib_physmem().
Thanks to Fredrik Wikstrom.
2014-12-17 21:15:02 +02:00
Lasse Collin f229fa32bf xzgrep: Avoid passing both -q and -l to grep.
The behavior of grep -ql varies:
  - GNU grep behaves like grep -q.
  - OpenBSD grep behaves like grep -l.

POSIX doesn't make it 100 % clear what behavior is expected.
Anyway, using both -q and -l at the same time makes no sense
so both options simply should never be used at the same time.

Thanks to Christian Weisgerber.
2014-12-17 21:13:42 +02:00
Lasse Collin 94a1a869ee Build: Detect supported compiler warning flags better.
Clang and nowadays also GCC accept any -Wfoobar option
but then may give a warning that an unknown warning option
was specified. To avoid adding unsupported warning options,
the options are now tested with -Werror.

Thanks to Charles Diza.
2014-12-17 21:13:42 +02:00
Andre Noll 0e50ad7129 l10n: de.po: Change translator email address.
Although the old address is still working, the new one should
be preferred. So this commit changes all three places in de.po
accordingly.

Signed-off-by: Andre Noll <maan@tuebingen.mpg.de>
2014-10-18 18:23:15 +03:00
Andre Noll 9fd333d742 l10n: de.po: Fix typo: Schießen -> Schließen.
That's a funny one since "schießen" means to shoot :)

Signed-off-by: Andre Noll <maan@systemlinux.org>
2014-10-18 18:23:14 +03:00
Lasse Collin 495aaf3a5b Bump version and soname for 5.0.7. 2014-09-20 20:44:32 +03:00
Lasse Collin ac6c8921d1 Update NEWS for 5.0.7. 2014-09-20 20:43:29 +03:00
Lasse Collin d1b0276aaf liblzma: Fix invalid Libs.private value in liblzma.pc. 2014-09-20 20:21:18 +03:00
Lasse Collin cac72956b1 liblzma: Fix a portability problem in Makefile.am.
POSIX supports $< only in inference rules (suffix rules).
Using it elsewhere is a GNU make extension and doesn't
work e.g. with OpenBSD make.

Thanks to Christian Weisgerber for the patch.
2014-09-20 19:48:16 +03:00
Lasse Collin 2cdf0875de Bump version and soname for 5.0.6. 2014-09-14 19:35:45 +03:00
Lasse Collin 0168b6c8fb Update NEWS for 5.0.6. 2014-09-14 19:33:46 +03:00
Lasse Collin 13337714e8 xzgrep: List xzgrep_expected_output in tests/Makefile.am. 2014-09-09 19:18:23 +03:00
Lasse Collin ccc728d829 xzgrep: Improve the test script.
Now it should be close to the functionality of the original
version by Pavel Raiskup.
2014-09-09 19:18:23 +03:00
Lasse Collin 948f5865fe xzgrep: Add a test for the previous fix.
This is a simplified version of Pavel Raiskup's
original patch.
2014-09-09 19:18:23 +03:00
Lasse Collin 64228d0d5c xzgrep: exit 0 when at least one file matches.
Mimic the original grep behavior and return exit_success when
at least one xz compressed file matches given pattern.

Original bugreport:
https://bugzilla.redhat.com/show_bug.cgi?id=1108085

Thanks to Pavel Raiskup for the patch.
2014-09-09 19:18:23 +03:00
Lasse Collin 98d3368ef4 Build: Fix the combination of --disable-xzdec --enable-lzmadec.
In this case "make install" could fail if the man page directory
didn't already exist at the destination. If it did exist, a
dangling symlink was created there. Now the link is omitted
instead. This isn't the best fix but it's better than the old
behavior.
2014-04-26 08:47:36 +03:00
Lasse Collin ba3b5dd082 Build: Add --disable-doc to configure. 2014-04-26 08:47:36 +03:00
Lasse Collin 3d4575f236 Update INSTALL.
Add a note about failing "make check". The source of
the problem should be fixed in libtool (if it really is
a libtool bug and not mine) but I'm unable to spend time
on that for now. Thanks to Nelson H. F. Beebe for reporting
the issue.

Add a note about a possible need to run "ldconfig" after
"make install".
2014-04-26 08:47:24 +03:00
Lasse Collin b9f0584e3e xz: Rename a variable to avoid a namespace collision on Solaris.
I don't know the details but I have an impression that there's
no problem in practice if using GCC since people have built xz
with GCC (without patching xz), but renaming the variable cannot
hurt either.

Thanks to Mark Ashley.
2014-04-26 08:47:24 +03:00
Lasse Collin cc41bcaf77 xz: Fix a comment. 2014-04-26 08:45:49 +03:00
Lasse Collin e34025d666 liblzma: Avoid C99 compound literal arrays.
MSVC 2013 doesn't like them. Maybe they aren't so good
for readability either since many aren't used to them.
2014-04-26 08:38:12 +03:00
Lasse Collin 0b6168974f liblzma: Remove a useless C99ism from sha256.c.
Unsurprisingly it makes no difference in compiled output.
2014-04-26 08:38:12 +03:00
Lasse Collin 41e436076c xz: Fix use of wrong variable.
Since the only call to suffix_set() uses optarg
as the argument, fixing this bug doesn't change
the behavior of the program.
2014-04-26 08:37:15 +03:00
Lasse Collin c33efefd4e Fix typos in comments. 2014-04-26 08:37:00 +03:00
Lasse Collin e560c82f1f Update THANKS. 2014-04-26 08:31:53 +03:00
Lasse Collin 05192b32e5 liblzma: Document the need for block->check for lzma_block_header_decode().
Thanks to Tomer Chachamu.
2014-04-26 08:31:43 +03:00
Lasse Collin 0f35eafe51 Update TODO. 2014-04-26 08:31:21 +03:00
Lasse Collin fc9eaf81d7 Build: Remove a comment about Automake 1.10 from configure.ac.
The previous commit supports silent rules and that requires
Automake 1.11.
2014-04-26 08:30:00 +03:00
Lasse Collin 090c69dda5 Build: Create liblzma.pc in a src/liblzma/Makefile.am.
Previously it was done in configure, but doing that goes
against the Autoconf manual. Autoconf requires that it is
possible to override e.g. prefix after running configure
and that doesn't work correctly if liblzma.pc is created
by configure.

A potential downside of this change is that now e.g.
libdir in liblzma.pc is a standalone string instead of
being defined via ${prefix}, so if one overrides prefix
when running pkg-config the libdir won't get the new value.
I don't know if this matters in practice.

Thanks to Vincent Torri.
2014-04-26 08:29:17 +03:00
Anders F Bjorklund 1f35331332 macosx: separate liblzma package 2013-08-03 13:24:47 +03:00
Anders F Bjorklund 1415f1d946 macosx: set minimum to leopard 2013-08-03 13:24:47 +03:00
Anders F Bjorklund 41913949b9 move configurables into variables 2013-08-03 13:24:47 +03:00
Lasse Collin 3dffda33f4 Build: Fix the detection of missing CRC32.
Thanks to Vincent Torri.
2013-08-03 13:24:36 +03:00
Lasse Collin b69900ed0b Man pages: Use similar syntax for synopsis as in xz.
The man pages of lzmainfo, xzmore, and xzdec had similar
constructs as the man page of xz had before the commit
eb6ca9854b. Eric S. Raymond
didn't mention these man pages in his bug report, but
it's nice to be consistent.
2013-06-30 18:03:54 +03:00
Lasse Collin cf4a1e1879 Update NEWS for 5.0.5. 2013-06-30 15:55:09 +03:00
Lasse Collin cb94bb6d1f Bump version and soname for 5.0.5. 2013-06-30 15:54:38 +03:00
Lasse Collin b7dee202d5 xz: Fix return value type in io_write_buf().
It didn't affect the behavior of the code since -1
becomes true anyway.
2013-06-28 23:56:34 +03:00
Lasse Collin 265e7b44d8 xz: Remove an outdated NetBSD-specific comment.
Nowadays errno == EFTYPE is documented in open(2).
2013-06-28 22:04:40 +03:00
Lasse Collin 78c2f8db90 xz: Fix error detection of fcntl(fd, F_SETFL, flags) calls.
POSIX says that fcntl(fd, F_SETFL, flags) returns -1 on
error and "other than -1" on success. This is how it is
documented e.g. on OpenBSD too. On Linux, success with
F_SETFL is always 0 (at least accorinding to fcntl(2)
from man-pages 3.51).
2013-06-28 22:04:36 +03:00
Lasse Collin 91750dff8f xz: Fix use of wrong variable in a fcntl() call.
Due to a wrong variable name, when writing a sparse file
to standard output, *all* file status flags were cleared
(to the extent the operating system allowed it) instead of
only clearing the O_APPEND flag. In practice this worked
fine in the common situations on GNU/Linux, but I didn't
check how it behaved elsewhere.

The original flags were still restored correctly. I still
changed the code to use a separate boolean variable to
indicate when the flags should be restored instead of
relying on a special value in stdout_flags.
2013-06-28 22:04:32 +03:00
Lasse Collin e11888a79a xz: Check the value of lzma_stream_flags.version in --list.
It is a no-op for now, but if an old xz version is used
together with a newer liblzma that supports something new,
then this check becomes important and will stop the old xz
from trying to parse files that it won't understand.
2013-06-26 13:31:19 +03:00
Lasse Collin f39ddd88f3 Build: Require Automake 1.12 and use serial-tests option.
It should actually still work with Automake 1.10 if
the serial-tests option is removed. Automake 1.13 started
using parallel tests by default and the option to get
the old behavior isn't supported before 1.12.

At least for now, parallel tests don't improve anything
in XZ Utils but they hide the progress output from
test_compress.sh.
2013-06-26 12:17:13 +03:00
Lasse Collin cb84e27802 xz: Validate Uncompressed Size from Block Header in list.c.
This affects only "xz -lvv". Normal decompression with xz
already detected if Block Header and Index had mismatched
Uncompressed Size fields. So this just makes "xz -lvv"
show such files as corrupt instead of showing the
Uncompressed Size from Index.
2013-06-26 10:59:19 +03:00
Lasse Collin f01780fce4 Update THANKS. 2013-06-26 10:58:58 +03:00
Lasse Collin d98ede7d70 xz: Make the man page more friendly to doclifter.
Thanks to Eric S. Raymond.
2013-06-26 10:58:07 +03:00
Lasse Collin 19b447b64b xz: A couple of man page fixes.
Now the interaction of presets and custom filter chains
is described correctly. Earlier it contradicted itself.

Thanks to DevHC who reported these issues on IRC to me
on 2012-12-14.
2013-06-26 10:54:24 +03:00
Lasse Collin 45edf2966f xz: Fix interaction between preset and custom filter chains.
There was somewhat illogical behavior when --extreme was
specified and mixed with custom filter chains.

Before this commit, "xz -9 --lzma2 -e" was equivalent
to "xz --lzma2". After it is equivalent to "xz -6e"
(all earlier preset options get forgotten when a custom
filter chain is specified and the default preset is 6
to which -e is applied). I find this less illogical.

This also affects the meaning of "xz -9e --lzma2 -7".
Earlier it was equivalent to "xz -7e" (the -e specified
before a custom filter chain wasn't forgotten). Now it
is "xz -7". Note that "xz -7e" still is the same as "xz -e7".

Hopefully very few cared about this in the first place,
so pretty much no one should even notice this change.

Thanks to Conley Moorhous.
2013-06-26 10:54:18 +03:00
Lasse Collin b065984e5a xz: Change size_t to uint32_t in a few places. 2013-06-26 10:54:09 +03:00
Lasse Collin 32be621f52 Build: Use -Wvla with GCC if supported.
Variable-length arrays are mandatory in C99 but optional in C11.
The code doesn't currently use any VLAs and it shouldn't in the
future either to stay compatible with C11 without requiring any
optional C11 features.
2013-06-26 10:53:57 +03:00
Lasse Collin efb07cfba6 xzdec: Improve the --help message.
The options are now ordered in the same order as in xz's help
message.

Descriptions were added to the options that are ignored.
I left them in parenthesis even if it looks a bit weird
because I find it easier to spot the ignored vs. non-ignored
options from the list that way.
2013-06-26 10:53:57 +03:00
Lasse Collin e3c8be1369 Update THANKS. 2013-04-05 19:34:42 +03:00
Jeff Bastian ad8282efe4 xzgrep: make the '-h' option to be --no-filename equivalent
* src/scripts/xzgrep.in: Accept the '-h' option in argument parsing.
2013-04-05 19:34:42 +03:00
Lasse Collin 9271a3eb0e liblzma: Be less picky in lzma_alone_decoder().
To avoid false positives when detecting .lzma files,
rare values in dictionary size and uncompressed size fields
were rejected. They will still be rejected if .lzma files
are decoded with lzma_auto_decoder(), but when using
lzma_alone_decoder() directly, such files will now be accepted.
Hopefully this is an OK compromise.

This doesn't affect xz because xz still has its own file
format detection code. This does affect lzmadec though.
So after this commit lzmadec will accept files that xz or
xz-emulating-lzma doesn't.

NOTE: lzma_alone_decoder() still won't decode all .lzma files
because liblzma's LZMA decoder doesn't support lc + lp > 4.

Reported here:
http://sourceforge.net/projects/lzmautils/forums/forum/708858/topic/7068827

Conflicts:
	src/liblzma/common/alone_decoder.c
	src/liblzma/common/alone_decoder.h
2013-04-05 19:34:09 +03:00
Lasse Collin 211b931cee Avoid unneeded use of awk in xzless.
Use "read" instead of "awk" in xzless to get the version
number of "less". The need for awk was introduced in
the commit db5c1817fa.

Thanks to Ariel P for the patch.
2013-04-05 19:28:08 +03:00
Jonathan Nieder 9f62fd9605 xzless: Make "less -V" parsing more robust
In v4.999.9beta~30 (xzless: Support compressed standard input,
2009-08-09), xzless learned to parse ‘less -V’ output to figure out
whether less is new enough to handle $LESSOPEN settings starting
with “|-”.  That worked well for a while, but the version string from
‘less’ versions 448 (June, 2012) is misparsed, producing a warning:

	$ xzless /tmp/test.xz; echo $?
	/usr/bin/xzless: line 49: test: 456 (GNU regular expressions): \
	integer expression expected
	0

More precisely, modern ‘less’ lists the regexp implementation along
with its version number, and xzless passes the entire version number
with attached parenthetical phrase as a number to "test $a -gt $b",
producing the above confusing message.

	$ less-444 -V | head -1
	less 444
	$ less -V | head -1
	less 456 (no regular expressions)

So relax the pattern matched --- instead of expecting "less <number>",
look for a line of the form "less <number>[ (extra parenthetical)]".
While at it, improve the behavior when no matching line is found ---
instead of producing a cryptic message, we can fall back on a LESSPIPE
setting that is supported by all versions of ‘less’.

The implementation uses "awk" for simplicity.  Hopefully that’s
portable enough.

Reported-by: Jörg-Volker Peetz <jvpeetz@web.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2012-12-15 20:01:45 +02:00
Lasse Collin 1d05980f5b xz: Fix the note about --rsyncable on the man page. 2012-12-15 20:01:45 +02:00
Lasse Collin fb68497333 xz: Improve handling of failed realloc in xrealloc.
Thanks to Jim Meyering.
2012-12-15 20:01:45 +02:00
Lasse Collin 75013db6d4 A few typo fixes to comments and the xz man page.
Thanks to Jim Meyering.
2012-12-15 20:01:02 +02:00
Lasse Collin e44b21839b Build: Bump gettext version requirement to 0.18.
Otherwise too old version of m4/lib-link.m4 gets included
when autoreconf -fi is run.
2012-08-02 17:14:06 +03:00
Lasse Collin fd3dbb23ca Tests: Remove tests/test_block.c that had gotten committed accidentally. 2012-07-05 07:49:40 +03:00
Lasse Collin 05a735d279 Build: Include macosx/build.sh in the distribution.
It has been in the Git repository since 2010 but probably
few people have seen it since it hasn't been included in
the release tarballs. :-(
2012-07-05 07:49:31 +03:00
Lasse Collin 4e6d62793b Docs: Fix the name LZMA Utils -> XZ Utils in debug/README. 2012-07-05 07:49:21 +03:00
Lasse Collin dd95b5e761 Include debug/translation.bash in the distribution.
Also fix the script name mentioned in README.
2012-07-05 07:49:10 +03:00
Lasse Collin 20778053a0 xz: Update man page date to match the latest update. 2012-06-22 14:36:16 +03:00
Lasse Collin 2cefa84af6 Bump version and soname for 5.0.4. 2012-06-22 10:25:43 +03:00
Lasse Collin 433fec191a Update NEWS for 5.0.4. 2012-06-22 10:25:09 +03:00
Lasse Collin 711fa680f5 Docs: Language fix to 01_compress_easy.c.
Thanks to Jonathan Nieder.
2012-06-22 09:31:42 +03:00
Lasse Collin 3d7ab1dc61 Fix the top-level Makefile.am for the new example programs. 2012-06-22 09:31:42 +03:00
Lasse Collin ef8b8e5f11 Docs: Add new example programs.
These have more comments than the old examples and
human-readable error messages. More tutorial-like examples
are needed but these are a start.
2012-06-22 09:31:42 +03:00
Lasse Collin 75c149bc80 Docs: Move xz_pipe_comp.c and xz_pipe_decomp.c to doc/examples_old.
It is good to keep these around to so that if someone has
copied the decompressor bug from xz_pipe_decomp.c he has
an example how to easily fix it.
2012-06-22 09:31:42 +03:00
Lasse Collin 456307ebf9 Docs: Fix a bug in xz_pipe_decomp.c example program. 2012-06-22 09:31:42 +03:00
Lasse Collin 4c310b8a29 Translations: Update the Italian translation.
Thanks to Milo Casagrande.
2012-05-31 15:53:25 +03:00
Lasse Collin ec32b79366 Translations: Update the French translation.
Thanks to Adrien Nader.
2012-05-30 23:15:07 +03:00
Lasse Collin dd06f40e4d Translations: Update the German translation. 2012-05-29 22:27:00 +03:00
Lasse Collin c66808d1f5 Translations: Update Polish translation. 2012-05-29 22:12:57 +03:00
Lasse Collin 556c22dfed Preliminary NEWS for 5.0.4. 2012-05-29 13:10:36 +03:00
Lasse Collin dd13b66bf5 liblzma: Fix possibility of incorrect LZMA_BUF_ERROR.
lzma_code() could incorrectly return LZMA_BUF_ERROR if
all of the following was true:

  - The caller knows how many bytes of output to expect
    and only provides that much output space.

  - When the last output bytes are decoded, the
    caller-provided input buffer ends right before
    the LZMA2 end of payload marker. So LZMA2 won't
    provide more output anymore, but it won't know it
    yet and thus won't return LZMA_STREAM_END yet.

  - A BCJ filter is in use and it hasn't left any
    unfiltered bytes in the temp buffer. This can happen
    with any BCJ filter, but in practice it's more likely
    with filters other than the x86 BCJ.

Another situation where the bug can be triggered happens
if the uncompressed size is zero bytes and no output space
is provided. In this case the decompression can fail even
if the whole input file is given to lzma_code().

A similar bug was fixed in XZ Embedded on 2011-09-19.
2012-05-29 12:54:47 +03:00
Lasse Collin a0223bf796 Update THANKS. 2012-05-29 12:54:47 +03:00
Lasse Collin 86e57e4bfe xz: Don't show a huge number in -vv when memory limit is disabled. 2012-05-29 12:54:47 +03:00
Lasse Collin 13e44a94da xz: Document the "summary" lines of --robot -lvv.
This documents only the columns that are in v5.0.
The new columns added in the master branch aren't
necessarily stable yet.
2012-05-29 12:54:22 +03:00
Lasse Collin 2f90345e13 xz: Fix output of verbose --robot --list modes.
It printed the filename in "filename (x/y)" format
which it obviously shouldn't do in robot mode.
2012-05-29 12:54:22 +03:00
Lasse Collin 8d4864f53f Update THANKS. 2012-05-24 19:16:37 +03:00
Lasse Collin 35e9c58abb Docs: Cleanup line wrapping a bit. 2012-05-24 19:16:37 +03:00
Benno Schulenberg 532b3e4c56 Fix a few typos and add some missing articles in some documents.
Also hyphenate several compound adjectives.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2012-05-24 19:16:37 +03:00
Lasse Collin afb6ce8c82 Windows: Update notes about static linking with MSVC. 2012-05-24 19:16:14 +03:00
Lasse Collin 7c3ba2ed5c liblzma: Remove outdated comments. 2012-05-24 19:16:14 +03:00
Lasse Collin f55db9c187 DOS: Link against DJGPP's libemu to support FPU emulation.
This way xz should work on 386SX and 486SX. Floating point
only is needed for verbose output in xz.
2012-05-24 19:16:14 +03:00
Lasse Collin 203edff4c7 Docs: Update MINIX 3 information in INSTALL. 2012-05-24 18:54:21 +03:00
Lasse Collin f0a8f95c21 Update THANKS. 2012-05-24 18:52:59 +03:00
Lasse Collin b7ad23fa78 Fix exit status of xzgrep when grepping binary files.
When grepping binary files, grep may exit before it has
read all the input. In this case, gzip -q returns 2 (eating
SIGPIPE), but xz and bzip2 show SIGPIPE as the exit status
(e.g. 141). This causes wrong exit status when grepping
xz- or bzip2-compressed binary files.

The fix checks for the special exit status that indicates SIGPIPE.
It uses kill -l which should be supported everywhere since it
is in both SUSv2 (1997) and POSIX.1-2008.

Thanks to James Buren for the bug report.
2012-05-24 18:52:48 +03:00
Lasse Collin 4e19fbb04a Update THANKS. 2012-05-24 18:52:48 +03:00
Lasse Collin c6fa03a427 Fix compiling with IBM XL C on AIX. 2012-05-24 18:47:52 +03:00
Lasse Collin 7b6ffc9864 Build: Upgrade m4/acx_pthread.m4 to the latest version.
It was renamed to ax_pthread.m4 in Autoconf Archive.
2012-05-24 18:37:08 +03:00
Lasse Collin bfac2be502 Tests: Fix a compiler warning with _FORTIFY_SOURCE.
Reported here:
http://sourceforge.net/projects/lzmautils/forums/forum/708858/topic/4927385
2012-05-24 18:24:44 +03:00
Lasse Collin df85e15671 Docs: Explain the stable releases better in README. 2012-05-24 18:24:44 +03:00
Lasse Collin d06d32f108 xz: Fix a typo in a comment.
Thanks to Bela Lubkin.
2011-11-04 17:57:45 +02:00
Lasse Collin 636fdcfbf5 Update THANKS. 2011-11-03 17:44:22 +02:00
Lasse Collin 55fd02f83e xz: Fix xz on EBCDIC systems.
Thanks to Chris Donawa.
2011-11-03 17:44:22 +02:00
Lasse Collin 4052f36053 Build: Fix "make check" on Windows. 2011-09-06 12:05:44 +03:00
Lasse Collin 0f25758459 Update THANKS. 2011-09-05 16:05:44 +03:00
Lasse Collin 70f03b51ff Workaround unusual SIZE_MAX on SCO OpenServer. 2011-09-05 16:05:44 +03:00
Lasse Collin f138bdf76a Run the scripts with the correct shell in test_scripts.sh.
The scripts are now made executable in the build tree.
This way the scripts can be run like programs in
test_scripts.sh. Previously test_scripts.sh always
used sh but it's not correct if @POSIX_SHELL@ is set
to something else by configure.

Thanks to Jonathan Nieder for the patch.
2011-09-05 16:05:44 +03:00
Lasse Collin 2c144a0365 Fix exit status of "xzdiff foo.xz bar.xz".
xzdiff was clobbering the exit status from diff in a case
statement used to analyze the exit statuses from "xz" when
its operands were two compressed files. Save and restore
diff's exit status to fix this.

The bug is inherited from zdiff in GNU gzip and was fixed
there on 2009-10-09.

Thanks to Jonathan Nieder for the patch and
to Peter Pallinger for reporting the bug.
2011-09-05 16:05:44 +03:00
Anders F Bjorklund edf339227a add build script for macosx universal 2011-07-07 23:09:11 +03:00
Lasse Collin 7fcc6334ea liblzma: Remove unneeded semicolon. 2011-06-16 12:16:05 +03:00
Lasse Collin 631f4d3ae6 Don't call close(-1) in tuklib_open_stdxxx() on error.
Thanks to Jim Meyering.
2011-05-28 18:54:42 +03:00
Lasse Collin c89faf4c9e Translations: Update Italian translation.
Thanks to Milo Casagrande.
2011-05-28 09:47:56 +03:00
Lasse Collin 6fe2fc9b6a Tests: Add a test file for the bug in the previous commit. 2011-05-28 09:44:18 +03:00
Lasse Collin 6c4d4db2bc xz: Fix error handling in xz -lvv.
It could do an invalid free() and read past the end
of the uninitialized filters array.
2011-05-28 09:44:12 +03:00
Lasse Collin 844f84fcad liblzma: Handle allocation failures correctly in lzma_index_init().
Thanks to Jim Meyering.
2011-05-28 09:44:07 +03:00
Lasse Collin 240e8b9791 Build: Set GZIP_ENV=-9n in top-level Makefile.am. 2011-05-23 18:30:51 +03:00
Lasse Collin e32cb264ea Bump version and soname for 5.0.3. 2011-05-21 16:59:22 +03:00
Lasse Collin 65cff45f8f Update NEWS for 5.0.3. 2011-05-21 16:56:53 +03:00
Lasse Collin 316c67ffda Add French translation.
It is known that the BCJ filter --help text is only
partially translated.
2011-05-21 16:29:11 +03:00
Lasse Collin 1931175eea xz: Translate also the string used to print the program name.
French needs a space before a colon, e.g. "xz : foo error".
2011-05-21 15:12:43 +03:00
Lasse Collin 841dc1f891 Update THANKS. 2011-05-17 12:28:18 +03:00
Lasse Collin 0f7e2d3624 Update INSTALL with a note about linker problem on OpenSolaris x86. 2011-05-17 12:28:14 +03:00
Lasse Collin 793d857e01 Build: Fix initialization of enable_check_* variables in configure.ac.
This doesn't matter much in practice since it is unlikely
that anyone would have such environment variable names.

Thanks to Wim Lewis.
2011-05-17 12:28:07 +03:00
Lasse Collin afcff45cee Add underscores to attributes (__attribute((__foo__))). 2011-05-17 12:27:22 +03:00
Lasse Collin 22159c6ba2 Update THANKS. 2011-04-18 19:36:21 +03:00
Martin Väth 5e34990595 xzgrep: fix typo in $0 parsing
Reported-by: Diego Elio Pettenò <flameeyes@gentoo.org>
Signed-off-by: Martin Väth <vaeth@mathematik.uni-wuerzburg.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-18 19:36:14 +03:00
Lasse Collin 1125611b9b Remove doubled words from documentation and comments.
Spot candidates by running these commands:
  git ls-files |xargs perl -0777 -n \
    -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims)' \
    -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g; print "$ARGV:$n:$v\n"}'

Thanks to Jim Meyering for the original patch.
2011-04-12 12:03:31 +03:00
Lasse Collin 3f8fa53837 liblzma: Document lzma_easy_(enc|dec)oder_memusage() better too. 2011-04-11 21:04:24 +03:00
Lasse Collin 320d734c20 liblzma: Document lzma_raw_(enc|dec)oder_memusage() better.
It didn't mention the return value that is used if
an error occurs.
2011-04-11 20:59:20 +03:00
Lasse Collin 2ee4edeffc liblzma: Don't create an empty Block in lzma_stream_buffer_encode().
Empty Block was created if the input buffer was empty.
Empty Block wastes a few bytes of space, but more importantly
it triggers a bug in XZ Utils 5.0.1 and older when trying
to decompress such a file. 5.0.1 and older consider such
files to be corrupt. I thought that no encoder creates empty
Blocks when releasing 5.0.2 but I was wrong.
2011-04-11 14:00:55 +03:00
Lasse Collin 73f56fb87d liblzma: Fix API docs to mention LZMA_UNSUPPORTED_CHECK.
This return value was missing from the API comments of
four functions.
2011-04-11 14:00:50 +03:00
Lasse Collin 4ce1cf97a8 liblzma: Validate encoder arguments better.
The biggest problem was that the integrity check type
wasn't validated, and e.g. lzma_easy_buffer_encode()
would create a corrupt .xz Stream if given an unsupported
Check ID. Luckily applications don't usually try to use
an unsupport Check ID, so this bug is unlikely to cause
many real-world problems.
2011-04-11 14:00:46 +03:00
Lasse Collin 972f05d7a4 Update THANKS. 2011-04-09 18:30:59 +03:00
Lasse Collin 28154eeaf6 liblzma: Add missing #ifdefs to filter_common.c.
Passing --disable-decoders to configure broke a few
encoders due to missing #ifdefs in filter_common.c.

Thanks to Jason Gorski for the patch.
2011-04-09 18:30:53 +03:00
Lasse Collin aa95516d3d liblzma: Fix a memory leak in stream_encoder.c.
It leaks old filter options structures (hundred bytes or so)
every time the lzma_stream is reinitialized. With the xz tool,
this happens when compressing multiple files.
2011-04-05 15:27:48 +03:00
Lasse Collin 58f52c72f4 Bumped version and liblzma soname to 5.0.2. 2011-04-01 08:47:46 +03:00
Lasse Collin 162779682e Updated NEWS for 5.0.2. 2011-04-01 08:47:20 +03:00
Lasse Collin 45553f9b4b Update INSTALL with another note about IRIX. 2011-03-31 15:07:08 +03:00
Lasse Collin af9d48d551 Tests: Add a new file to test empty LZMA2 streams. 2011-03-31 13:08:10 +03:00
Lasse Collin d099ef9f51 liblzma: Fix decoding of LZMA2 streams having no uncompressed data.
The decoder considered empty LZMA2 streams to be corrupt.
This shouldn't matter much with .xz files, because no encoder
creates empty LZMA2 streams in .xz. This bug is more likely
to cause problems in applications that use raw LZMA2 streams.
2011-03-31 13:08:05 +03:00
Lasse Collin df87249b26 Scripts: Better fix for xzgrep.
Now it uses "grep -q".

Thanks to Gregory Margo.
2011-03-24 01:43:23 +02:00
Lasse Collin 68c453e1c7 Updated THANKS. 2011-03-24 01:24:16 +02:00
Lasse Collin b441d39855 Scripts: Fix xzgrep -l.
It didn't work at all. It tried to use the -q option
for grep, but it appended it after "--". This works
around it by redirecting to /dev/null. The downside
is that this can be slower with big files compared
to proper use of "grep -q".

Thanks to Gregory Margo.
2011-03-24 01:24:12 +02:00
Lasse Collin 82d5164839 xz: Clean up suffix.c.
struct suffix_pair isn't needed in compresed_name()
so get rid of it there.
2011-02-04 22:49:31 +02:00
Lasse Collin 6decc8b418 xz: Check if the file already has custom suffix when compressing.
Now "xz -S .test foo.test" refuses to compress the
file because it already has the suffix .test. The man
page had it documented this way already.
2011-02-04 11:29:47 +02:00
Lasse Collin ecda90061d Updated THANKS. 2011-02-02 23:01:51 +02:00
Lasse Collin 0fda1ae5b1 Translations: Add Polish translation.
Thanks to Jakub Bogusz.
2011-02-02 23:00:33 +02:00
Lasse Collin 00be32978f Updated THANKS. 2011-02-02 22:24:00 +02:00
Lasse Collin 7232fcf96b Bump package version and liblzma soname to 5.0.1. 2011-01-28 20:26:38 +02:00
449 changed files with 11414 additions and 93709 deletions

View File

@ -1,24 +0,0 @@
[codespell]
# Skip all translation files and a few other autogenerated files.
# The autotool files should have their typos fixed in the upstream, but
# until then we will blacklist them here.
skip = *.po,*.pot,./po4a/man,./doc/api,./configure,./autom4te.cache,./m4/libtool.m4,./build-aux/depcomp,./build-aux/ltmain.sh,./build-aux/config.guess,./build-aux/config.rpath,./m4/po.m4,./build-aux/config.sub
# Ignore false positive matching words. Ideally codespell would allow
# ignoring words for specific files, but that does not appear to be
# supported. Instead we need to hope we do not make these typos.
# Additionally, the ignored words must be specified lower-case even though
# some of the false positives only occurred upper-case.
# ANS - used as a variable name in xzmore.in.
# bu - groff syntax for creating a bullet list item, used in xz.1.
# te - groff syntax, used in xz.1.
# caf - command line options for tar example, used in xz.1.
ignore-words-list = ans,bu,te,caf
# Add extra dictionaries to help improvement comments, docs, etc.
builtin = clear,rare,informal,usage,names
# Always default to highest interactive level to avoid accidentally
# changing a false positive or picking the wrong replacement.
interactive = 3

23
.github/SECURITY.md vendored
View File

@ -1,23 +0,0 @@
# Security Policy
## Supported Versions
We provide security updates to the development branch and the stable
branches. Security patches for old releases are available on the
[project website](https://xz.tukaani.org/xz-utils/).
## Reporting a Vulnerability
If you discover a security vulnerability in this project, please
report it privately. **Do not disclose it as a public issue.** This gives
us time to work with you to fix the issue before public exposure, reducing
the chance that the exploit will be used before a patch is released.
You may submit a report by emailing us at
[xz@tukaani.org](mailto:xz@tukaani.org), or through
[Security Advisories](https://github.com/tukaani-project/xz/security/advisories/new).
While both options are available, we prefer email.
This project is maintained by a team of volunteers on a reasonable-effort
basis. As such, please give us 90 days to work on a fix before
public exposure.

View File

@ -1,160 +0,0 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# Author: Jia Tan
#
#############################################################################
name: CI
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows running workflow manually
workflow_dispatch:
jobs:
POSIX:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
build_system: [autotools, cmake]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
########################
# Install Dependencies #
########################
# Install Autotools on Linux
- name: Install Dependencies
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential po4a autopoint gcc-multilib doxygen musl-tools
# Install Autotools on Mac
- name: Install Dependencies
if: ${{ matrix.os == 'macos-latest' && matrix.build_system == 'autotools' }}
run: brew install autoconf automake libtool po4a doxygen
# Install CMake on Linux
- name: Install Dependencies
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'cmake' }}
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake musl-tools
# Install CMake on Mac
- name: Install Dependencies
if: ${{ matrix.os == 'macos-latest' && matrix.build_system == 'cmake' }}
run: brew install cmake
##################
# Build and Test #
##################
# -b specifies the build system to use.
# -p specifies the phase (build or test) to help narrow down an error
# if one occurs.
#
# The first two builds/tests are only run on Autotools Linux and
# affect the CFLAGS. Resetting the CFLAGS requires clearing the
# config cache between runs, so the tests that require CFLAGS are
# done first.
- name: Build 32-bit
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
run: ./build-aux/ci_build.sh -b autotools -p build -f "-m32"
- name: Test 32-bit
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
run: |
./build-aux/ci_build.sh -b autotools -p test -f "-m32" -n 32_bit
cd ../xz_build && make distclean
# ifunc must be disabled for this test because __attribute__ ifunc is
# incompatible with -fsanitize=address.
#
# The sandbox must also be disabled because it will prevent access to
# the /proc/ filesystem on Linux, which is used by the sanitizer's
# instrumentation.
- name: Build with -fsanitize=address,undefined
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
run: ./build-aux/ci_build.sh -b autotools -p build -f "-fsanitize=address,undefined" -d ifunc,sandbox
- name: Test with -fsanitize=address,undefined
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
run: |
./build-aux/ci_build.sh -b autotools -p test -f "-fsanitize=address,undefined" -d ifunc,sandbox
cd ../xz_build && make distclean
# musl libc has some slight differences compared to glibc, including
# the lack of ifunc support. This tests if the ifunc detection
# functions properly since musl-gcc can compile with ifunc support,
# but will fail at runtime.
- name: Build with musl libc
if: ${{ matrix.os == 'ubuntu-latest'}}
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -p build -m "/usr/bin/musl-gcc"
- name: Test with musl libc
if: ${{ matrix.os == 'ubuntu-latest'}}
run: |
./build-aux/ci_build.sh -b ${{ matrix.build_system }} -p test -m "/usr/bin/musl-gcc"
- name: Clean up musl libc run
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
run: cd ../xz_build && make distclean
- name: Build with full features
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -p build
- name: Test with full features
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -p test -n full_features
- name: Build without encoders
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d encoders,shared -p build
- name: Test without encoders
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d encoders,shared -p test -n no_encoders
- name: Build without decoders
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d decoders,shared -p build
- name: Test without decoders
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d decoders,shared -p test -n no_decoders
- name: Build without threads
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d threads,shared -p build
- name: Test without threads
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d threads,shared -p test -n no_threads
- name: Build without BCJ filters
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d bcj,shared,nls -p build
- name: Test without BCJ filters
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d bcj,shared,nls -p test -n no_bcj
- name: Build without Delta filters
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d delta,shared,nls -p build
- name: Test without Delta filters
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d delta,shared,nls -p test -n no_delta
- name: Build without sha256 check
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -c crc32,crc64 -d shared,nls -p build
- name: Test without sha256 check
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -c crc32,crc64 -d shared,nls -p test -n no_sha256
- name: Build without crc64 check
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -c crc32,sha256 -d shared,nls -p build
- name: Test without crc64 check
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -c crc32,sha256 -d shared,nls -p test -n no_crc64
- name: Build small
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d small -p build
- name: Test small
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d small -p test -n small
# Attempt to upload the test logs as artifacts if any step has failed
- uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4.0.0
if: ${{ failure() }}
with:
name: ${{ matrix.os }} ${{ matrix.build_system }} Test Logs
path: build-aux/artifacts

View File

@ -1,124 +0,0 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# Author: Jia Tan
#
#############################################################################
name: Windows-CI
# Only run the Windows CI manually since it takes much longer than the others.
on: workflow_dispatch
jobs:
POSIX:
strategy:
matrix:
# Test different environments since the code may change between
# them and we want to ensure that we support all potential users.
# clang64 builds are currently broken when building static libraries
# due to a bug in ldd search path:
# https://github.com/llvm/llvm-project/issues/67779
# TODO - re-enable clang64 when this is resolved.
msys2_env: [mingw64, mingw32, ucrt64, msys]
build_system: [autotools, cmake]
# Set the shell to be msys2 as a default to avoid setting it for
# every individual run command.
defaults:
run:
shell: msys2 {0}
runs-on: windows-latest
steps:
#####################
# Setup Environment #
#####################
# Rely on the msys2 GitHub Action to set up the msys2 environment.
- name: Setup MSYS2
uses: msys2/setup-msys2@27b3aa77f672cb6b3054121cfd80c3d22ceebb1d #v2.20.1
with:
msystem: ${{ matrix.msys2_env }}
update: true
install: pactoys make
- name: Checkout code
# Need to explicitly set the shell here since we set the default
# shell as msys2 earlier. This avoids an extra msys2 dependency on
# git.
shell: powershell
# Avoid Windows line endings. Otherwise test_scripts.sh will fail
# because the expected output is stored in the test framework as a
# text file and will not match the output from xzgrep.
run: git config --global core.autocrlf false
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
########################
# Install Dependencies #
########################
# The pacman repository has a different naming scheme for default
# msys packages than the others. The pacboy tool allows installing
# the packages possible in matrix setup without a burdensome amount
# of ifs.
- name: Install Dependencies
if: ${{ matrix.msys2_env == 'msys' && matrix.build_system == 'autotools' }}
run: pacman --noconfirm -S --needed autotools base-devel doxygen gettext-devel gcc
- name: Install Dependencies
if: ${{ matrix.msys2_env != 'msys' && matrix.build_system == 'autotools' }}
run: pacboy --noconfirm -S --needed autotools:p toolchain:p doxygen:p
- name: Install Dependencies
if: ${{ matrix.msys2_env == 'msys' && matrix.build_system == 'cmake' }}
run: pacman --noconfirm -S --needed cmake base-devel gcc
- name: Install Dependencies
if: ${{ matrix.msys2_env != 'msys' && matrix.build_system == 'cmake' }}
run: pacboy --noconfirm -S --needed cmake:p toolchain:p
##################
# Build and Test #
##################
- name: Build with full features
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -p build
- name: Test with full features
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -p test -n full_features
- name: Build without threads
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d threads,shared -p build
- name: Test without threads
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d threads,shared -p test -n no_threads
- name: Build without encoders
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d encoders,shared -p build
- name: Test without encoders
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d encoders,shared -p test -n no_encoders
- name: Build without decoders
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d decoders,shared -p build
- name: Test without decoders
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d decoders,shared -p test -n no_decoders
- name: Build with only crc32 check
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -c crc32 -d shared,nls -p build
- name: Test with only crc32 check
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -c crc32 -d shared,nls -p test -n crc32_only
###############
# Upload Logs #
###############
# Upload the test logs as artifacts if any step has failed.
- uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4.0.0
if: ${{ failure() }}
with:
name: ${{ matrix.msys2_env }} ${{ matrix.build_system }} Test Logs
path: build-aux/artifacts

50
.gitignore vendored
View File

@ -1,13 +1,9 @@
*~ *~
*.bak *.bak
*.bak[0-9] *.bak[0-9]
.gdb_history
.deps .deps
.libs .libs
*.a
*.gcda
*.gcno
*.la *.la
*.lo *.lo
*.o *.o
@ -25,7 +21,6 @@ Makefile.in
/libtool /libtool
/stamp-h1 /stamp-h1
build-aux/artifacts
build-aux/compile build-aux/compile
build-aux/config.guess build-aux/config.guess
build-aux/config.rpath build-aux/config.rpath
@ -34,12 +29,6 @@ build-aux/depcomp
build-aux/install-sh build-aux/install-sh
build-aux/ltmain.sh build-aux/ltmain.sh
build-aux/missing build-aux/missing
build-aux/test-driver
coverage
/doc/internal
/doc/api
/src/liblzma/liblzma.pc /src/liblzma/liblzma.pc
/src/lzmainfo/lzmainfo /src/lzmainfo/lzmainfo
@ -52,28 +41,15 @@ coverage
/src/scripts/xzless /src/scripts/xzless
/src/scripts/xzmore /src/scripts/xzmore
/tests/*.log
/tests/*.trs
/tests/compress_generated_abc /tests/compress_generated_abc
/tests/compress_generated_random /tests/compress_generated_random
/tests/compress_generated_text /tests/compress_generated_text
/tests/create_compress_files /tests/create_compress_files
/tests/test_bcj_exact_size
/tests/test_block_header /tests/test_block_header
/tests/test_check /tests/test_check
/tests/test_filter_flags /tests/test_filter_flags
/tests/test_filter_str
/tests/test_hardware
/tests/test_index /tests/test_index
/tests/test_index_hash
/tests/test_lzip_decoder
/tests/test_microlzma
/tests/test_memlimit
/tests/test_stream_flags /tests/test_stream_flags
/tests/test_vli
/tests/xzgrep_test_1.xz
/tests/xzgrep_test_2.xz
/tests/xzgrep_test_output
/lib/Makefile /lib/Makefile
/tests/Makefile /tests/Makefile
@ -86,29 +62,3 @@ coverage
/src/liblzma/api/Makefile /src/liblzma/api/Makefile
/src/lzmainfo/Makefile /src/lzmainfo/Makefile
/src/xzdec/Makefile /src/xzdec/Makefile
/CMakeCache.txt
/CMakeFiles
/CTestTestfile.cmake
/cmake_install.cmake
/DartConfiguration.tcl
/liblzma-config-version.cmake
/liblzma-config.cmake
/lzcat
/lzcat.1
/lzma
/lzma.1
/Testing
/tests_bin/
/unlzma
/unlzma.1
/unxz
/unxz.1
/xz
/xzcat
/xzcat.1
/xzdec
/windows/*/.vs
/windows/*/liblzma.vcxproj.user
/.vscode/

54
AUTHORS
View File

@ -3,51 +3,25 @@ Authors of XZ Utils
=================== ===================
XZ Utils is developed and maintained by Lasse Collin XZ Utils is developed and maintained by Lasse Collin
<lasse.collin@tukaani.org> and Jia Tan <jiat0218@gmail.com>. <lasse.collin@tukaani.org>.
Major parts of liblzma are based on code written by Igor Pavlov, Major parts of liblzma are based on code written by Igor Pavlov,
specifically the LZMA SDK <https://7-zip.org/sdk.html>. Without specifically the LZMA SDK <http://7-zip.org/sdk.html>. Without
this code, XZ Utils wouldn't exist. this code, XZ Utils wouldn't exist.
The SHA-256 implementation in liblzma is based on code written by The SHA-256 implementation in liblzma is based on the code found from
Wei Dai in Crypto++ Library <https://www.cryptopp.com/>. 7-Zip <http://7-zip.org/>, which has a modified version of the SHA-256
code found from Crypto++ <http://www.cryptopp.com/>. The SHA-256 code
in Crypto++ was written by Kevin Springle and Wei Dai.
A few scripts have been adapted from GNU gzip. The original Some scripts have been adapted from gzip. The original versions
versions were written by Jean-loup Gailly, Charles Levert, and were written by Jean-loup Gailly, Charles Levert, and Paul Eggert.
Paul Eggert. Andrew Dudman helped adapting the scripts and their Andrew Dudman helped adapting the scripts and their man pages for
man pages for XZ Utils. XZ Utils.
The initial version of the threaded .xz decompressor was written The GNU Autotools-based build system contains files from many authors,
by Sebastian Andrzej Siewior. which I'm not trying to list here.
The initial version of the .lz (lzip) decoder was written Several people have contributed fixes or reported bugs. Most of them
by Michał Górny. are mentioned in the file THANKS.
Architecture-specific CRC optimizations were contributed by
Ilya Kurdyukov, Hans Jansen, and Chenxi Mao.
Other authors:
- Jonathan Nieder
- Joachim Henke
Many people have contributed improvements or reported bugs.
Most of these people are mentioned in the file THANKS.
The translations of the command line tools and man pages have been
contributed by many people via the Translation Project:
- https://translationproject.org/domain/xz.html
- https://translationproject.org/domain/xz-man.html
The authors of the translated man pages are in the header comments
of the man page files. In the source package, the authors of the
translations are in po/*.po and po4a/*.po files.
Third-party code whose authors aren't listed here:
- GNU getopt_long() in the 'lib' directory is included for
platforms that don't have a usable getopt_long().
- The build system files from GNU Autoconf, GNU Automake,
GNU Libtool, GNU Gettext, Autoconf Archive, and related files.

File diff suppressed because it is too large Load Diff

105
COPYING
View File

@ -6,95 +6,60 @@ XZ Utils Licensing
is a rough summary of which licenses apply to which parts of this is a rough summary of which licenses apply to which parts of this
package (but check the individual files to be sure!): package (but check the individual files to be sure!):
- liblzma is under the BSD Zero Clause License (0BSD). - liblzma is in the public domain.
- The command line tools xz, xzdec, lzmadec, and lzmainfo are - xz, xzdec, and lzmadec command line tools are in the public
under 0BSD except that, on systems that don't have a usable domain unless GNU getopt_long had to be compiled and linked
getopt_long, GNU getopt_long is compiled and linked in from the in from the lib directory. The getopt_long code is under
'lib' directory. The getopt_long code is under GNU LGPLv2.1+. GNU LGPLv2.1+.
- The scripts to grep, diff, and view compressed files have been - The scripts to grep, diff, and view compressed files have been
adapted from GNU gzip. These scripts (xzgrep, xzdiff, xzless, adapted from gzip. These scripts and their documentation are
and xzmore) are under GNU GPLv2+. The man pages of the scripts under GNU GPLv2+.
are under 0BSD; they aren't based on the man pages of GNU gzip.
- Most of the XZ Utils specific documentation that is in - All the documentation in the doc directory and most of the
plain text files (like README, INSTALL, PACKAGERS, NEWS, XZ Utils specific documentation files in other directories
and ChangeLog) are under 0BSD unless stated otherwise in are in the public domain.
the file itself. The files xz-file-format.txt and
lzma-file-format.xt are in the public domain but may
be distributed under the terms of 0BSD too.
- Doxygen-generated HTML version of the liblzma API documentation: - Translated messages are in the public domain.
While Doxygen is under the GNU GPLv2, the license information
in Doxygen includes the following exception:
Documents produced by doxygen are derivative works - The build system contains public domain files, and files that
derived from the input used in their production; are under GNU GPLv2+ or GNU GPLv3+. None of these files end up
they are not affected by this license. in the binaries being built.
Note: The JavaScript files (under the MIT license) have - Test files and test code in the tests directory, and debugging
been removed from the Doxygen output. utilities in the debug directory are in the public domain.
- The XZ logo (xz-logo.png) included in the Doxygen-generated - The extra directory may contain public domain files, and files
documentation is under the Creative Commons BY-SA 4.0 license. that are under various free software licenses.
- Translated messages and man pages are under 0BSD except that You can do whatever you want with the files that have been put into
some old translations are in the public domain. the public domain. If you find public domain legally problematic,
take the previous sentence as a license grant. If you still find
the lack of copyright legally problematic, you have too many
lawyers.
- Test files and test code in the 'tests' directory, and As usual, this software is provided "as is", without any warranty.
debugging utilities in the 'debug' directory are under
the BSD Zero Clause License (0BSD).
- The GNU Autotools based build system contains files that are If you copy significant amounts of public domain code from XZ Utils
under GNU GPLv2+, GNU GPLv3+, and a few permissive licenses.
These files don't affect the licensing of the binaries being
built.
- The extra directory contain files that are under various
free software licenses.
For the files under the BSD Zero Clause License (0BSD), if
a copyright notice is needed, the following is sufficient:
Copyright (C) The XZ Utils authors and contributors
If you copy significant amounts of 0BSD-licensed code from XZ Utils
into your project, acknowledging this somewhere in your software is into your project, acknowledging this somewhere in your software is
polite (especially if it is proprietary, non-free software), but polite (especially if it is proprietary, non-free software), but
it is not legally required by the license terms. Here is an example naturally it is not legally required. Here is an example of a good
of a good notice to put into "about box" or into documentation: notice to put into "about box" or into documentation:
This software includes code from XZ Utils This software includes code from XZ Utils <http://tukaani.org/xz/>.
<https://xz.tukaani.org/xz-utils/>.
The following license texts are included in the following files: The following license texts are included in the following files:
- COPYING.0BSD: BSD Zero Clause License
- COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1 - COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1
- COPYING.GPLv2: GNU General Public License version 2 - COPYING.GPLv2: GNU General Public License version 2
- COPYING.GPLv3: GNU General Public License version 3 - COPYING.GPLv3: GNU General Public License version 3
- COPYING.CC-BY-SA-4.0: Creative Commons Attribution-ShareAlike 4.0
International Public License
A note about old XZ Utils releases: Note that the toolchain (compiler, linker etc.) may add some code
pieces that are copyrighted. Thus, it is possible that e.g. liblzma
binary wouldn't actually be in the public domain in its entirety
even though it contains no copyrighted code from the XZ Utils source
package.
XZ Utils releases 5.4.6 and older and 5.5.1alpha have a If you have questions, don't hesitate to ask the author(s) for more
significant amount of code put into the public domain and information.
that obviously remains so. The switch from public domain to
0BSD for newer releases was made in Febrary 2024 because
public domain has (real or perceived) legal ambiguities in
some jurisdictions.
There is very little *practical* difference between public
domain and 0BSD. The main difference likely is that one
shouldn't claim that 0BSD-licensed code is in the public
domain; 0BSD-licensed code is copyrighted but available under
an extremely permissive license. Neither 0BSD nor public domain
require retaining or reproducing author, copyright holder, or
license notices when distributing the software. (Compare to,
for example, BSD 2-Clause "Simplified" License which does have
such requirements.)
If you have questions, don't hesitate to ask for more information.
The contact information is in the README file.

View File

@ -1,11 +0,0 @@
Permission to use, copy, modify, and/or distribute this
software for any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@ -1,427 +0,0 @@
Attribution-ShareAlike 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution-ShareAlike 4.0 International Public
License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-ShareAlike 4.0 International Public License ("Public
License"). To the extent this Public License may be interpreted as a
contract, You are granted the Licensed Rights in consideration of Your
acceptance of these terms and conditions, and the Licensor grants You
such rights in consideration of benefits the Licensor receives from
making the Licensed Material available under these terms and
conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. BY-SA Compatible License means a license listed at
creativecommons.org/compatiblelicenses, approved by Creative
Commons as essentially the equivalent of this Public License.
d. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
e. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
f. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
g. License Elements means the license attributes listed in the name
of a Creative Commons Public License. The License Elements of this
Public License are Attribution and ShareAlike.
h. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
i. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
j. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
k. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
l. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
m. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. Additional offer from the Licensor -- Adapted Material.
Every recipient of Adapted Material from You
automatically receives an offer from the Licensor to
exercise the Licensed Rights in the Adapted Material
under the conditions of the Adapter's License You apply.
c. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
b. ShareAlike.
In addition to the conditions in Section 3(a), if You Share
Adapted Material You produce, the following conditions also apply.
1. The Adapter's License You apply must be a Creative Commons
license with the same License Elements, this version or
later, or a BY-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the
Adapter's License You apply. You may satisfy this condition
in any reasonable manner based on the medium, means, and
context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms
or conditions on, or apply any Effective Technological
Measures to, Adapted Material that restrict exercise of the
rights granted under the Adapter's License You apply.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material,
including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.

View File

@ -1,12 +1,12 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 2, June 1991 Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
Preamble Preamble
The licenses for most software are designed to take away your The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public freedom to share and change it. By contrast, the GNU General Public
@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and The precise terms and conditions for copying, distribution and
modification follow. modification follow.
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains 0. This License applies to any program or other work which contains
@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally. of promoting the sharing and reuse of software generally.
NO WARRANTY NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it possible use to the public, the best way to achieve this is to make it

View File

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007 Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school, You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary. if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>. <http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>. <http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -1,5 +1,5 @@
GNU LESSER GENERAL PUBLIC LICENSE GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999 Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc. Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@ -10,7 +10,7 @@
as the successor of the GNU Library Public License, version 2, hence as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.] the version number 2.1.]
Preamble Preamble
The licenses for most software are designed to take away your The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public freedom to share and change it. By contrast, the GNU General Public
@ -112,7 +112,7 @@ modification follow. Pay close attention to the difference between a
former contains code derived from the library, whereas the latter must former contains code derived from the library, whereas the latter must
be combined with the library in order to run. be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other 0. This License Agreement applies to any software library or other
@ -432,7 +432,7 @@ decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing of all derivatives of our free software and of promoting the sharing
and reuse of software generally. and reuse of software generally.
NO WARRANTY NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
@ -455,7 +455,7 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES. DAMAGES.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries How to Apply These Terms to Your New Libraries
@ -500,3 +500,5 @@ necessary. Here is a sample; alter the names:
Ty Coon, President of Vice Ty Coon, President of Vice
That's all there is to it! That's all there is to it!

View File

@ -1,6 +1,6 @@
See the commit log in the git repository: See the commit log in the git repository:
git clone https://github.com/tukaani-project/xz git clone http://git.tukaani.org/xz.git
Note that "make dist" doesn't put this tiny file into the package. Note that "make dist" doesn't put this tiny file into the package.
Instead, the git commit log is used as ChangeLog. See dist-hook in Instead, the git commit log is used as ChangeLog. See dist-hook in

1234
Doxyfile.in Normal file

File diff suppressed because it is too large Load Diff

495
INSTALL
View File

@ -14,7 +14,6 @@ XZ Utils Installation
1.2.6. Tru64 1.2.6. Tru64
1.2.7. Windows 1.2.7. Windows
1.2.8. DOS 1.2.8. DOS
1.2.9. z/OS
1.3. Adding support for new platforms 1.3. Adding support for new platforms
2. configure options 2. configure options
2.1. Static vs. dynamic linking of liblzma 2.1. Static vs. dynamic linking of liblzma
@ -22,16 +21,13 @@ XZ Utils Installation
3. xzgrep and other scripts 3. xzgrep and other scripts
3.1. Dependencies 3.1. Dependencies
3.2. PATH 3.2. PATH
4. Tests 4. Troubleshooting
4.1 Testing in parallel 4.1. "No C99 compiler was found."
4.2 Cross compiling 4.2. "No POSIX conforming shell (sh) was found."
5. Troubleshooting 4.3. configure works but build fails at crc32_x86.S
5.1. "No C99 compiler was found." 4.4. Lots of warnings about symbol visibility
5.2. "No POSIX conforming shell (sh) was found." 4.5. "make check" fails
5.3. configure works but build fails at crc32_x86.S 4.6. liblzma.so (or similar) not found when running xz
5.4. Lots of warnings about symbol visibility
5.5. "make check" fails
5.6. liblzma.so (or similar) not found when running xz
0. Preface 0. Preface
@ -103,7 +99,7 @@ XZ Utils Installation
XZ Utils doesn't have code to detect the amount of physical RAM and XZ Utils doesn't have code to detect the amount of physical RAM and
number of CPU cores on MINIX 3. number of CPU cores on MINIX 3.
See section 5.4 in this file about symbol visibility warnings (you See section 4.4 in this file about symbol visibility warnings (you
may want to pass gl_cv_cc_visibility=no to configure). may want to pass gl_cv_cc_visibility=no to configure).
@ -126,83 +122,42 @@ XZ Utils Installation
This can be worked around by passing gl_cv_cc_visibility=no This can be worked around by passing gl_cv_cc_visibility=no
as an argument to the configure script. as an argument to the configure script.
test_scripts.sh in "make check" may fail if good enough tools are
missing from PATH (/usr/xpg4/bin or /usr/xpg6/bin). Nowadays
/usr/xpg4/bin is added to the script PATH by default on Solaris
(see --enable-path-for-scripts=PREFIX in section 2), but old xz
releases needed extra steps. See sections 5.5 and 3.2 for more
information.
1.2.6. Tru64 1.2.6. Tru64
If you try to use the native C compiler on Tru64 (passing CC=cc to If you try to use the native C compiler on Tru64 (passing CC=cc to
configure), you may need the workaround mention in section 5.1 in configure), you may need the workaround mention in section 4.1 in
this file (pass also ac_cv_prog_cc_c99= to configure). this file (pass also ac_cv_prog_cc_c99= to configure).
1.2.7. Windows 1.2.7. Windows
The "windows" directory contains instructions for a few types Building XZ Utils on Windows is supported under MinGW + MSYS,
of builds: MinGW-w64 + MSYS, and Cygwin. There is windows/build.bash to
ease packaging XZ Utils with MinGW(-w64) + MSYS into a
redistributable .zip or .7z file. See windows/INSTALL-Windows.txt
for more information.
- INSTALL-MinGW-w64_with_CMake.txt It might be possible to build liblzma with a non-GNU toolchain too,
Simple instructions how to build XZ Utils natively on but that will probably require writing a separate makefile. Building
Windows using only CMake and a prebuilt toolchain the command line tools with non-GNU toolchains will be harder than
(GCC + MinGW-w64 or Clang/LLVM + MinGW-w64). building only liblzma.
- INSTALL-MinGW-w64_with_Autotools.txt Even if liblzma is built with MinGW, the resulting DLL or static
Native build under MSYS2 or cross-compilation from library can be used by other compilers and linkers, including MSVC.
GNU/Linux using a bash script that creates a .zip Thus, it shouldn't be a problem to use MinGW to build liblzma even
and .7z archives of the binaries and documentation. if you cannot use MinGW to build the rest of your project. See
The related file README-Windows.txt is for the windows/README-Windows.txt for details.
resulting binary package.
- INSTALL-MSVC.txt
Building with MSVC / Visual Studio and CMake.
- liblzma-crt-mixing.txt
Documentation what to take into account as a programmer
if liblzma.dll and the application don't use the same
CRT (MSVCRT or UCRT).
Other choices:
- Cygwin: https://cygwin.com/
Building on Cygwin can be done like on many POSIX operating
systems. XZ Utils >= 5.2.0 isn't compatible with Cygwin older
than 1.7.35 (data loss!). 1.7.35 was released on 2015-03-04.
- MSYS2: https://www.msys2.org/
1.2.8. DOS 1.2.8. DOS
There is a Makefile in the "dos" directory to build XZ Utils on There is an experimental Makefile in the "dos" directory to build
DOS using DJGPP. Support for long file names (LFN) is needed at XZ Utils on DOS using DJGPP. Support for long file names (LFN) is
build time but the resulting xz.exe works without LFN support too. needed. See dos/README for more information.
See dos/INSTALL.txt and dos/README.txt for more information.
GNU Autotools based build hasn't been tried on DOS. If you try, I
1.2.9. z/OS would like to hear if it worked.
To build XZ Utils on z/OS UNIX System Services using xlc, pass
these options to the configure script: CC='xlc -qhaltonmsg=CCN3296'
CPPFLAS='-D_UNIX03_THREADS -D_XOPEN_SOURCE=600'. The first makes
xlc throw an error if a header file is missing, which is required
to make the tests in configure work. The CPPFLAGS are needed to
get pthread support (some other CPPFLAGS may work too; if there
are problems, try -D_UNIX95_THREADS instead of -D_UNIX03_THREADS).
test_scripts.sh in "make check" will fail even if the scripts
actually work because the test data includes compressed files
with US-ASCII text.
No other tests should fail. If test_files.sh fails, check that
the included .xz test files weren't affected by EBCDIC conversion.
XZ Utils doesn't have code to detect the amount of physical RAM and
number of CPU cores on z/OS.
1.3. Adding support for new platforms 1.3. Adding support for new platforms
@ -275,54 +230,6 @@ XZ Utils Installation
the liblzma ABI, so this option should be used only when the liblzma ABI, so this option should be used only when
it is known to not cause problems. it is known to not cause problems.
--enable-external-sha256
Try to use SHA-256 code from the operating system libc
or similar base system libraries. This doesn't try to
use OpenSSL or libgcrypt or such libraries.
The reasons to use this option:
- It makes liblzma slightly smaller.
- It might improve SHA-256 speed if the implementation
in the operating is very good (but see below).
External SHA-256 is disabled by default for two reasons:
- On some operating systems the symbol names of the
SHA-256 functions conflict with OpenSSL's libcrypto.
This causes weird problems such as decompression
errors if an application is linked against both
liblzma and libcrypto. This problem affects at least
FreeBSD 10 and older and MINIX 3.3.0 and older, but
other OSes that provide a function "SHA256_Init" might
also be affected. FreeBSD 11 has the problem fixed.
NetBSD had the problem but it was fixed it in 2009
already. OpenBSD uses "SHA256Init" and thus never had
a conflict with libcrypto.
- The SHA-256 code in liblzma is faster than the SHA-256
code provided by some operating systems. If you are
curious, build two copies of xz (internal and external
SHA-256) and compare the decompression (xz --test)
times:
dd if=/dev/zero bs=1024k count=1024 \
| xz -v -0 -Csha256 > foo.xz
time xz --test foo.xz
--disable-microlzma
Don't build MicroLZMA encoder and decoder. This omits
lzma_microlzma_encoder() and lzma_microlzma_decoder()
API functions from liblzma. These functions are needed
by specific applications only. They were written for
erofs-utils but they may be used by others too.
--disable-lzip-decoder
Disable decompression support for .lz (lzip) files.
This omits the API function lzma_lzip_decoder() from
liblzma and .lz support from the xz tool.
--disable-xz --disable-xz
--disable-xzdec --disable-xzdec
--disable-lzmadec --disable-lzmadec
@ -353,102 +260,28 @@ XZ Utils Installation
with --docdir=DIR. with --docdir=DIR.
--disable-assembler --disable-assembler
This disables CRC32 and CRC64 assembly code on liblzma includes some assembler optimizations. Currently
32-bit x86. This option currently does nothing there is only assembler code for CRC32 and CRC64 for
on other architectures (not even on x86-64). 32-bit x86.
The 32-bit x86 assembly is position-independent code All the assembler code in liblzma is position-independent
which is suitable for use in shared libraries and code, which is suitable for use in shared libraries and
position-independent executables. It uses only i386 position-independent executables. So far only i386
instructions but the code is optimized for i686 class instructions are used, but the code is optimized for i686
CPUs. If you are compiling liblzma exclusively for class CPUs. If you are compiling liblzma exclusively for
pre-i686 systems, you may want to disable the assembler pre-i686 systems, you may want to disable the assembler
code. code.
--disable-clmul-crc
Disable the use of carryless multiplication for CRC
calculation even if compiler support for it is detected.
The code uses runtime detection of SSSE3, SSE4.1, and
CLMUL instructions on x86. On 32-bit x86 this currently
is used only if --disable-assembler is used (this might
be fixed in the future). The code works on E2K too.
If using compiler options that unconditionally allow the
required extensions (-msse4.1 -mpclmul) then runtime
detection isn't used and the generic code is omitted.
--disable-arm64-crc32
Disable the use of the ARM64 CRC32 instruction extension
even if compiler support for it is detected. The code will
detect support for the instruction at runtime.
If using compiler options that unconditionally allow the
required extensions (-march=armv8-a+crc or -march=armv8.1-a
and later) then runtime detection isn't used and the
generic code is omitted.
--enable-unaligned-access --enable-unaligned-access
Allow liblzma to use unaligned memory access for 16-bit, Allow liblzma to use unaligned memory access for 16-bit
32-bit, and 64-bit loads and stores. This should be and 32-bit loads and stores. This should be enabled only
enabled only when the hardware supports this, that is, when the hardware supports this, i.e. when unaligned
when unaligned access is fast. Some operating system access is fast. Some operating system kernels emulate
kernels emulate unaligned access, which is extremely unaligned access, which is extremely slow. This option
slow. This option shouldn't be used on systems that shouldn't be used on systems that rely on such emulation.
rely on such emulation.
Unaligned access is enabled by default on these: Unaligned access is enabled by default on x86, x86-64,
- 32-bit x86 and big endian PowerPC.
- 64-bit x86-64
- 32-bit big endian PowerPC
- 64-bit big endian PowerPC
- 64-bit little endian PowerPC
- some RISC-V [1]
- some 32-bit ARM [2]
- some 64-bit ARM64 [2] (NOTE: Autodetection bug
if using GCC -mstrict-align, see below.)
[1] Unaligned access is enabled by default if
configure sees that the C compiler
#defines __riscv_misaligned_fast.
[2] Unaligned access is enabled by default if
configure sees that the C compiler
#defines __ARM_FEATURE_UNALIGNED:
- ARMv7 + GCC or Clang: It works. The options
-munaligned-access and -mno-unaligned-access
affect this macro correctly.
- ARM64 + Clang: It works. The options
-munaligned-access, -mno-unaligned-access,
and -mstrict-align affect this macro correctly.
Clang >= 17 supports -mno-strict-align too.
- ARM64 + GCC: It partially works. The macro
is always #defined by GCC versions at least
up to 13.2, even when using -mstrict-align.
If building for strict-align ARM64, the
configure option --disable-unaligned-access
should be used if using a GCC version that has
this issue because otherwise the performance
may be degraded. It likely won't crash due to
how unaligned access is done in the C code.
--enable-unsafe-type-punning
This enables use of code like
uint8_t *buf8 = ...;
*(uint32_t *)buf8 = ...;
which violates strict aliasing rules and may result
in broken code. There should be no need to use this
option with recent GCC or Clang versions on any
arch as just as fast code can be generated in a safe
way too (using __builtin_assume_aligned + memcpy).
However, this option might improve performance in some
other cases, especially with old compilers (for example,
GCC 3 and early 4.x on x86, GCC < 6 on ARMv6 and ARMv7).
--enable-small --enable-small
Reduce the size of liblzma by selecting smaller but Reduce the size of liblzma by selecting smaller but
@ -482,124 +315,16 @@ XZ Utils Installation
the amount of RAM on the operating system you use. See the amount of RAM on the operating system you use. See
src/common/tuklib_physmem.c for details. src/common/tuklib_physmem.c for details.
--enable-threads=METHOD --disable-threads
Threading support is enabled by default so normally there Disable threading support. This makes some things
is no need to specify this option. thread-unsafe, meaning that if multithreaded application
calls liblzma functions from more than one thread,
something bad may happen.
Supported values for METHOD: Use this option if threading support causes you trouble,
or if you know that you will use liblzma only from
yes Autodetect the threading method. If none single-threaded applications and want to avoid dependency
is found, configure will give an error. on libpthread.
posix Use POSIX pthreads. This is the default
except on Windows outside Cygwin.
win95 Use Windows 95 compatible threads. This
is compatible with Windows XP and later
too. This is the default for 32-bit x86
Windows builds. Unless the compiler
supports __attribute__((__constructor__)),
the 'win95' threading is incompatible with
--enable-small.
vista Use Windows Vista compatible threads. The
resulting binaries won't run on Windows XP
or older. This is the default for Windows
excluding 32-bit x86 builds (that is, on
x86-64 the default is 'vista').
no Disable threading support. This is the
same as using --disable-threads.
NOTE: If combined with --enable-small
and the compiler doesn't support
__attribute__((__constructor__)), the
resulting liblzma won't be thread safe,
that is, if a multi-threaded application
calls any liblzma functions from more than
one thread, something bad may happen.
--enable-ifunc
Use __attribute__((__ifunc__())) in liblzma. This is
enabled by default on GNU/Linux and FreeBSD.
The ifunc attribute is incompatible with
-fsanitize=address. --disable-ifunc must be used
if any -fsanitize= option is specified in CFLAGS.
--enable-sandbox=METHOD
There is limited sandboxing support in the xz and xzdec
tools. If built with sandbox support, xz uses it
automatically when (de)compressing exactly one file to
standard output when the options --files or --files0 aren't
used. This is a common use case, for example,
(de)compressing .tar.xz files via GNU tar. The sandbox is
also used for single-file 'xz --test' or 'xz --list'.
xzdec always uses the sandbox, except when more than one
file are decompressed. In this case it will enable the
sandbox for the last file that is decompressed.
Supported METHODs:
auto Look for a supported sandboxing method
and use it if found. If no method is
found, then sandboxing isn't used.
This is the default.
no Disable sandboxing support.
capsicum
Use Capsicum (FreeBSD >= 10.2) for
sandboxing. If no Capsicum support
is found, configure will give an error.
pledge Use pledge(2) (OpenBSD >= 5.9) for
sandboxing. If pledge(2) isn't found,
configure will give an error.
landlock
Use Landlock (Linux >= 5.13) for
sandboxing. If no Landlock support
is found, configure will give an error.
--enable-symbol-versions[=VARIANT]
Use symbol versioning for liblzma shared library.
This is enabled by default on GNU/Linux (glibc only),
other GNU-based systems, and FreeBSD.
Symbol versioning is never used for static liblzma. This
option is ignored when not building a shared library.
Supported VARIANTs:
no Disable symbol versioning. This is the
same as using --disable-symbol-versions.
auto Autodetect between "no", "linux",
and "generic".
yes Autodetect between "linux" and
"generic". This forces symbol
versioning to be used when
building a shared library.
generic Generic version is the default for
FreeBSD and GNU/Linux on MicroBlaze.
This is also used on GNU/Linux when
building with NVIDIA HPC Compiler
because the compiler doesn't support
the features required for the "linux"
variant below.
linux Special version for GNU/Linux (glibc
only). This adds a few extra symbol
versions for compatibility with binaries
that have been linked against a liblzma
version that has been patched with
"xz-5.2.2-compat-libs.patch" from
RHEL/CentOS 7. That patch was used
by some build tools outside of
RHEL/CentOS 7 too.
--enable-debug --enable-debug
This enables the assert() macro and possibly some other This enables the assert() macro and possibly some other
@ -612,23 +337,6 @@ XZ Utils Installation
and should work on most systems. This has no effect on the and should work on most systems. This has no effect on the
resulting binaries. resulting binaries.
--enable-path-for-scripts=PREFIX
If PREFIX isn't empty, PATH=PREFIX:$PATH will be set in
the beginning of the scripts (xzgrep and others).
The default is empty except on Solaris the default is
/usr/xpg4/bin.
This can be useful if the default PATH doesn't contain
modern POSIX tools (as can be the case on Solaris) or if
one wants to ensure that the correct xz binary is in the
PATH for the scripts. Note that the latter use can break
"make check" if the prefixed PATH causes a wrong xz binary
(other than the one that was just built) to be used.
Older xz releases support a different method for setting
the PATH for the scripts. It is described in section 3.2
and is supported in this xz version too.
2.1. Static vs. dynamic linking of liblzma 2.1. Static vs. dynamic linking of liblzma
@ -658,7 +366,7 @@ XZ Utils Installation
liblzma, pass --enable-small to configure. liblzma, pass --enable-small to configure.
- Tell the compiler to optimize for size instead of speed. - Tell the compiler to optimize for size instead of speed.
For example, with GCC, put -Os into CFLAGS. E.g. with GCC, put -Os into CFLAGS.
- xzdec and lzmadec will never use multithreading capabilities of - xzdec and lzmadec will never use multithreading capabilities of
liblzma. You can avoid dependency on libpthread by passing liblzma. You can avoid dependency on libpthread by passing
@ -687,31 +395,20 @@ XZ Utils Installation
gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
script. script.
xzdiff (xzcmp/lzdiff/lzcmp) may use mktemp if it is available. As Some of the scripts require also mktemp. The original mktemp can be
a fallback xzdiff will use mkdir to securely create a temporary found from <http://www.mktemp.org/>. On GNU, most will use the mktemp
directory. Having mktemp available is still recommended since the program from GNU coreutils instead of the original implementation.
mkdir fallback method isn't as robust as mktemp is. The original Both mktemp versions are fine for XZ Utils (and practically for
mktemp can be found from <https://www.mktemp.org/>. On GNU, most will everything else too).
use the mktemp program from GNU coreutils instead of the original
implementation. Both mktemp versions are fine.
In addition to using xz to decompress .xz files, xzgrep and xzdiff
use gzip, bzip2, and lzop to support .gz, bz2, and .lzo files.
3.2. PATH 3.2. PATH
The method described below is supported by older xz releases.
It is supported by the current version too, but the newer
--enable-path-for-scripts=PREFIX described in section 2 may be
more convenient.
The scripts assume that the required tools (standard POSIX utilities, The scripts assume that the required tools (standard POSIX utilities,
mktemp, and xz) are in PATH; the scripts don't set the PATH themselves mktemp, and xz) are in PATH; the scripts don't set the PATH themselves.
(except as described for --enable-path-for-scripts=PREFIX). Some Some people like this while some think this is a bug. Those in the
people like this while some think this is a bug. Those in the latter latter group can easily patch the scripts before running the configure
group can easily patch the scripts before running the configure script script by taking advantage of a placeholder line in the scripts.
by taking advantage of a placeholder line in the scripts.
For example, to make the scripts prefix /usr/bin:/bin to PATH: For example, to make the scripts prefix /usr/bin:/bin to PATH:
@ -719,54 +416,10 @@ XZ Utils Installation
src/scripts/xz*.in src/scripts/xz*.in
4. Tests 4. Troubleshooting
--------
The test framework can be built and run by executing "make check" in
the build directory. The tests are a mix of executables and POSIX
shell scripts (sh). All tests should pass if the default configuration
is used. Disabling features through the configure options may cause
some tests to be skipped. If any tests do not pass, see section 5.5.
4.1. Testing in parallel
The tests can be run in parallel using the "-j" make option on systems
that support it. For instance, "make -j4 check" will run up to four
tests simultaneously.
4.2. Cross compiling
The tests can be built without running them:
make check TESTS=
The TESTS variable is the list of tests you wish to run. Leaving it
empty will compile the tests without running any.
If the tests are copied to a target machine to execute, the test data
files in the directory tests/files must also be copied. The tests
search for the data files using the environment variable $srcdir,
expecting to find the data files under $srcdir/files/. If $srcdir
isn't set then it defaults to the current directory.
The shell script tests can be copied from the source directory to the
target machine to execute. In addition to the test files, these tests
will expect the following relative file paths to execute properly:
./create_compress_files
../config.h
../src/xz/xz
../src/xzdec/xzdec
../src/scripts/xzdiff
../src/scripts/xzgrep
5. Troubleshooting
------------------ ------------------
5.1. "No C99 compiler was found." 4.1. "No C99 compiler was found."
You need a C99 compiler to build XZ Utils. If the configure script You need a C99 compiler to build XZ Utils. If the configure script
cannot find a C99 compiler and you think you have such a compiler cannot find a C99 compiler and you think you have such a compiler
@ -781,17 +434,16 @@ XZ Utils Installation
support enough C99. support enough C99.
5.2. "No POSIX conforming shell (sh) was found." 4.2. "No POSIX conforming shell (sh) was found."
xzgrep and other scripts need a shell that (roughly) conforms xzgrep and other scripts need a shell that (roughly) conforms
to POSIX. The configure script tries to find such a shell. If to POSIX. The configure script tries to find such a shell. If
it fails, you can force the shell to be used by passing it fails, you can force the shell to be used by passing
gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
script. Alternatively you can omit the installation of scripts and script.
this error by passing --disable-scripts to configure.
5.3. configure works but build fails at crc32_x86.S 4.3. configure works but build fails at crc32_x86.S
The easy fix is to pass --disable-assembler to the configure script. The easy fix is to pass --disable-assembler to the configure script.
@ -808,7 +460,7 @@ XZ Utils Installation
(see INSTALL.generic). (see INSTALL.generic).
5.4. Lots of warnings about symbol visibility 4.4. Lots of warnings about symbol visibility
On some systems where symbol visibility isn't supported, GCC may On some systems where symbol visibility isn't supported, GCC may
still accept the visibility options and attributes, which will make still accept the visibility options and attributes, which will make
@ -820,7 +472,7 @@ XZ Utils Installation
using --enable-werror. using --enable-werror.
5.5. "make check" fails 4.5. "make check" fails
If the other tests pass but test_scripts.sh fails, then the problem If the other tests pass but test_scripts.sh fails, then the problem
is in the scripts in src/scripts. Comparing the contents of is in the scripts in src/scripts. Comparing the contents of
@ -829,9 +481,8 @@ XZ Utils Installation
some tools are missing from the current PATH or the tools lack some tools are missing from the current PATH or the tools lack
support for some POSIX features. This can happen at least on support for some POSIX features. This can happen at least on
Solaris where the tools in /bin may be ancient but good enough Solaris where the tools in /bin may be ancient but good enough
tools are available in /usr/xpg4/bin or /usr/xpg6/bin. For possible tools are available in /usr/xpg4/bin or /usr/xpg6/bin. One fix
fixes, see --enable-path-for-scripts=PREFIX in section 2 and the for this problem is described in section 3.2 of this file.
older alternative method described in section 3.2 of this file.
If tests other than test_scripts.sh fail, a likely reason is that If tests other than test_scripts.sh fail, a likely reason is that
libtool links the test programs against an installed version of libtool links the test programs against an installed version of
@ -846,7 +497,7 @@ XZ Utils Installation
information. information.
5.6. liblzma.so (or similar) not found when running xz 4.6. liblzma.so (or similar) not found when running xz
If you installed the package with "make install" and get an error If you installed the package with "make install" and get an error
about liblzma.so (or a similarly named file) being missing, try about liblzma.so (or a similarly named file) being missing, try

View File

@ -1,8 +1,8 @@
Installation Instructions Installation Instructions
************************* *************************
Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
Foundation, Inc. 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification, Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright are permitted in any medium without royalty provided the copyright
@ -12,96 +12,97 @@ without warranty of any kind.
Basic Installation Basic Installation
================== ==================
Briefly, the shell command './configure && make && make install' Briefly, the shell commands `./configure; make; make install' should
should configure, build, and install this package. The following configure, build, and install this package. The following
more-detailed instructions are generic; see the 'README' file for more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this instructions specific to this package. Some packages provide this
'INSTALL' file but do not implement all of the features documented `INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions. in *note Makefile Conventions: (standards)Makefile Conventions.
The 'configure' shell script attempts to guess correct values for The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses various system-dependent variables used during compilation. It uses
those values to create a 'Makefile' in each directory of the package. those values to create a `Makefile' in each directory of the package.
It may also create one or more '.h' files containing system-dependent It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script 'config.status' that definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a you can run in the future to recreate the current configuration, and a
file 'config.log' containing compiler output (useful mainly for file `config.log' containing compiler output (useful mainly for
debugging 'configure'). debugging `configure').
It can also use an optional file (typically called 'config.cache' and It can also use an optional file (typically called `config.cache'
enabled with '--cache-file=config.cache' or simply '-C') that saves the and enabled with `--cache-file=config.cache' or simply `-C') that saves
results of its tests to speed up reconfiguring. Caching is disabled by the results of its tests to speed up reconfiguring. Caching is
default to prevent problems with accidental use of stale cache files. disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try If you need to do unusual things to compile the package, please try
to figure out how 'configure' could check whether to do them, and mail to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the 'README' so they can diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at be considered for the next release. If you are using the cache, and at
some point 'config.cache' contains results you don't want to keep, you some point `config.cache' contains results you don't want to keep, you
may remove or edit it. may remove or edit it.
The file 'configure.ac' (or 'configure.in') is used to create The file `configure.ac' (or `configure.in') is used to create
'configure' by a program called 'autoconf'. You need 'configure.ac' if `configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate 'configure' using a newer version of you want to change it or regenerate `configure' using a newer version
'autoconf'. of `autoconf'.
The simplest way to compile this package is: The simplest way to compile this package is:
1. 'cd' to the directory containing the package's source code and type 1. `cd' to the directory containing the package's source code and type
'./configure' to configure the package for your system. `./configure' to configure the package for your system.
Running 'configure' might take a while. While running, it prints Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for. some messages telling which features it is checking for.
2. Type 'make' to compile the package. 2. Type `make' to compile the package.
3. Optionally, type 'make check' to run any self-tests that come with 3. Optionally, type `make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries. the package, generally using the just-built uninstalled binaries.
4. Type 'make install' to install the programs and any data files and 4. Type `make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular recommended that the package be configured and built as a regular
user, and only the 'make install' phase executed with root user, and only the `make install' phase executed with root
privileges. privileges.
5. Optionally, type 'make installcheck' to repeat any self-tests, but 5. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location. this time using the binaries in their final installed location.
This target does not install anything. Running this target as a This target does not install anything. Running this target as a
regular user, particularly if the prior 'make install' required regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed root privileges, verifies that the installation completed
correctly. correctly.
6. You can remove the program binaries and object files from the 6. You can remove the program binaries and object files from the
source code directory by typing 'make clean'. To also remove the source code directory by typing `make clean'. To also remove the
files that 'configure' created (so you can compile the package for files that `configure' created (so you can compile the package for
a different kind of computer), type 'make distclean'. There is a different kind of computer), type `make distclean'. There is
also a 'make maintainer-clean' target, but that is intended mainly also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came all sorts of other programs in order to regenerate files that came
with the distribution. with the distribution.
7. Often, you can also type 'make uninstall' to remove the installed 7. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the uninstallation works correctly, even though it is required by the
GNU Coding Standards. GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide 'make 8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other distcheck', which can by used by developers to test that all other
targets like 'make install' and 'make uninstall' work correctly. targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users. This target is generally not run by end users.
Compilers and Options Compilers and Options
===================== =====================
Some systems require unusual options for compilation or linking that Some systems require unusual options for compilation or linking that
the 'configure' script does not know about. Run './configure --help' the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables. for details on some of the pertinent environment variables.
You can give 'configure' initial values for configuration parameters You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here is by setting variables in the command line or in the environment. Here
an example: is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix ./configure CC=c99 CFLAGS=-g LIBS=-lposix
@ -112,21 +113,21 @@ Compiling For Multiple Architectures
You can compile the package for more than one kind of computer at the You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU 'make'. 'cd' to the own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run directory where you want the object files and executables to go and run
the 'configure' script. 'configure' automatically checks for the source the `configure' script. `configure' automatically checks for the
code in the directory that 'configure' is in and in '..'. This is known source code in the directory that `configure' is in and in `..'. This
as a "VPATH" build. is known as a "VPATH" build.
With a non-GNU 'make', it is safer to compile the package for one With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have architecture at a time in the source code directory. After you have
installed the package for one architecture, use 'make distclean' before installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture. reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple '-arch' options to the "universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single '-arch' option to the preprocessor. Like compiler but only a single `-arch' option to the preprocessor. Like
this: this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
@ -135,104 +136,100 @@ this:
This is not guaranteed to produce working output in all cases, you This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results may have to build one architecture at a time and combine the results
using the 'lipo' tool if you have problems. using the `lipo' tool if you have problems.
Installation Names Installation Names
================== ==================
By default, 'make install' installs the package's commands under By default, `make install' installs the package's commands under
'/usr/local/bin', include files under '/usr/local/include', etc. You `/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than '/usr/local' by giving can specify an installation prefix other than `/usr/local' by giving
'configure' the option '--prefix=PREFIX', where PREFIX must be an `configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name. absolute file name.
You can specify separate installation prefixes for You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you architecture-specific files and architecture-independent files. If you
pass the option '--exec-prefix=PREFIX' to 'configure', the package uses pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries. PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix. Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give In addition, if you use an unusual directory layout you can give
options like '--bindir=DIR' to specify different values for particular options like `--bindir=DIR' to specify different values for particular
kinds of files. Run 'configure --help' for a list of the directories kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the default you can set and what kinds of files go in them. In general, the
for these options is expressed in terms of '${prefix}', so that default for these options is expressed in terms of `${prefix}', so that
specifying just '--prefix' will affect all of the other directory specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided. specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the The most portable way to affect installation locations is to pass the
correct locations to 'configure'; however, many packages provide one or correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the both of the following shortcuts of passing variable assignments to the
'make install' command line to change installation locations without `make install' command line to change installation locations without
having to reconfigure or recompile. having to reconfigure or recompile.
The first method involves providing an override variable for each The first method involves providing an override variable for each
affected directory. For example, 'make install affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of directory configuration variables that were expressed in terms of
'${prefix}'. Any directories that were specified during 'configure', `${prefix}'. Any directories that were specified during `configure',
but not in terms of '${prefix}', must each be overridden at install time but not in terms of `${prefix}', must each be overridden at install
for the entire installation to be relocated. The approach of makefile time for the entire installation to be relocated. The approach of
variable overrides for each directory variable is required by the GNU makefile variable overrides for each directory variable is required by
Coding Standards, and ideally causes no recompilation. However, some the GNU Coding Standards, and ideally causes no recompilation.
platforms have known limitations with the semantics of shared libraries However, some platforms have known limitations with the semantics of
that end up requiring recompilation when using this method, particularly shared libraries that end up requiring recompilation when using this
noticeable in packages that use GNU Libtool. method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the 'DESTDIR' variable. For The second method involves providing the `DESTDIR' variable. For
example, 'make install DESTDIR=/alternate/directory' will prepend example, `make install DESTDIR=/alternate/directory' will prepend
'/alternate/directory' before all installation names. The approach of `/alternate/directory' before all installation names. The approach of
'DESTDIR' overrides is not required by the GNU Coding Standards, and `DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand, does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of '${prefix}' when some directory options were not specified in terms of `${prefix}'
at 'configure' time. at `configure' time.
Optional Features Optional Features
================= =================
If the package supports it, you can cause programs to be installed If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving 'configure' the with an extra prefix or suffix on their names by giving `configure' the
option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Some packages pay attention to '--enable-FEATURE' options to Some packages pay attention to `--enable-FEATURE' options to
'configure', where FEATURE indicates an optional part of the package. `configure', where FEATURE indicates an optional part of the package.
They may also pay attention to '--with-PACKAGE' options, where PACKAGE They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like 'gnu-as' or 'x' (for the X Window System). The is something like `gnu-as' or `x' (for the X Window System). The
'README' should mention any '--enable-' and '--with-' options that the `README' should mention any `--enable-' and `--with-' options that the
package recognizes. package recognizes.
For packages that use the X Window System, 'configure' can usually For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't, find the X include and library files automatically, but if it doesn't,
you can use the 'configure' options '--x-includes=DIR' and you can use the `configure' options `--x-includes=DIR' and
'--x-libraries=DIR' to specify their locations. `--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the Some packages offer the ability to configure how verbose the
execution of 'make' will be. For these packages, running './configure execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be --enable-silent-rules' sets the default to minimal output, which can be
overridden with 'make V=1'; while running './configure overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be --disable-silent-rules' sets the default to verbose, which can be
overridden with 'make V=0'. overridden with `make V=0'.
Particular systems Particular systems
================== ==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC On HP-UX, the default C compiler is not ANSI C compatible. If GNU
is not installed, it is recommended to use the following options in CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler: order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500" ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX. and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX 'make' updates targets which have the same time stamps as their
prerequisites, which makes it generally unusable when shipped generated
files such as 'configure' are involved. Use GNU 'make' instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its '<wchar.h>' header file. The option '-nodtk' can be used as a parse its `<wchar.h>' header file. The option `-nodtk' can be used as
workaround. If GNU CC is not installed, it is therefore recommended to a workaround. If GNU CC is not installed, it is therefore recommended
try to try
./configure CC="cc" ./configure CC="cc"
@ -240,26 +237,26 @@ and if that doesn't work, try
./configure CC="cc -nodtk" ./configure CC="cc -nodtk"
On Solaris, don't put '/usr/ucb' early in your 'PATH'. This On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of directory contains several dysfunctional programs; working variants of
these programs are available in '/usr/bin'. So, if you need '/usr/ucb' these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your 'PATH', put it _after_ '/usr/bin'. in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in '/boot/common', On Haiku, software installed for all users goes in `/boot/common',
not '/usr/local'. It is recommended to use the following options: not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common ./configure --prefix=/boot/common
Specifying the System Type Specifying the System Type
========================== ==========================
There may be some features 'configure' cannot figure out There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the will run on. Usually, assuming the package is built to be run on the
_same_ architectures, 'configure' can figure that out, but if it prints _same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the a message saying it cannot guess the machine type, give it the
'--build=TYPE' option. TYPE can either be a short name for the system `--build=TYPE' option. TYPE can either be a short name for the system
type, such as 'sun4', or a canonical name which has the form: type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM CPU-COMPANY-SYSTEM
@ -268,101 +265,101 @@ where SYSTEM can have one of these forms:
OS OS
KERNEL-OS KERNEL-OS
See the file 'config.sub' for the possible values of each field. If See the file `config.sub' for the possible values of each field. If
'config.sub' isn't included in this package, then this package doesn't `config.sub' isn't included in this package, then this package doesn't
need to know the machine type. need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should If you are _building_ compiler tools for cross-compiling, you should
use the option '--target=TYPE' to select the type of system they will use the option `--target=TYPE' to select the type of system they will
produce code for. produce code for.
If you want to _use_ a cross compiler, that generates code for a If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will "host" platform (i.e., that on which the generated programs will
eventually be run) with '--host=TYPE'. eventually be run) with `--host=TYPE'.
Sharing Defaults Sharing Defaults
================ ================
If you want to set default values for 'configure' scripts to share, If you want to set default values for `configure' scripts to share,
you can create a site shell script called 'config.site' that gives you can create a site shell script called `config.site' that gives
default values for variables like 'CC', 'cache_file', and 'prefix'. default values for variables like `CC', `cache_file', and `prefix'.
'configure' looks for 'PREFIX/share/config.site' if it exists, then `configure' looks for `PREFIX/share/config.site' if it exists, then
'PREFIX/etc/config.site' if it exists. Or, you can set the `PREFIX/etc/config.site' if it exists. Or, you can set the
'CONFIG_SITE' environment variable to the location of the site script. `CONFIG_SITE' environment variable to the location of the site script.
A warning: not all 'configure' scripts look for a site script. A warning: not all `configure' scripts look for a site script.
Defining Variables Defining Variables
================== ==================
Variables not defined in a site shell script can be set in the Variables not defined in a site shell script can be set in the
environment passed to 'configure'. However, some packages may run environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set variables may be lost. In order to avoid this problem, you should set
them in the 'configure' command line, using 'VAR=value'. For example: them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc ./configure CC=/usr/local2/bin/gcc
causes the specified 'gcc' to be used as the C compiler (unless it is causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script). overridden in the site shell script).
Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Unfortunately, this technique does not work for `CONFIG_SHELL' due to
Autoconf limitation. Until the limitation is lifted, you can use this an Autoconf bug. Until the bug is fixed you can use this workaround:
workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
'configure' Invocation `configure' Invocation
====================== ======================
'configure' recognizes the following options to control how it `configure' recognizes the following options to control how it
operates. operates.
'--help' `--help'
'-h' `-h'
Print a summary of all of the options to 'configure', and exit. Print a summary of all of the options to `configure', and exit.
'--help=short' `--help=short'
'--help=recursive' `--help=recursive'
Print a summary of the options unique to this package's Print a summary of the options unique to this package's
'configure', and exit. The 'short' variant lists options used only `configure', and exit. The `short' variant lists options used
in the top level, while the 'recursive' variant lists options also only in the top level, while the `recursive' variant lists options
present in any nested packages. also present in any nested packages.
'--version' `--version'
'-V' `-V'
Print the version of Autoconf used to generate the 'configure' Print the version of Autoconf used to generate the `configure'
script, and exit. script, and exit.
'--cache-file=FILE' `--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE, Enable the cache: use and save the results of the tests in FILE,
traditionally 'config.cache'. FILE defaults to '/dev/null' to traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching. disable caching.
'--config-cache' `--config-cache'
'-C' `-C'
Alias for '--cache-file=config.cache'. Alias for `--cache-file=config.cache'.
'--quiet' `--quiet'
'--silent' `--silent'
'-q' `-q'
Do not print messages saying which checks are being made. To Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to '/dev/null' (any error suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown). messages will still be shown).
'--srcdir=DIR' `--srcdir=DIR'
Look for the package's source code in directory DIR. Usually Look for the package's source code in directory DIR. Usually
'configure' can determine that directory automatically. `configure' can determine that directory automatically.
'--prefix=DIR' `--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names:: for Use DIR as the installation prefix. *note Installation Names::
more details, including other options available for fine-tuning the for more details, including other options available for fine-tuning
installation locations. the installation locations.
'--no-create' `--no-create'
'-n' `-n'
Run the configure checks, but stop before creating any output Run the configure checks, but stop before creating any output
files. files.
'configure' also accepts some other, not widely useful, options. Run `configure' also accepts some other, not widely useful, options. Run
'configure --help' for more details. `configure --help' for more details.

View File

@ -1,5 +1,9 @@
## SPDX-License-Identifier: 0BSD ##
## Author: Lasse Collin ## Author: Lasse Collin
##
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
# Use -n to prevent gzip from adding a timestamp to the .gz headers. # Use -n to prevent gzip from adding a timestamp to the .gz headers.
GZIP_ENV = -9n GZIP_ENV = -9n
@ -17,11 +21,11 @@ if COND_DOC
dist_doc_DATA = \ dist_doc_DATA = \
AUTHORS \ AUTHORS \
COPYING \ COPYING \
COPYING.0BSD \
COPYING.GPLv2 \ COPYING.GPLv2 \
NEWS \ NEWS \
README \ README \
THANKS \ THANKS \
TODO \
doc/faq.txt \ doc/faq.txt \
doc/history.txt \ doc/history.txt \
doc/xz-file-format.txt \ doc/xz-file-format.txt \
@ -33,47 +37,32 @@ dist_examples_DATA = \
doc/examples/01_compress_easy.c \ doc/examples/01_compress_easy.c \
doc/examples/02_decompress.c \ doc/examples/02_decompress.c \
doc/examples/03_compress_custom.c \ doc/examples/03_compress_custom.c \
doc/examples/04_compress_easy_mt.c \
doc/examples/11_file_info.c \
doc/examples/Makefile doc/examples/Makefile
# Install the Doxygen generated documentation if they were built. examplesolddir = $(docdir)/examples_old
install-data-local: dist_examplesold_DATA = \
if test -d "$(srcdir)/doc/api" ; then \ doc/examples_old/xz_pipe_comp.c \
$(MKDIR_P) "$(DESTDIR)$(docdir)/api" && \ doc/examples_old/xz_pipe_decomp.c
$(INSTALL_DATA) "$(srcdir)"/doc/api/* \
"$(DESTDIR)$(docdir)/api"; \
fi
# Remove the Doxygen generated documentation when uninstalling.
uninstall-local:
rm -rf "$(DESTDIR)$(docdir)/api"
endif endif
EXTRA_DIST = \ EXTRA_DIST = \
cmake \
dos \
doxygen \
extra \ extra \
po4a \ dos \
windows \ windows \
CMakeLists.txt \ macosx \
COPYING.CC-BY-SA-4.0 \ autogen.sh \
Doxyfile.in \
COPYING.GPLv2 \ COPYING.GPLv2 \
COPYING.GPLv3 \ COPYING.GPLv3 \
COPYING.LGPLv2.1 \ COPYING.LGPLv2.1 \
INSTALL.generic \ INSTALL.generic \
PACKAGERS \ PACKAGERS \
TODO \
autogen.sh \
build-aux/manconv.sh \ build-aux/manconv.sh \
build-aux/version.sh \ build-aux/version.sh
doc/xz-logo.png \
po/xz.pot-header
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
# List of man pages to convert to PDF and plain text in the dist-hook target. # List of man pages to conver to PDF and plain text in the dist-hook target.
manfiles = \ manfiles = \
src/xz/xz.1 \ src/xz/xz.1 \
src/xzdec/xzdec.1 \ src/xzdec/xzdec.1 \
@ -87,8 +76,7 @@ manfiles = \
# Convert the man pages to PDF and plain text (ASCII only) formats. # Convert the man pages to PDF and plain text (ASCII only) formats.
dist-hook: dist-hook:
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \ if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
( cd "$(srcdir)" && git log --date=iso --stat \ ( cd "$(srcdir)" && git log --date=iso --stat ) \
b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \
> "$(distdir)/ChangeLog"; \ > "$(distdir)/ChangeLog"; \
fi fi
if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \ if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \
@ -107,19 +95,9 @@ dist-hook:
> "$$dest/txt/$$BASE.txt"; \ > "$$dest/txt/$$BASE.txt"; \
done; \ done; \
fi fi
if test -d "$(srcdir)/doc/api" ; then \
$(MKDIR_P) "$(distdir)/doc/api" && \
$(INSTALL_DATA) "$(srcdir)"/doc/api/* \
"$(distdir)/doc/api"; \
fi
# This works with GNU tar and gives cleaner package than normal 'make dist'. # This works with GNU tar and gives cleaner package than normal 'make dist'.
# This also ensures that the man page translations are up to date (dist-hook
# would be too late for that).
mydist: mydist:
sh "$(srcdir)/src/liblzma/validate_map.sh"
cd "$(srcdir)/po4a" && sh update-po
cd "$(srcdir)/doxygen" && sh update-doxygen
VERSION=$(VERSION); \ VERSION=$(VERSION); \
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \ if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \ SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \

1929
NEWS

File diff suppressed because it is too large Load Diff

View File

@ -44,8 +44,6 @@ Information to packagers of XZ Utils
lzmadec binary for compatibility with LZMA Utils lzmadec binary for compatibility with LZMA Utils
liblzma liblzma.so.* liblzma liblzma.so.*
liblzma-devel liblzma.so, liblzma.a, API headers liblzma-devel liblzma.so, liblzma.a, API headers
liblzma-doc Doxygen-generated liblzma API docs (HTML),
example programs
2. Package description 2. Package description
@ -111,28 +109,20 @@ Information to packagers of XZ Utils
This package includes the API headers, static library, and This package includes the API headers, static library, and
other development files related to liblzma. other development files related to liblzma.
liblzma-doc:
liblzma API documentation in HTML and example usage
This package includes the Doxygen-generated liblzma API
HTML docs and example programs showing how to use liblzma.
3. License 3. License
---------- ----------
If the package manager supports a license field, you probably should If the package manager supports a license field, you probably should
put GPLv2+ there (GNU GPL v2 or later). The interesting parts of put GPLv2+ there (GNU GPL v2 or later). The interesting parts of
XZ Utils are under the BSD Zero Clause License (0BSD), but some less XZ Utils are in the public domain, but some less important files
important files ending up into the binary package are under GPLv2+. ending up into the binary package are under GPLv2+. So it is simplest
So it is simplest to just say GPLv2+ if you cannot specify to just say GPLv2+ if you cannot specify "public domain and GPLv2+".
"BSD0 and GPLv2+".
If you split XZ Utils into multiple packages as described earlier If you split XZ Utils into multiple packages as described earlier
in this file, liblzma and liblzma-dev packages will contain only in this file, liblzma and liblzma-dev packages will contain only
0BSD-licensed code from XZ Utils (compiler or linker may add some public domain code (from XZ Utils at least; compiler or linker may
third-party code which may have other licenses). add some third-party code, which may be copyrighted).
4. configure options 4. configure options
@ -148,8 +138,6 @@ Information to packagers of XZ Utils
--enable-checks --enable-checks
--enable-small (*) --enable-small (*)
--disable-threads (*) --disable-threads (*)
--disable-microlzma (*)
--disable-lzip-decoder (*)
(*) These are OK when building xzdec and lzmadec as described (*) These are OK when building xzdec and lzmadec as described
in INSTALL. in INSTALL.
@ -170,13 +158,12 @@ Information to packagers of XZ Utils
can be replaced with a symlink if your distro ships with shared can be replaced with a symlink if your distro ships with shared
copies of the common license texts. copies of the common license texts.
The Doxygen-generated documentation (HTML) for the liblzma API liblzma API is currently only documented using Doxygen tags in the
headers is included in the source release and will be installed by API headers. It hasn't been tested much how good results Doxygen
"make install" to $docdir/api. All JavaScript is removed to is able to make from the tags (e.g. Doxyfile might need tweaking,
simplify license compliance and to reduce the install size. If the the tagging may need to be improved etc.), so it might be simpler
liblzma API documentation is not desired, either run configure with to just let people read docs directly from the .h files for now,
--disable-doc or remove the doc/api directory before running and also save quite a bit in package size at the same time.
"make install".
6. Extra files 6. Extra files

118
README
View File

@ -9,7 +9,7 @@ XZ Utils
1.3. Documentation for liblzma 1.3. Documentation for liblzma
2. Version numbering 2. Version numbering
3. Reporting bugs 3. Reporting bugs
4. Translations 4. Translating the xz tool
5. Other implementations of the .xz format 5. Other implementations of the .xz format
6. Contact information 6. Contact information
@ -55,11 +55,9 @@ XZ Utils
Similarly, it is possible that some day there is a filter that will Similarly, it is possible that some day there is a filter that will
compress better than LZMA2. compress better than LZMA2.
XZ Utils supports multithreaded compression. XZ Utils doesn't support XZ Utils doesn't support multithreaded compression or decompression
multithreaded decompression yet. It has been planned though and taken yet. It has been planned though and taken into account when designing
into account when designing the .xz file format. In the future, files the .xz file format.
that were created in threaded mode can be decompressed in threaded
mode too.
1. Documentation 1. Documentation
@ -67,27 +65,24 @@ XZ Utils
1.1. Overall documentation 1.1. Overall documentation
README This file README This file
INSTALL.generic Generic install instructions for those not INSTALL.generic Generic install instructions for those not familiar
familiar with packages using GNU Autotools with packages using GNU Autotools
INSTALL Installation instructions specific to XZ Utils INSTALL Installation instructions specific to XZ Utils
PACKAGERS Information to packagers of XZ Utils PACKAGERS Information to packagers of XZ Utils
COPYING XZ Utils copyright and license information COPYING XZ Utils copyright and license information
COPYING.0BSD BSD Zero Clause License COPYING.GPLv2 GNU General Public License version 2
COPYING.GPLv2 GNU General Public License version 2 COPYING.GPLv3 GNU General Public License version 3
COPYING.GPLv3 GNU General Public License version 3 COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
COPYING.CC-BY-SA-4.0 Creative Commons Attribution-ShareAlike 4.0
International Public License
AUTHORS The main authors of XZ Utils AUTHORS The main authors of XZ Utils
THANKS Incomplete list of people who have helped making THANKS Incomplete list of people who have helped making
this software this software
NEWS User-visible changes between XZ Utils releases NEWS User-visible changes between XZ Utils releases
ChangeLog Detailed list of changes (commit log) ChangeLog Detailed list of changes (commit log)
TODO Known bugs and some sort of to-do list TODO Known bugs and some sort of to-do list
Note that only some of the above files are included in binary Note that only some of the above files are included in binary
packages. packages.
@ -108,16 +103,17 @@ XZ Utils
and data type as Doxygen tags. These docs should be quite OK as and data type as Doxygen tags. These docs should be quite OK as
a quick reference. a quick reference.
There are a few example/tutorial programs that should help in I have planned to write a bunch of very well documented example
getting started with liblzma. In the source package the examples programs, which (due to comments) should work as a tutorial to
are in "doc/examples" and in binary packages they may be under various features of liblzma. No such example programs have been
"examples" in the same directory as this README. written yet.
Since the liblzma API has similarities to the zlib API, some people For now, if you have never used liblzma, libbzip2, or zlib, I
may find it useful to read the zlib docs and tutorial too: recommend learning the *basics* of the zlib API. Once you know that,
it should be easier to learn liblzma.
https://zlib.net/manual.html http://zlib.net/manual.html
https://zlib.net/zlib_how.html http://zlib.net/zlib_how.html
2. Version numbering 2. Version numbering
@ -196,19 +192,19 @@ XZ Utils
system. system.
4. Translations 4. Translating the xz tool
--------------- --------------------------
The xz command line tool and all man pages can be translated. The messages from the xz tool have been translated into a few
The translations are handled via the Translation Project. If you languages. Before starting to translate into a new language, ask
wish to help translating xz, please join the Translation Project: the author whether someone else hasn't already started working on it.
https://translationproject.org/html/translators.html Test your translation. Testing includes comparing the translated
output to the original English version by running the same commands
in both your target locale and with LC_ALL=C. Ask someone to
proof-read and test the translation.
Below are notes and testing instructions specific to xz Testing can be done e.g. by installing xz into a temporary directory:
translations.
Testing can be done by installing xz into a temporary directory:
./configure --disable-shared --prefix=/tmp/xz-test ./configure --disable-shared --prefix=/tmp/xz-test
# <Edit the .po file in the po directory.> # <Edit the .po file in the po directory.>
@ -261,11 +257,14 @@ XZ Utils
at the beginning and end of the strings. at the beginning and end of the strings.
- Read the TRANSLATORS comments that have been extracted from the - Read the TRANSLATORS comments that have been extracted from the
source code and included in xz.pot. Some comments suggest source code and included in xz.pot. If they suggest testing the
testing with a specific command which needs an .xz file. You translation with some type of command, do it. If testing needs
may use e.g. any tests/files/good-*.xz. However, these test input files, use e.g. tests/files/good-*.xz.
commands are included in translations.bash output, so reading
translations.bash output carefully can be enough. - When updating the translation, read the fuzzy (modified) strings
carefully, and don't mark them as updated before you actually
have updated them. Reading through the unchanged messages can be
good too; sometimes you may find a better wording for them.
- If you find language problems in the original English strings, - If you find language problems in the original English strings,
feel free to suggest improvements. Ask if something is unclear. feel free to suggest improvements. Ask if something is unclear.
@ -275,7 +274,9 @@ XZ Utils
make a direct word-by-word translation from English especially if make a direct word-by-word translation from English especially if
the result doesn't sound good in your language. the result doesn't sound good in your language.
Thanks for your help! In short, take your time and pay attention to the details. Making
a good translation is not a quick and trivial thing to do. The
translated xz should look as polished as the English version.
5. Other implementations of the .xz format 5. Other implementations of the .xz format
@ -284,27 +285,24 @@ XZ Utils
7-Zip and the p7zip port of 7-Zip support the .xz format starting 7-Zip and the p7zip port of 7-Zip support the .xz format starting
from the version 9.00alpha. from the version 9.00alpha.
https://7-zip.org/ http://7-zip.org/
https://p7zip.sourceforge.net/ http://p7zip.sourceforge.net/
XZ Embedded is a limited implementation written for use in the Linux XZ Embedded is a limited implementation written for use in the Linux
kernel, but it is also suitable for other embedded use. kernel, but it is also suitable for other embedded use.
https://xz.tukaani.org/xz-embedded/ http://tukaani.org/xz/embedded.html
XZ for Java is a complete implementation written in pure Java.
https://xz.tukaani.org/xz-for-java/
6. Contact information 6. Contact information
---------------------- ----------------------
If you have questions, bug reports, patches etc. related to XZ Utils, If you have questions, bug reports, patches etc. related to XZ Utils,
the project maintainers Lasse Collin and Jia Tan can be reached via contact Lasse Collin <lasse.collin@tukaani.org> (in Finnish or English).
<xz@tukaani.org>. I'm sometimes slow at replying. If you haven't got a reply within two
weeks, assume that your email has got lost and resend it or use IRC.
You might find Lasse also from #tukaani on Libera Chat (IRC). You can find me also from #tukaani on Freenode; my nick is Larhzu.
The nick is Larhzu. The channel tends to be pretty quiet, The channel tends to be pretty quiet, so just ask your question and
so just ask your question and someone might wake up. someone may wake up.

89
THANKS
View File

@ -5,174 +5,89 @@ Thanks
Some people have helped more, some less, but nevertheless everyone's help Some people have helped more, some less, but nevertheless everyone's help
has been important. :-) In alphabetical order: has been important. :-) In alphabetical order:
- Mark Adler - Mark Adler
- Kian-Meng Ang
- H. Peter Anvin - H. Peter Anvin
- Jeff Bastian - Jeff Bastian
- Nelson H. F. Beebe - Nelson H. F. Beebe
- Karl Beldan
- Karl Berry - Karl Berry
- Anders F. Björklund - Anders F. Björklund
- Emmanuel Blot - Emmanuel Blot
- Melanie Blower
- Alexander Bluhm
- Martin Blumenstingl - Martin Blumenstingl
- Ben Boeckel
- Jakub Bogusz - Jakub Bogusz
- Adam Borowski
- Maarten Bosmans - Maarten Bosmans
- Lukas Braune
- Benjamin Buch
- Trent W. Buck - Trent W. Buck
- Kevin R. Bulgrien
- James Buren - James Buren
- David Burklund - David Burklund
- Frank Busse
- Daniel Mealha Cabrita - Daniel Mealha Cabrita
- Milo Casagrande - Milo Casagrande
- Marek Černocký - Marek Černocký
- Tomer Chachamu - Tomer Chachamu
- Vitaly Chikunov
- Antoine Cœur
- Gabi Davar
- İhsan Doğan
- Chris Donawa - Chris Donawa
- Andrew Dudman - Andrew Dudman
- Markus Duft - Markus Duft
- İsmail Dönmez - İsmail Dönmez
- Paul Eggert
- Robert Elz - Robert Elz
- Gilles Espinasse - Gilles Espinasse
- Denis Excoffier - Denis Excoffier
- Vincent Fazio
- Michael Felt - Michael Felt
- Michael Fox
- Mike Frysinger - Mike Frysinger
- Daniel Richard G. - Daniel Richard G.
- Tomasz Gajc
- Bjarni Ingi Gislason
- John Paul Adrian Glaubitz
- Bill Glessner
- Matthew Good
- Michał Górny
- Jason Gorski - Jason Gorski
- Juan Manuel Guerrero - Juan Manuel Guerrero
- Gabriela Gutierrez
- Diederik de Haas
- Joachim Henke - Joachim Henke
- Christian Hesse
- Vincenzo Innocente
- Peter Ivanov - Peter Ivanov
- Nicholas Jackson
- Sam James
- Hajin Jang
- Hans Jansen
- Jouk Jansen - Jouk Jansen
- Jun I Jin
- Kiyoshi Kanazawa
- Joona Kannisto
- Per Øyvind Karlsen - Per Øyvind Karlsen
- Iouri Kharon
- Thomas Klausner - Thomas Klausner
- Richard Koch - Richard Koch
- Anton Kochkov
- Ville Koskinen - Ville Koskinen
- Sergey Kosukhin
- Marcin Kowalczyk
- Jan Kratochvil
- Christian Kujau
- Stephan Kulow - Stephan Kulow
- Ilya Kurdyukov
- Peter Lawler - Peter Lawler
- James M Leddy
- Kelvin Lee
- Vincent Lefevre
- Hin-Tak Leung - Hin-Tak Leung
- Andraž 'ruskie' Levstik - Andraž 'ruskie' Levstik
- Cary Lewis - Cary Lewis
- Wim Lewis - Wim Lewis
- Xin Li
- Eric Lindblad
- Lorenzo De Liso - Lorenzo De Liso
- H.J. Lu
- Bela Lubkin - Bela Lubkin
- Chenxi Mao
- Gregory Margo - Gregory Margo
- Julien Marrec
- Ed Maste
- Martin Matuška
- Ivan A. Melnikov
- Jim Meyering - Jim Meyering
- Arkadiusz Miskiewicz
- Nathan Moinvaziri
- Étienne Mollier
- Conley Moorhous - Conley Moorhous
- Rafał Mużyło - Rafał Mużyło
- Adrien Nader - Adrien Nader
- Evan Nemerson
- Hongbo Ni - Hongbo Ni
- Jonathan Nieder - Jonathan Nieder
- Andre Noll - Andre Noll
- Peter O'Gorman - Peter O'Gorman
- Dimitri Papadopoulos Orfanos
- Daniel Packard
- Filip Palian
- Peter Pallinger - Peter Pallinger
- Rui Paulo
- Igor Pavlov - Igor Pavlov
- Diego Elio Pettenò - Diego Elio Pettenò
- Elbert Pol - Elbert Pol
- Mikko Pouru - Mikko Pouru
- Rich Prohaska
- Trần Ngọc Quân
- Pavel Raiskup - Pavel Raiskup
- Ole André Vadla Ravnås
- Eric S. Raymond
- Robert Readman - Robert Readman
- Bernhard Reutner-Fischer - Bernhard Reutner-Fischer
- Markus Rickert - Eric S. Raymond
- Cristian Rodríguez - Cristian Rodríguez
- Christian von Roques - Christian von Roques
- Boud Roukema
- Torsten Rupp
- Stephen Sachs
- Jukka Salmi - Jukka Salmi
- Agostino Sarubbo
- Alexandre Sauvé - Alexandre Sauvé
- Benno Schulenberg - Benno Schulenberg
- Andreas Schwab - Andreas Schwab
- Bhargava Shastry
- Dan Shechter - Dan Shechter
- Stuart Shelton - Stuart Shelton
- Sebastian Andrzej Siewior
- Ville Skyttä
- Brad Smith
- Bruce Stark
- Pippijn van Steenhoven
- Martin Storsjö
- Jonathan Stott - Jonathan Stott
- Dan Stromberg - Dan Stromberg
- Jia Tan
- Vincent Torri
- Alexey Tourbin
- Paul Townsend - Paul Townsend
- Mohammed Adnène Trojette - Mohammed Adnène Trojette
- Taiki Tsunekawa - Alexey Tourbin
- Maksym Vatsyk
- Loganaden Velvindron
- Patrick J. Volkerding - Patrick J. Volkerding
- Martin Väth - Martin Väth
- Adam Walling
- Jeffrey Walton
- Christian Weisgerber - Christian Weisgerber
- Dan Weiss
- Bert Wesarg - Bert Wesarg
- Fredrik Wikstrom - Fredrik Wikstrom
- Jim Wilcoxson
- Ralf Wildenhues - Ralf Wildenhues
- Charles Wilson - Charles Wilson
- Lars Wirzenius - Lars Wirzenius
- Pilorz Wojciech - Pilorz Wojciech
- Chien Wong
- Ryan Young - Ryan Young
- Andreas Zieringer - Andreas Zieringer

62
TODO
View File

@ -24,36 +24,20 @@ Known bugs
tuklib_exit() doesn't block signals => EINTR is possible. tuklib_exit() doesn't block signals => EINTR is possible.
If liblzma has created threads and fork() gets called, liblzma SIGTSTP is not handled. If xz is stopped, the estimated remaining
code will break in the child process unless it calls exec() and time and calculated (de)compression speed won't make sense in the
doesn't touch liblzma. progress indicator (xz --verbose).
Missing features Missing features
---------------- ----------------
Add support for storing metadata in .xz files. A preliminary
idea is to create a new Stream type for metadata. When both
metadata and data are wanted in the same .xz file, two or more
Streams would be concatenated.
The state stored in lzma_stream should be cloneable, which would
be mostly useful when using a preset dictionary in LZMA2, but
it may have other uses too. Compare to deflateCopy() in zlib.
Support LZMA_FINISH in raw decoder to indicate end of LZMA1 and
other streams that don't have an end of payload marker.
Adjust dictionary size when the input file size is known.
Maybe do this only if an option is given.
xz doesn't support copying extended attributes, access control xz doesn't support copying extended attributes, access control
lists etc. from source to target file. lists etc. from source to target file.
Multithreaded compression: Multithreaded compression
- Reduce memory usage of the current method.
- Implement threaded match finders. Multithreaded decompression
- Implement pigz-style threading in LZMA2.
Buffer-to-buffer coding could use less RAM (especially when Buffer-to-buffer coding could use less RAM (especially when
decompressing LZMA1 or LZMA2). decompressing LZMA1 or LZMA2).
@ -62,44 +46,18 @@ Missing features
It will be a separate library that supports uncompressed, .gz, It will be a separate library that supports uncompressed, .gz,
.bz2, .lzma, and .xz files. .bz2, .lzma, and .xz files.
Support changing lzma_options_lzma.mode with lzma_filters_update().
Support LZMA_FULL_FLUSH for lzma_stream_decoder() to stop at
Block and Stream boundaries.
lzma_strerror() to convert lzma_ret to human readable form? lzma_strerror() to convert lzma_ret to human readable form?
This is tricky, because the same error codes are used with This is tricky, because the same error codes are used with
slightly different meanings, and this cannot be fixed anymore. slightly different meanings, and this cannot be fixed anymore.
Make it possible to adjust LZMA2 options in the middle of a Block
so that the encoding speed vs. compression ratio can be optimized
when the compressed data is streamed over network.
Improved BCJ filters. The current filters are small but they aren't
so great when compressing binary packages that contain various file
types. Specifically, they make things worse if there are static
libraries or Linux kernel modules. The filtering could also be
more effective (without getting overly complex), for example,
streamable variant BCJ2 from 7-Zip could be implemented.
Filter that autodetects specific data types in the input stream
and applies appropriate filters for the corrects parts of the input.
Perhaps combine this with the BCJ filter improvement point above.
Long-range LZ77 method as a separate filter or as a new LZMA2
match finder.
Documentation Documentation
------------- -------------
More tutorial programs are needed for liblzma. Some tutorial is needed for liblzma. I have planned to write some
extremely well commented example programs, which would work as
a tutorial. I suppose the Doxygen tags are quite OK as a quick
reference once one is familiar with the liblzma API.
Document the LZMA1 and LZMA2 algorithms. Document the LZMA1 and LZMA2 algorithms.
Miscellaneous
------------
Try to get the media type for .xz registered at IANA.

View File

@ -1,54 +1,22 @@
#!/bin/sh #!/bin/sh
# SPDX-License-Identifier: 0BSD
############################################################################### ###############################################################################
# #
# Author: Lasse Collin # Author: Lasse Collin
# #
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
############################################################################### ###############################################################################
# The result of using "autoreconf -fi" should be identical to using this
# script. I'm leaving this script here just in case someone finds it useful.
set -e -x set -e -x
# The following six lines are almost identical to "autoreconf -fi" but faster.
${AUTOPOINT:-autopoint} -f ${AUTOPOINT:-autopoint} -f
${LIBTOOLIZE:-libtoolize} -c -f || glibtoolize -c -f ${LIBTOOLIZE:-libtoolize} -c -f || glibtoolize -c -f
${ACLOCAL:-aclocal} -I m4 ${ACLOCAL:-aclocal} -I m4
${AUTOCONF:-autoconf} ${AUTOCONF:-autoconf}
${AUTOHEADER:-autoheader} ${AUTOHEADER:-autoheader}
${AUTOMAKE:-automake} -acf --foreign ${AUTOMAKE:-automake} -acf --foreign
# Generate the translated man pages and the doxygen documentation if the
# "po4a" and "doxygen" tools are available.
# This is *NOT* done by "autoreconf -fi" or when "make" is run.
# Pass --no-po4a or --no-doxygen to this script to skip these steps.
# It can be useful when you know that po4a or doxygen aren't available and
# don't want autogen.sh to exit with non-zero exit status.
generate_po4a="y"
generate_doxygen="y"
for arg in "$@"
do
case $arg in
"--no-po4a")
generate_po4a="n"
;;
"--no-doxygen")
generate_doxygen="n"
;;
esac
done
if test "$generate_po4a" != "n"; then
cd po4a
sh update-po
cd ..
fi
if test "$generate_doxygen" != "n"; then
cd doxygen
sh update-doxygen
cd ..
fi
exit 0

View File

@ -1,287 +0,0 @@
#!/bin/bash
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# Script meant to be used for Continuous Integration automation for POSIX
# systems. On GitHub, this is used by Ubuntu and MacOS builds.
#
#############################################################################
#
# Author: Jia Tan
#
#############################################################################
set -e
USAGE="Usage: $0
-a [autogen flags]
-b [autotools|cmake]
-c [crc32|crc64|sha256]
-d [encoders|decoders|bcj|delta|threads|shared|nls|small|ifunc|clmul|sandbox]
-f [CFLAGS]
-l [destdir]
-m [compiler]
-n [ARTIFACTS_DIR_NAME]
-p [all|build|test]
-s [srcdir]"
# Absolute path of script directory
ABS_DIR=$(cd -- "$(dirname -- "$0")" && pwd)
# Default CLI option values
AUTOGEN_FLAGS=""
BUILD_SYSTEM="autotools"
CHECK_TYPE="crc32,crc64,sha256"
BCJ="y"
DELTA="y"
ENCODERS="y"
DECODERS="y"
THREADS="y"
SHARED="y"
NATIVE_LANG_SUPPORT="y"
SMALL="n"
IFUNC="y"
CLMUL="y"
SANDBOX="y"
SRC_DIR="$ABS_DIR/../"
DEST_DIR="$SRC_DIR/../xz_build"
PHASE="all"
ARTIFACTS_DIR_NAME="output"
###################
# Parse arguments #
###################
while getopts a:b:c:d:l:m:n:s:p:f:h opt; do
# b option can have either value "autotools" OR "cmake"
case ${opt} in
h)
echo "$USAGE"
exit 0
;;
a)
AUTOGEN_FLAGS="$OPTARG"
;;
b)
case "$OPTARG" in
autotools) ;;
cmake) ;;
*) echo "Invalid build system: $OPTARG"; exit 1;;
esac
BUILD_SYSTEM="$OPTARG"
;;
c) CHECK_TYPE="$OPTARG"
;;
# d options can be a comma separated list of things to disable at
# configure time
d)
for disable_arg in $(echo "$OPTARG" | sed "s/,/ /g"); do
case "$disable_arg" in
encoders) ENCODERS="n" ;;
decoders) DECODERS="n" ;;
bcj) BCJ="n" ;;
delta) DELTA="n" ;;
threads) THREADS="n" ;;
shared) SHARED="n";;
nls) NATIVE_LANG_SUPPORT="n";;
small) SMALL="y";;
ifunc) IFUNC="n";;
clmul) CLMUL="n";;
sandbox) SANDBOX="n";;
*) echo "Invalid disable value: $disable_arg"; exit 1 ;;
esac
done
;;
l) DEST_DIR="$OPTARG"
;;
m)
CC="$OPTARG"
export CC
;;
n) ARTIFACTS_DIR_NAME="$OPTARG"
;;
s) SRC_DIR="$OPTARG"
;;
p) PHASE="$OPTARG"
;;
f)
CFLAGS="$OPTARG"
export CFLAGS
;;
esac
done
####################
# Helper Functions #
####################
# These two functions essentially implement the ternary "?" operator.
add_extra_option() {
# First argument is option value ("y" or "n")
# Second argument is option to set if "y"
# Third argument is option to set if "n"
if [ "$1" = "y" ]
then
EXTRA_OPTIONS="$EXTRA_OPTIONS $2"
else
EXTRA_OPTIONS="$EXTRA_OPTIONS $3"
fi
}
add_to_filter_list() {
# First argument is option value ("y" or "n")
# Second argument is option to set if "y"
if [ "$1" = "y" ]
then
FILTER_LIST="$FILTER_LIST$2"
fi
}
###############
# Build Phase #
###############
if [ "$PHASE" = "all" ] || [ "$PHASE" = "build" ]
then
# Checksum options should be specified differently based on the
# build system. It must be calculated here since we won't know
# the build system used until all args have been parsed.
# Autotools - comma separated
# CMake - semi-colon separated
if [ "$BUILD_SYSTEM" = "autotools" ]
then
SEP=","
else
SEP=";"
fi
CHECK_TYPE_TEMP=""
for crc in $(echo "$CHECK_TYPE" | sed "s/,/ /g"); do
case "$crc" in
# Remove "crc32" from cmake build, if specified.
crc32)
if [ "$BUILD_SYSTEM" = "cmake" ]
then
continue
fi
;;
crc64) ;;
sha256) ;;
*) echo "Invalid check type: $crc"; exit 1 ;;
esac
CHECK_TYPE_TEMP="$CHECK_TYPE_TEMP$SEP$crc"
done
# Remove the first character from $CHECK_TYPE_TEMP since it will
# always be the delimiter.
CHECK_TYPE="${CHECK_TYPE_TEMP:1}"
FILTER_LIST="lzma1$SEP"lzma2
# Build based on arguments
mkdir -p "$DEST_DIR"
# Generate configure option values
EXTRA_OPTIONS=""
case $BUILD_SYSTEM in
autotools)
cd "$SRC_DIR"
# Run autogen.sh script if not already run
if [ ! -f configure ]
then
./autogen.sh "$AUTOGEN_FLAGS"
fi
cd "$DEST_DIR"
add_to_filter_list "$BCJ" ",x86,powerpc,ia64,arm,armthumb,arm64,sparc,riscv"
add_to_filter_list "$DELTA" ",delta"
add_extra_option "$ENCODERS" "--enable-encoders=$FILTER_LIST" "--disable-encoders"
add_extra_option "$DECODERS" "--enable-decoders=$FILTER_LIST" "--disable-decoders"
add_extra_option "$THREADS" "" "--disable-threads"
add_extra_option "$SHARED" "" "--disable-shared"
add_extra_option "$NATIVE_LANG_SUPPORT" "" "--disable-nls"
add_extra_option "$SMALL" "--enable-small" ""
add_extra_option "$IFUNC" "" "--disable-ifunc"
add_extra_option "$CLMUL" "" "--disable-clmul-crc"
add_extra_option "$SANDBOX" "" "--enable-sandbox=no"
# Run configure script
"$SRC_DIR"/configure --enable-werror --enable-checks="$CHECK_TYPE" $EXTRA_OPTIONS --config-cache
# Build the project
make
;;
cmake)
cd "$DEST_DIR"
add_to_filter_list "$BCJ" ";x86;powerpc;ia64;arm;armthumb;arm64;sparc;riscv"
add_to_filter_list "$DELTA" ";delta"
add_extra_option "$THREADS" "-DENABLE_THREADS=ON" "-DENABLE_THREADS=OFF"
# Disable MicroLZMA if encoders are not configured.
add_extra_option "$ENCODERS" "-DENCODERS=$FILTER_LIST" "-DENCODERS= -DMICROLZMA_ENCODER=OFF"
# Disable MicroLZMA and lzip decoders if decoders are not configured.
add_extra_option "$DECODERS" "-DDECODERS=$FILTER_LIST" "-DDECODERS= -DMICROLZMA_DECODER=OFF -DLZIP_DECODER=OFF"
# CMake disables the shared library by default.
add_extra_option "$SHARED" "-DBUILD_SHARED_LIBS=ON" ""
add_extra_option "$SMALL" "-DHAVE_SMALL=ON" ""
if test -n "$CC" ; then
EXTRA_OPTIONS="$EXTRA_OPTIONS -DCMAKE_C_COMPILER=$CC"
fi
# Remove old cache file to clear previous settings.
rm -f "CMakeCache.txt"
cmake "$SRC_DIR/CMakeLists.txt" -B "$DEST_DIR" $EXTRA_OPTIONS -DADDITIONAL_CHECK_TYPES="$CHECK_TYPE" -G "Unix Makefiles"
cmake --build "$DEST_DIR"
;;
esac
fi
##############
# Test Phase #
##############
if [ "$PHASE" = "all" ] || [ "$PHASE" = "test" ]
then
case $BUILD_SYSTEM in
autotools)
cd "$DEST_DIR"
# If the tests fail, copy the test logs into the artifacts folder
if make check
then
:
else
mkdir -p "$SRC_DIR/build-aux/artifacts/$ARTIFACTS_DIR_NAME"
cp ./tests/*.log "$SRC_DIR/build-aux/artifacts/$ARTIFACTS_DIR_NAME"
exit 1
fi
;;
cmake)
cd "$DEST_DIR"
if make test
then
:
else
mkdir -p "$SRC_DIR/build-aux/artifacts/$ARTIFACTS_DIR_NAME"
cp ./Testing/Temporary/*.log "$SRC_DIR/build-aux/artifacts/$ARTIFACTS_DIR_NAME"
exit 1
fi
;;
esac
fi

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
# SPDX-License-Identifier: 0BSD #
############################################################################### ###############################################################################
# #
# Wrapper for GNU groff to convert man pages to a few formats # Wrapper for GNU groff to convert man pages to a few formats
@ -18,6 +17,9 @@
# #
# Author: Lasse Collin # Author: Lasse Collin
# #
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
############################################################################### ###############################################################################
FORMAT=$1 FORMAT=$1
@ -36,10 +38,10 @@ s/^\\.PD\$/.PD $PD/"
case $FORMAT in case $FORMAT in
ascii) ascii)
groff -t -mandoc -Tascii -P-c | col -bx groff -t -mandoc -Tascii | col -bx
;; ;;
utf8) utf8)
groff -t -mandoc -Tutf8 -P-c | col -bx groff -t -mandoc -Tutf8 | col -bx
;; ;;
ps) ps)
sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \ sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
# SPDX-License-Identifier: 0BSD #
############################################################################# #############################################################################
# #
# Get the version string from version.h and print it out without # Get the version string from version.h and print it out without
@ -10,6 +9,9 @@
# #
# Author: Lasse Collin # Author: Lasse Collin
# #
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
############################################################################# #############################################################################
sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/ sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/
@ -19,4 +21,4 @@ sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/
src/liblzma/api/lzma/version.h \ src/liblzma/api/lzma/version.h \
| tr '\n' '|' \ | tr '\n' '|' \
| sed 's/|/./; s/|/./; s/|//g' \ | sed 's/|/./; s/|/./; s/|//g' \
| tr -d '\r\n' | tr -d '\n'

View File

@ -1,25 +0,0 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# remove-ordinals.cmake
#
# Removes the ordinal numbers from a DEF file that has been created by
# GNU ld or LLVM lld option --output-def (when creating a Windows DLL).
# This should be equivalent: sed 's/ \+@ *[0-9]\+//'
#
# Usage:
#
# cmake -DINPUT_FILE=infile.def.in \
# -DOUTPUT_FILE=outfile.def \
# -P remove-ordinals.cmake
#
#############################################################################
#
# Author: Lasse Collin
#
#############################################################################
file(READ "${INPUT_FILE}" STR)
string(REGEX REPLACE " +@ *[0-9]+" "" STR "${STR}")
file(WRITE "${OUTPUT_FILE}" "${STR}")

View File

@ -1,50 +0,0 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_common.cmake - common functions and macros for tuklib_*.cmake files
#
# Author: Lasse Collin
#
#############################################################################
function(tuklib_add_definitions TARGET_OR_ALL DEFINITIONS)
# DEFINITIONS may be an empty string/list but it's fine here. There is
# no need to quote ${DEFINITIONS} as empty arguments are fine here.
if(TARGET_OR_ALL STREQUAL "ALL")
add_compile_definitions(${DEFINITIONS})
else()
target_compile_definitions("${TARGET_OR_ALL}" PRIVATE ${DEFINITIONS})
endif()
endfunction()
function(tuklib_add_definition_if TARGET_OR_ALL VAR)
if(${VAR})
tuklib_add_definitions("${TARGET_OR_ALL}" "${VAR}")
endif()
endfunction()
# This is an over-simplified version of AC_USE_SYSTEM_EXTENSIONS in Autoconf
# or gl_USE_SYSTEM_EXTENSIONS in gnulib.
macro(tuklib_use_system_extensions TARGET_OR_ALL)
if(NOT WIN32)
# FIXME? The Solaris-specific __EXTENSIONS__ should be conditional
# even on Solaris. See gnulib: git log m4/extensions.m4.
# FIXME? gnulib and autoconf.git has lots of new stuff.
tuklib_add_definitions("${TARGET_OR_ALL}"
_GNU_SOURCE
__EXTENSIONS__
_POSIX_PTHREAD_SEMANTICS
_TANDEM_SOURCE
_ALL_SOURCE
)
list(APPEND CMAKE_REQUIRED_DEFINITIONS
-D_GNU_SOURCE
-D__EXTENSIONS__
-D_POSIX_PTHREAD_SEMANTICS
-D_TANDEM_SOURCE
-D_ALL_SOURCE
)
endif()
endmacro()

View File

@ -1,181 +0,0 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_cpucores.cmake - see tuklib_cpucores.m4 for description and comments
#
# Author: Lasse Collin
#
#############################################################################
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckCSourceCompiles)
include(CheckIncludeFile)
function(tuklib_cpucores_internal_check)
if(WIN32 OR CYGWIN)
# Nothing to do, the tuklib_cpucores.c handles it.
set(TUKLIB_CPUCORES_DEFINITIONS "" CACHE INTERNAL "")
return()
endif()
# glibc-based systems (GNU/Linux and GNU/kFreeBSD) have
# sched_getaffinity(). The CPU_COUNT() macro was added in glibc 2.9.
# glibc 2.9 is old enough that if someone uses the code on older glibc,
# the fallback to sysconf() should be good enough.
#
# NOTE: This required that _GNU_SOURCE is defined. We assume that whatever
# feature test macros the caller wants to use are already set in
# CMAKE_REQUIRED_DEFINES and in the target defines.
check_c_source_compiles("
#include <sched.h>
int main(void)
{
cpu_set_t cpu_mask;
sched_getaffinity(0, sizeof(cpu_mask), &cpu_mask);
return CPU_COUNT(&cpu_mask);
}
"
TUKLIB_CPUCORES_SCHED_GETAFFINITY)
if(TUKLIB_CPUCORES_SCHED_GETAFFINITY)
set(TUKLIB_CPUCORES_DEFINITIONS
"TUKLIB_CPUCORES_SCHED_GETAFFINITY"
CACHE INTERNAL "")
return()
endif()
# FreeBSD has both cpuset and sysctl. Look for cpuset first because
# it's a better approach.
#
# This test would match on GNU/kFreeBSD too but it would require
# -lfreebsd-glue when linking and thus in the current form this would
# fail on GNU/kFreeBSD. The above test for sched_getaffinity() matches
# on GNU/kFreeBSD so the test below should never run on that OS.
check_c_source_compiles("
#include <sys/param.h>
#include <sys/cpuset.h>
int main(void)
{
cpuset_t set;
cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1,
sizeof(set), &set);
return 0;
}
"
TUKLIB_CPUCORES_CPUSET)
if(TUKLIB_CPUCORES_CPUSET)
set(TUKLIB_CPUCORES_DEFINITIONS "HAVE_PARAM_H;TUKLIB_CPUCORES_CPUSET"
CACHE INTERNAL "")
return()
endif()
# On OS/2, both sysconf() and sysctl() pass the tests in this file,
# but only sysctl() works. On QNX it's the opposite: only sysconf() works
# (although it assumes that _POSIX_SOURCE, _XOPEN_SOURCE, and
# _POSIX_C_SOURCE are undefined or alternatively _QNX_SOURCE is defined).
#
# We test sysctl() first and intentionally break the sysctl() test on QNX
# so that sysctl() is never used on QNX.
check_include_file(sys/param.h HAVE_SYS_PARAM_H)
if(HAVE_SYS_PARAM_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_PARAM_H)
endif()
check_c_source_compiles("
#ifdef __QNX__
compile error
#endif
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/sysctl.h>
int main(void)
{
#ifdef HW_NCPUONLINE
/* This is preferred on OpenBSD, see tuklib_cpucores.c. */
int name[2] = { CTL_HW, HW_NCPUONLINE };
#else
int name[2] = { CTL_HW, HW_NCPU };
#endif
int cpus;
size_t cpus_size = sizeof(cpus);
sysctl(name, 2, &cpus, &cpus_size, NULL, 0);
return 0;
}
"
TUKLIB_CPUCORES_SYSCTL)
if(TUKLIB_CPUCORES_SYSCTL)
if(HAVE_SYS_PARAM_H)
set(TUKLIB_CPUCORES_DEFINITIONS
"HAVE_PARAM_H;TUKLIB_CPUCORES_SYSCTL"
CACHE INTERNAL "")
else()
set(TUKLIB_CPUCORES_DEFINITIONS
"TUKLIB_CPUCORES_SYSCTL"
CACHE INTERNAL "")
endif()
return()
endif()
# Many platforms support sysconf().
check_c_source_compiles("
#include <unistd.h>
int main(void)
{
long i;
#ifdef _SC_NPROCESSORS_ONLN
/* Many systems using sysconf() */
i = sysconf(_SC_NPROCESSORS_ONLN);
#else
/* IRIX */
i = sysconf(_SC_NPROC_ONLN);
#endif
return 0;
}
"
TUKLIB_CPUCORES_SYSCONF)
if(TUKLIB_CPUCORES_SYSCONF)
set(TUKLIB_CPUCORES_DEFINITIONS "TUKLIB_CPUCORES_SYSCONF"
CACHE INTERNAL "")
return()
endif()
# HP-UX
check_c_source_compiles("
#include <sys/param.h>
#include <sys/pstat.h>
int main(void)
{
struct pst_dynamic pst;
pstat_getdynamic(&pst, sizeof(pst), 1, 0);
(void)pst.psd_proc_cnt;
return 0;
}
"
TUKLIB_CPUCORES_PSTAT_GETDYNAMIC)
if(TUKLIB_CPUCORES_PSTAT_GETDYNAMIC)
set(TUKLIB_CPUCORES_DEFINITIONS "TUKLIB_CPUCORES_PSTAT_GETDYNAMIC"
CACHE INTERNAL "")
return()
endif()
endfunction()
function(tuklib_cpucores TARGET_OR_ALL)
if(NOT DEFINED TUKLIB_CPUCORES_FOUND)
message(STATUS
"Checking how to detect the number of available CPU cores")
tuklib_cpucores_internal_check()
if(DEFINED TUKLIB_CPUCORES_DEFINITIONS)
set(TUKLIB_CPUCORES_FOUND 1 CACHE INTERNAL "")
else()
set(TUKLIB_CPUCORES_FOUND 0 CACHE INTERNAL "")
message(WARNING
"No method to detect the number of CPU cores was found")
endif()
endif()
if(TUKLIB_CPUCORES_FOUND)
tuklib_add_definitions("${TARGET_OR_ALL}"
"${TUKLIB_CPUCORES_DEFINITIONS}")
endif()
endfunction()

View File

@ -1,141 +0,0 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_integer.cmake - see tuklib_integer.m4 for description and comments
#
# Author: Lasse Collin
#
#############################################################################
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(TestBigEndian)
include(CheckCSourceCompiles)
include(CheckIncludeFile)
include(CheckSymbolExists)
function(tuklib_integer TARGET_OR_ALL)
# Check for endianness. Unlike the Autoconf's AC_C_BIGENDIAN, this doesn't
# support Apple universal binaries. The CMake module will leave the
# variable unset so we can catch that situation here instead of continuing
# as if we were little endian.
test_big_endian(WORDS_BIGENDIAN)
if(NOT DEFINED WORDS_BIGENDIAN)
message(FATAL_ERROR "Cannot determine endianness")
endif()
tuklib_add_definition_if("${TARGET_OR_ALL}" WORDS_BIGENDIAN)
# Look for a byteswapping method.
check_c_source_compiles("
int main(void)
{
__builtin_bswap16(1);
__builtin_bswap32(1);
__builtin_bswap64(1);
return 0;
}
"
HAVE___BUILTIN_BSWAPXX)
if(HAVE___BUILTIN_BSWAPXX)
tuklib_add_definitions("${TARGET_OR_ALL}" HAVE___BUILTIN_BSWAPXX)
else()
check_include_file(byteswap.h HAVE_BYTESWAP_H)
if(HAVE_BYTESWAP_H)
tuklib_add_definitions("${TARGET_OR_ALL}" HAVE_BYTESWAP_H)
check_symbol_exists(bswap_16 byteswap.h HAVE_BSWAP_16)
tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_BSWAP_16)
check_symbol_exists(bswap_32 byteswap.h HAVE_BSWAP_32)
tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_BSWAP_32)
check_symbol_exists(bswap_64 byteswap.h HAVE_BSWAP_64)
tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_BSWAP_64)
else()
check_include_file(sys/endian.h HAVE_SYS_ENDIAN_H)
if(HAVE_SYS_ENDIAN_H)
tuklib_add_definitions("${TARGET_OR_ALL}" HAVE_SYS_ENDIAN_H)
else()
check_include_file(sys/byteorder.h HAVE_SYS_BYTEORDER_H)
tuklib_add_definition_if("${TARGET_OR_ALL}"
HAVE_SYS_BYTEORDER_H)
endif()
endif()
endif()
# Guess that unaligned access is fast on these archs:
# - 32/64-bit x86 / x86-64
# - 32/64-bit big endian PowerPC
# - 64-bit little endian PowerPC
# - Some 32-bit ARM
# - Some 64-bit ARM64 (AArch64)
# - Some 32/64-bit RISC-V
#
# CMake doesn't provide a standardized/normalized list of processor arch
# names. For example, x86-64 may be "x86_64" (Linux), "AMD64" (Windows),
# or even "EM64T" (64-bit WinXP).
set(FAST_UNALIGNED_GUESS OFF)
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" PROCESSOR)
# There is no ^ in the first regex branch to allow "i" at the beginning
# so it can match "i386" to "i786", and "x86_64".
if(PROCESSOR MATCHES "[x34567]86|^x64|^amd64|^em64t")
set(FAST_UNALIGNED_GUESS ON)
elseif(PROCESSOR MATCHES "^powerpc|^ppc")
if(WORDS_BIGENDIAN OR PROCESSOR MATCHES "64")
set(FAST_UNALIGNED_GUESS ON)
endif()
elseif(PROCESSOR MATCHES "^arm|^aarch64|^riscv")
# On 32-bit and 64-bit ARM, GCC and Clang
# #define __ARM_FEATURE_UNALIGNED if
# unaligned access is supported.
#
# Exception: GCC at least up to 13.2.0
# defines it even when using -mstrict-align
# so in that case this autodetection goes wrong.
# Most of the time -mstrict-align isn't used so it
# shouldn't be a common problem in practice. See:
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111555
#
# RISC-V C API Specification says that if
# __riscv_misaligned_fast is defined then
# unaligned access is known to be fast.
#
# MSVC is handled as a special case: We assume that
# 32/64-bit ARM supports fast unaligned access.
# If MSVC gets RISC-V support then this will assume
# fast unaligned access on RISC-V too.
check_c_source_compiles("
#if !defined(__ARM_FEATURE_UNALIGNED) \
&& !defined(__riscv_misaligned_fast) \
&& !defined(_MSC_VER)
compile error
#endif
int main(void) { return 0; }
"
TUKLIB_FAST_UNALIGNED_DEFINED_BY_PREPROCESSOR)
if(TUKLIB_FAST_UNALIGNED_DEFINED_BY_PREPROCESSOR)
set(FAST_UNALIGNED_GUESS ON)
endif()
endif()
option(TUKLIB_FAST_UNALIGNED_ACCESS
"Enable if the system supports *fast* unaligned memory access \
with 16-bit, 32-bit, and 64-bit integers."
"${FAST_UNALIGNED_GUESS}")
tuklib_add_definition_if("${TARGET_OR_ALL}" TUKLIB_FAST_UNALIGNED_ACCESS)
# Unsafe type punning:
option(TUKLIB_USE_UNSAFE_TYPE_PUNNING
"This introduces strict aliasing violations and \
may result in broken code. However, this might improve performance \
in some cases, especially with old compilers \
(e.g. GCC 3 and early 4.x on x86, GCC < 6 on ARMv6 and ARMv7)."
OFF)
tuklib_add_definition_if("${TARGET_OR_ALL}" TUKLIB_USE_UNSAFE_TYPE_PUNNING)
# Check for GCC/Clang __builtin_assume_aligned().
check_c_source_compiles(
"int main(void) { __builtin_assume_aligned(\"\", 1); return 0; }"
HAVE___BUILTIN_ASSUME_ALIGNED)
tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE___BUILTIN_ASSUME_ALIGNED)
endfunction()

View File

@ -1,53 +0,0 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_large_file_support.cmake
#
# If off_t is less than 64 bits by default and -D_FILE_OFFSET_BITS=64
# makes off_t become 64-bit, the CMake option LARGE_FILE_SUPPORT is
# provided (ON by default) and -D_FILE_OFFSET_BITS=64 is added to
# the compile definitions if LARGE_FILE_SUPPORT is ON.
#
# Author: Lasse Collin
#
#############################################################################
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckCSourceCompiles)
function(tuklib_large_file_support TARGET_OR_ALL)
# MSVC must be handled specially in the C code.
if(MSVC)
return()
endif()
set(TUKLIB_LARGE_FILE_SUPPORT_TEST
"#include <sys/types.h>
int foo[sizeof(off_t) >= 8 ? 1 : -1];
int main(void) { return 0; }")
check_c_source_compiles("${TUKLIB_LARGE_FILE_SUPPORT_TEST}"
TUKLIB_LARGE_FILE_SUPPORT_BY_DEFAULT)
if(NOT TUKLIB_LARGE_FILE_SUPPORT_BY_DEFAULT)
cmake_push_check_state()
# This needs -D.
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
check_c_source_compiles("${TUKLIB_LARGE_FILE_SUPPORT_TEST}"
TUKLIB_LARGE_FILE_SUPPORT_WITH_FOB64)
cmake_pop_check_state()
endif()
if(TUKLIB_LARGE_FILE_SUPPORT_WITH_FOB64)
# Show the option only when _FILE_OFFSET_BITS=64 affects sizeof(off_t).
option(LARGE_FILE_SUPPORT
"Use -D_FILE_OFFSET_BITS=64 to support files larger than 2 GiB."
ON)
if(LARGE_FILE_SUPPORT)
# This must not use -D.
tuklib_add_definitions("${TARGET_OR_ALL}" "_FILE_OFFSET_BITS=64")
endif()
endif()
endfunction()

View File

@ -1,21 +0,0 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_mbstr.cmake - see tuklib_mbstr.m4 for description and comments
#
# Author: Lasse Collin
#
#############################################################################
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckSymbolExists)
function(tuklib_mbstr TARGET_OR_ALL)
check_symbol_exists(mbrtowc wchar.h HAVE_MBRTOWC)
tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_MBRTOWC)
# NOTE: wcwidth() requires _GNU_SOURCE or _XOPEN_SOURCE on GNU/Linux.
check_symbol_exists(wcwidth wchar.h HAVE_WCWIDTH)
tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_WCWIDTH)
endfunction()

View File

@ -1,151 +0,0 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_physmem.cmake - see tuklib_physmem.m4 for description and comments
#
# NOTE: Compared tuklib_physmem.m4, this lacks support for Tru64, IRIX, and
# Linux sysinfo() (usually sysconf() is used on GNU/Linux).
#
# Author: Lasse Collin
#
#############################################################################
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckCSourceCompiles)
include(CheckIncludeFile)
function(tuklib_physmem_internal_check)
# Shortcut on Windows:
if(WIN32 OR CYGWIN)
# Nothing to do, the tuklib_physmem.c handles it.
set(TUKLIB_PHYSMEM_DEFINITIONS "" CACHE INTERNAL "")
return()
endif()
# Full check for special cases:
check_c_source_compiles("
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) \
|| defined(__DJGPP__) || defined(__VMS) \
|| defined(AMIGA) || defined(__AROS__) || defined(__QNX__)
int main(void) { return 0; }
#else
compile error
#endif
"
TUKLIB_PHYSMEM_SPECIAL)
if(TUKLIB_PHYSMEM_SPECIAL)
# Nothing to do, the tuklib_physmem.c handles it.
set(TUKLIB_PHYSMEM_DEFINITIONS "" CACHE INTERNAL "")
return()
endif()
# Look for AIX-specific solution before sysconf(), because the test
# for sysconf() will pass on AIX but won't actually work
# (sysconf(_SC_PHYS_PAGES) compiles but always returns -1 on AIX).
check_c_source_compiles("
#include <sys/systemcfg.h>
int main(void)
{
(void)_system_configuration.physmem;
return 0;
}
"
TUKLIB_PHYSMEM_AIX)
if(TUKLIB_PHYSMEM_AIX)
set(TUKLIB_PHYSMEM_DEFINITIONS "TUKLIB_PHYSMEM_AIX" CACHE INTERNAL "")
return()
endif()
# sysconf()
check_c_source_compiles("
#include <unistd.h>
int main(void)
{
long i;
i = sysconf(_SC_PAGESIZE);
i = sysconf(_SC_PHYS_PAGES);
return 0;
}
"
TUKLIB_PHYSMEM_SYSCONF)
if(TUKLIB_PHYSMEM_SYSCONF)
set(TUKLIB_PHYSMEM_DEFINITIONS "TUKLIB_PHYSMEM_SYSCONF"
CACHE INTERNAL "")
return()
endif()
# sysctl()
check_include_file(sys/param.h HAVE_SYS_PARAM_H)
if(HAVE_SYS_PARAM_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_PARAM_H)
endif()
check_c_source_compiles("
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/sysctl.h>
int main(void)
{
int name[2] = { CTL_HW, HW_PHYSMEM };
unsigned long mem;
size_t mem_ptr_size = sizeof(mem);
sysctl(name, 2, &mem, &mem_ptr_size, NULL, 0);
return 0;
}
"
TUKLIB_PHYSMEM_SYSCTL)
if(TUKLIB_PHYSMEM_SYSCTL)
if(HAVE_SYS_PARAM_H)
set(TUKLIB_PHYSMEM_DEFINITIONS
"HAVE_PARAM_H;TUKLIB_PHYSMEM_SYSCTL"
CACHE INTERNAL "")
else()
set(TUKLIB_PHYSMEM_DEFINITIONS
"TUKLIB_PHYSMEM_SYSCTL"
CACHE INTERNAL "")
endif()
return()
endif()
# HP-UX
check_c_source_compiles("
#include <sys/param.h>
#include <sys/pstat.h>
int main(void)
{
struct pst_static pst;
pstat_getstatic(&pst, sizeof(pst), 1, 0);
(void)pst.physical_memory;
(void)pst.page_size;
return 0;
}
"
TUKLIB_PHYSMEM_PSTAT_GETSTATIC)
if(TUKLIB_PHYSMEM_PSTAT_GETSTATIC)
set(TUKLIB_PHYSMEM_DEFINITIONS "TUKLIB_PHYSMEM_PSTAT_GETSTATIC"
CACHE INTERNAL "")
return()
endif()
endfunction()
function(tuklib_physmem TARGET_OR_ALL)
if(NOT DEFINED TUKLIB_PHYSMEM_FOUND)
message(STATUS "Checking how to detect the amount of physical memory")
tuklib_physmem_internal_check()
if(DEFINED TUKLIB_PHYSMEM_DEFINITIONS)
set(TUKLIB_PHYSMEM_FOUND 1 CACHE INTERNAL "")
else()
set(TUKLIB_PHYSMEM_FOUND 0 CACHE INTERNAL "")
message(WARNING
"No method to detect the amount of physical memory was found")
endif()
endif()
if(TUKLIB_PHYSMEM_FOUND)
tuklib_add_definitions("${TARGET_OR_ALL}"
"${TUKLIB_PHYSMEM_DEFINITIONS}")
endif()
endfunction()

View File

@ -1,19 +0,0 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_progname.cmake - see tuklib_progname.m4 for description and comments
#
# Author: Lasse Collin
#
#############################################################################
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckSymbolExists)
function(tuklib_progname TARGET_OR_ALL)
# NOTE: This glibc extension requires _GNU_SOURCE.
check_symbol_exists(program_invocation_name errno.h
HAVE_PROGRAM_INVOCATION_NAME)
tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_PROGRAM_INVOCATION_NAME)
endfunction()

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,9 @@
## SPDX-License-Identifier: 0BSD ##
## Author: Lasse Collin ## Author: Lasse Collin
##
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
EXTRA_DIST = \ EXTRA_DIST = \
translation.bash translation.bash

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
/// \file crc32.c /// \file crc32.c
@ -7,6 +5,9 @@
// //
// Author: Lasse Collin // Author: Lasse Collin
// //
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h" #include "sysdefs.h"

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
/// \file full_flush.c /// \file full_flush.c
@ -7,14 +5,15 @@
// //
// Author: Lasse Collin // Author: Lasse Collin
// //
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h" #include "sysdefs.h"
#include "lzma.h" #include "lzma.h"
#include <stdio.h> #include <stdio.h>
#define CHUNK 64
static lzma_stream strm = LZMA_STREAM_INIT; static lzma_stream strm = LZMA_STREAM_INIT;
static FILE *file_in; static FILE *file_in;
@ -23,6 +22,7 @@ static FILE *file_in;
static void static void
encode(size_t size, lzma_action action) encode(size_t size, lzma_action action)
{ {
static const size_t CHUNK = 64;
uint8_t in[CHUNK]; uint8_t in[CHUNK];
uint8_t out[CHUNK]; uint8_t out[CHUNK];
lzma_ret ret; lzma_ret ret;

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
/// \file hex2bin.c /// \file hex2bin.c
@ -7,6 +5,9 @@
// //
// Author: Lasse Collin // Author: Lasse Collin
// //
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h" #include "sysdefs.h"

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
/// \file known_sizes.c /// \file known_sizes.c
@ -11,6 +9,9 @@
// //
// Author: Lasse Collin // Author: Lasse Collin
// //
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h" #include "sysdefs.h"

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
/// \file memusage.c /// \file memusage.c
@ -7,6 +5,9 @@
// //
// Author: Lasse Collin // Author: Lasse Collin
// //
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h" #include "sysdefs.h"

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
/// \file repeat.c /// \file repeat.c
@ -11,6 +9,9 @@
// //
// Author: Lasse Collin // Author: Lasse Collin
// //
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h" #include "sysdefs.h"

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
/// \file sync_flush.c /// \file sync_flush.c
@ -7,14 +5,15 @@
// //
// Author: Lasse Collin // Author: Lasse Collin
// //
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h" #include "sysdefs.h"
#include "lzma.h" #include "lzma.h"
#include <stdio.h> #include <stdio.h>
#define CHUNK 64
static lzma_stream strm = LZMA_STREAM_INIT; static lzma_stream strm = LZMA_STREAM_INIT;
static FILE *file_in; static FILE *file_in;
@ -23,6 +22,7 @@ static FILE *file_in;
static void static void
encode(size_t size, lzma_action action) encode(size_t size, lzma_action action)
{ {
static const size_t CHUNK = 64;
uint8_t in[CHUNK]; uint8_t in[CHUNK];
uint8_t out[CHUNK]; uint8_t out[CHUNK];
lzma_ret ret; lzma_ret ret;

View File

@ -1,5 +1,4 @@
#!/bin/bash #!/bin/bash
# SPDX-License-Identifier: 0BSD
############################################################################### ###############################################################################
# #
@ -21,6 +20,9 @@
# #
# Author: Lasse Collin # Author: Lasse Collin
# #
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
############################################################################### ###############################################################################
set -e set -e

View File

@ -25,7 +25,3 @@ List of examples
a custom filter chain a custom filter chain
(x86 BCJ + LZMA2) (x86 BCJ + LZMA2)
04_compress_easy_mt.c Multi-threaded multi-call
compression using a compression
preset

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
/// \file 01_compress_easy.c /// \file 01_compress_easy.c
@ -11,6 +9,9 @@
// //
// Author: Lasse Collin // Author: Lasse Collin
// //
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h> #include <stdbool.h>
@ -26,7 +27,7 @@ show_usage_and_exit(const char *argv0)
{ {
fprintf(stderr, "Usage: %s PRESET < INFILE > OUTFILE\n" fprintf(stderr, "Usage: %s PRESET < INFILE > OUTFILE\n"
"PRESET is a number 0-9 and can optionally be " "PRESET is a number 0-9 and can optionally be "
"followed by 'e' to indicate extreme preset\n", "followed by `e' to indicate extreme preset\n",
argv0); argv0);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -172,7 +173,7 @@ compress(lzma_stream *strm, FILE *infile, FILE *outfile)
lzma_ret ret = lzma_code(strm, action); lzma_ret ret = lzma_code(strm, action);
// If the output buffer is full or if the compression finished // If the output buffer is full or if the compression finished
// successfully, write the data from the output buffer to // successfully, write the data from the output bufffer to
// the output file. // the output file.
if (strm->avail_out == 0 || ret == LZMA_STREAM_END) { if (strm->avail_out == 0 || ret == LZMA_STREAM_END) {
// When lzma_code() has returned LZMA_STREAM_END, // When lzma_code() has returned LZMA_STREAM_END,

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
/// \file 02_decompress.c /// \file 02_decompress.c
@ -11,6 +9,9 @@
// //
// Author: Lasse Collin // Author: Lasse Collin
// //
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h> #include <stdbool.h>
@ -137,7 +138,7 @@ decompress(lzma_stream *strm, const char *inname, FILE *infile, FILE *outfile)
// Once the end of the input file has been reached, // Once the end of the input file has been reached,
// we need to tell lzma_code() that no more input // we need to tell lzma_code() that no more input
// will be coming. As said before, this isn't required // will be coming. As said before, this isn't required
// if the LZMA_CONCATENATED flag isn't used when // if the LZMA_CONATENATED flag isn't used when
// initializing the decoder. // initializing the decoder.
if (feof(infile)) if (feof(infile))
action = LZMA_FINISH; action = LZMA_FINISH;

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
/// \file 03_compress_custom.c /// \file 03_compress_custom.c
@ -11,6 +9,9 @@
// //
// Author: Lasse Collin // Author: Lasse Collin
// //
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h> #include <stdbool.h>
@ -27,8 +28,8 @@ init_encoder(lzma_stream *strm)
// Use the default preset (6) for LZMA2. // Use the default preset (6) for LZMA2.
// //
// The lzma_options_lzma structure and the lzma_lzma_preset() function // The lzma_options_lzma structure and the lzma_lzma_preset() function
// are declared in lzma/lzma12.h (src/liblzma/api/lzma/lzma12.h in the // are declared in lzma/lzma.h (src/liblzma/api/lzma/lzma.h in the
// source package or e.g. /usr/include/lzma/lzma12.h depending on // source package or e.g. /usr/include/lzma/lzma.h depending on
// the install prefix). // the install prefix).
lzma_options_lzma opt_lzma2; lzma_options_lzma opt_lzma2;
if (lzma_lzma_preset(&opt_lzma2, LZMA_PRESET_DEFAULT)) { if (lzma_lzma_preset(&opt_lzma2, LZMA_PRESET_DEFAULT)) {
@ -47,7 +48,7 @@ init_encoder(lzma_stream *strm)
// Now we could customize the LZMA2 options if we wanted. For example, // Now we could customize the LZMA2 options if we wanted. For example,
// we could set the the dictionary size (opt_lzma2.dict_size) to // we could set the the dictionary size (opt_lzma2.dict_size) to
// something else than the default (8 MiB) of the default preset. // something else than the default (8 MiB) of the default preset.
// See lzma/lzma12.h for details of all LZMA2 options. // See lzma/lzma.h for details of all LZMA2 options.
// //
// The x86 BCJ filter will try to modify the x86 instruction stream so // The x86 BCJ filter will try to modify the x86 instruction stream so
// that LZMA2 can compress it better. The x86 BCJ filter doesn't need // that LZMA2 can compress it better. The x86 BCJ filter doesn't need

View File

@ -1,205 +0,0 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file 04_compress_easy_mt.c
/// \brief Compress in multi-call mode using LZMA2 in multi-threaded mode
///
/// Usage: ./04_compress_easy_mt < INFILE > OUTFILE
///
/// Example: ./04_compress_easy_mt < foo > foo.xz
//
// Author: Lasse Collin
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <lzma.h>
static bool
init_encoder(lzma_stream *strm)
{
// The threaded encoder takes the options as pointer to
// a lzma_mt structure.
lzma_mt mt = {
// No flags are needed.
.flags = 0,
// Let liblzma determine a sane block size.
.block_size = 0,
// Use no timeout for lzma_code() calls by setting timeout
// to zero. That is, sometimes lzma_code() might block for
// a long time (from several seconds to even minutes).
// If this is not OK, for example due to progress indicator
// needing updates, specify a timeout in milliseconds here.
// See the documentation of lzma_mt in lzma/container.h for
// information how to choose a reasonable timeout.
.timeout = 0,
// Use the default preset (6) for LZMA2.
// To use a preset, filters must be set to NULL.
.preset = LZMA_PRESET_DEFAULT,
.filters = NULL,
// Use CRC64 for integrity checking. See also
// 01_compress_easy.c about choosing the integrity check.
.check = LZMA_CHECK_CRC64,
};
// Detect how many threads the CPU supports.
mt.threads = lzma_cputhreads();
// If the number of CPU cores/threads cannot be detected,
// use one thread. Note that this isn't the same as the normal
// single-threaded mode as this will still split the data into
// blocks and use more RAM than the normal single-threaded mode.
// You may want to consider using lzma_easy_encoder() or
// lzma_stream_encoder() instead of lzma_stream_encoder_mt() if
// lzma_cputhreads() returns 0 or 1.
if (mt.threads == 0)
mt.threads = 1;
// If the number of CPU cores/threads exceeds threads_max,
// limit the number of threads to keep memory usage lower.
// The number 8 is arbitrarily chosen and may be too low or
// high depending on the compression preset and the computer
// being used.
//
// FIXME: A better way could be to check the amount of RAM
// (or available RAM) and use lzma_stream_encoder_mt_memusage()
// to determine if the number of threads should be reduced.
const uint32_t threads_max = 8;
if (mt.threads > threads_max)
mt.threads = threads_max;
// Initialize the threaded encoder.
lzma_ret ret = lzma_stream_encoder_mt(strm, &mt);
if (ret == LZMA_OK)
return true;
const char *msg;
switch (ret) {
case LZMA_MEM_ERROR:
msg = "Memory allocation failed";
break;
case LZMA_OPTIONS_ERROR:
// We are no longer using a plain preset so this error
// message has been edited accordingly compared to
// 01_compress_easy.c.
msg = "Specified filter chain is not supported";
break;
case LZMA_UNSUPPORTED_CHECK:
msg = "Specified integrity check is not supported";
break;
default:
msg = "Unknown error, possibly a bug";
break;
}
fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n",
msg, ret);
return false;
}
// This function is identical to the one in 01_compress_easy.c.
static bool
compress(lzma_stream *strm, FILE *infile, FILE *outfile)
{
lzma_action action = LZMA_RUN;
uint8_t inbuf[BUFSIZ];
uint8_t outbuf[BUFSIZ];
strm->next_in = NULL;
strm->avail_in = 0;
strm->next_out = outbuf;
strm->avail_out = sizeof(outbuf);
while (true) {
if (strm->avail_in == 0 && !feof(infile)) {
strm->next_in = inbuf;
strm->avail_in = fread(inbuf, 1, sizeof(inbuf),
infile);
if (ferror(infile)) {
fprintf(stderr, "Read error: %s\n",
strerror(errno));
return false;
}
if (feof(infile))
action = LZMA_FINISH;
}
lzma_ret ret = lzma_code(strm, action);
if (strm->avail_out == 0 || ret == LZMA_STREAM_END) {
size_t write_size = sizeof(outbuf) - strm->avail_out;
if (fwrite(outbuf, 1, write_size, outfile)
!= write_size) {
fprintf(stderr, "Write error: %s\n",
strerror(errno));
return false;
}
strm->next_out = outbuf;
strm->avail_out = sizeof(outbuf);
}
if (ret != LZMA_OK) {
if (ret == LZMA_STREAM_END)
return true;
const char *msg;
switch (ret) {
case LZMA_MEM_ERROR:
msg = "Memory allocation failed";
break;
case LZMA_DATA_ERROR:
msg = "File size limits exceeded";
break;
default:
msg = "Unknown error, possibly a bug";
break;
}
fprintf(stderr, "Encoder error: %s (error code %u)\n",
msg, ret);
return false;
}
}
}
extern int
main(void)
{
lzma_stream strm = LZMA_STREAM_INIT;
bool success = init_encoder(&strm);
if (success)
success = compress(&strm, stdin, stdout);
lzma_end(&strm);
if (fclose(stdout)) {
fprintf(stderr, "Write error: %s\n", strerror(errno));
success = false;
}
return success ? EXIT_SUCCESS : EXIT_FAILURE;
}

View File

@ -1,205 +0,0 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file 11_file_info.c
/// \brief Get uncompressed size of .xz file(s)
///
/// Usage: ./11_file_info INFILE1.xz [INFILEn.xz]...
///
/// Example: ./11_file_info foo.xz
//
// Author: Lasse Collin
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>
#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <lzma.h>
static bool
print_file_size(lzma_stream *strm, FILE *infile, const char *filename)
{
// Get the file size. In standard C it can be done by seeking to
// the end of the file and then getting the file position.
// In POSIX one can use fstat() and then st_size from struct stat.
// Also note that fseek() and ftell() use long and thus don't support
// large files on 32-bit systems (POSIX versions fseeko() and
// ftello() can support large files).
if (fseek(infile, 0, SEEK_END)) {
fprintf(stderr, "Error seeking the file '%s': %s\n",
filename, strerror(errno));
return false;
}
const long file_size = ftell(infile);
// The decoder wants to start from the beginning of the .xz file.
rewind(infile);
// Initialize the decoder.
lzma_index *i;
lzma_ret ret = lzma_file_info_decoder(strm, &i, UINT64_MAX,
(uint64_t)file_size);
switch (ret) {
case LZMA_OK:
// Initialization succeeded.
break;
case LZMA_MEM_ERROR:
fprintf(stderr, "Out of memory when initializing "
"the .xz file info decoder\n");
return false;
case LZMA_PROG_ERROR:
default:
fprintf(stderr, "Unknown error, possibly a bug\n");
return false;
}
// This example program reuses the same lzma_stream structure
// for multiple files, so we need to reset this when starting
// a new file.
strm->avail_in = 0;
// Buffer for input data.
uint8_t inbuf[BUFSIZ];
// Pass data to the decoder and seek when needed.
while (true) {
if (strm->avail_in == 0) {
strm->next_in = inbuf;
strm->avail_in = fread(inbuf, 1, sizeof(inbuf),
infile);
if (ferror(infile)) {
fprintf(stderr,
"Error reading from '%s': %s\n",
filename, strerror(errno));
return false;
}
// We don't need to care about hitting the end of
// the file so no need to check for feof().
}
ret = lzma_code(strm, LZMA_RUN);
switch (ret) {
case LZMA_OK:
break;
case LZMA_SEEK_NEEDED:
// The cast is safe because liblzma won't ask us to
// seek past the known size of the input file which
// did fit into a long.
//
// NOTE: Remember to change these to off_t if you
// switch fseeko() or lseek().
if (fseek(infile, (long)(strm->seek_pos), SEEK_SET)) {
fprintf(stderr, "Error seeking the "
"file '%s': %s\n",
filename, strerror(errno));
return false;
}
// The old data in the inbuf is useless now. Set
// avail_in to zero so that we will read new input
// from the new file position on the next iteration
// of this loop.
strm->avail_in = 0;
break;
case LZMA_STREAM_END:
// File information was successfully decoded.
// See <lzma/index.h> for functions that can be
// used on it. In this example we just print
// the uncompressed size (in bytes) of
// the .xz file followed by its file name.
printf("%10" PRIu64 " %s\n",
lzma_index_uncompressed_size(i),
filename);
// Free the memory of the lzma_index structure.
lzma_index_end(i, NULL);
return true;
case LZMA_FORMAT_ERROR:
// .xz magic bytes weren't found.
fprintf(stderr, "The file '%s' is not "
"in the .xz format\n", filename);
return false;
case LZMA_OPTIONS_ERROR:
fprintf(stderr, "The file '%s' has .xz headers that "
"are not supported by this liblzma "
"version\n", filename);
return false;
case LZMA_DATA_ERROR:
fprintf(stderr, "The file '%s' is corrupt\n",
filename);
return false;
case LZMA_MEM_ERROR:
fprintf(stderr, "Memory allocation failed when "
"decoding the file '%s'\n", filename);
return false;
// LZMA_MEMLIMIT_ERROR shouldn't happen because we used
// UINT64_MAX as the limit.
//
// LZMA_BUF_ERROR shouldn't happen because we always provide
// new input when the input buffer is empty. The decoder
// knows the input file size and thus won't try to read past
// the end of the file.
case LZMA_MEMLIMIT_ERROR:
case LZMA_BUF_ERROR:
case LZMA_PROG_ERROR:
default:
fprintf(stderr, "Unknown error, possibly a bug\n");
return false;
}
}
// This line is never reached.
}
extern int
main(int argc, char **argv)
{
bool success = true;
lzma_stream strm = LZMA_STREAM_INIT;
for (int i = 1; i < argc; ++i) {
FILE *infile = fopen(argv[i], "rb");
if (infile == NULL) {
fprintf(stderr, "Cannot open the file '%s': %s\n",
argv[i], strerror(errno));
success = false;
}
success &= print_file_size(&strm, infile, argv[i]);
(void)fclose(infile);
}
lzma_end(&strm);
// Close stdout to catch possible write errors that can occur
// when pending data is flushed from the stdio buffers.
if (fclose(stdout)) {
fprintf(stderr, "Write error: %s\n", strerror(errno));
success = false;
}
return success ? EXIT_SUCCESS : EXIT_FAILURE;
}

View File

@ -1,5 +1,9 @@
# SPDX-License-Identifier: 0BSD #
# Author: Lasse Collin # Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
CC = c99 CC = c99
CFLAGS = -g CFLAGS = -g
@ -8,9 +12,7 @@ LDFLAGS = -llzma
PROGS = \ PROGS = \
01_compress_easy \ 01_compress_easy \
02_decompress \ 02_decompress \
03_compress_custom \ 03_compress_custom
04_compress_easy_mt \
11_file_info
all: $(PROGS) all: $(PROGS)

View File

@ -0,0 +1,127 @@
/*
* xz_pipe_comp.c
* A simple example of pipe-only xz compressor implementation.
* version: 2010-07-12 - by Daniel Mealha Cabrita
* Not copyrighted -- provided to the public domain.
*
* Compiling:
* Link with liblzma. GCC example:
* $ gcc -llzma xz_pipe_comp.c -o xz_pipe_comp
*
* Usage example:
* $ cat some_file | ./xz_pipe_comp > some_file.xz
*/
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdbool.h>
#include <lzma.h>
/* COMPRESSION SETTINGS */
/* analogous to xz CLI options: -0 to -9 */
#define COMPRESSION_LEVEL 6
/* boolean setting, analogous to xz CLI option: -e */
#define COMPRESSION_EXTREME true
/* see: /usr/include/lzma/check.h LZMA_CHECK_* */
#define INTEGRITY_CHECK LZMA_CHECK_CRC64
/* read/write buffer sizes */
#define IN_BUF_MAX 4096
#define OUT_BUF_MAX 4096
/* error codes */
#define RET_OK 0
#define RET_ERROR_INIT 1
#define RET_ERROR_INPUT 2
#define RET_ERROR_OUTPUT 3
#define RET_ERROR_COMPRESSION 4
/* note: in_file and out_file must be open already */
int xz_compress (FILE *in_file, FILE *out_file)
{
uint32_t preset = COMPRESSION_LEVEL | (COMPRESSION_EXTREME ? LZMA_PRESET_EXTREME : 0);
lzma_check check = INTEGRITY_CHECK;
lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */
uint8_t in_buf [IN_BUF_MAX];
uint8_t out_buf [OUT_BUF_MAX];
size_t in_len; /* length of useful data in in_buf */
size_t out_len; /* length of useful data in out_buf */
bool in_finished = false;
bool out_finished = false;
lzma_action action;
lzma_ret ret_xz;
int ret;
ret = RET_OK;
/* initialize xz encoder */
ret_xz = lzma_easy_encoder (&strm, preset, check);
if (ret_xz != LZMA_OK) {
fprintf (stderr, "lzma_easy_encoder error: %d\n", (int) ret_xz);
return RET_ERROR_INIT;
}
while ((! in_finished) && (! out_finished)) {
/* read incoming data */
in_len = fread (in_buf, 1, IN_BUF_MAX, in_file);
if (feof (in_file)) {
in_finished = true;
}
if (ferror (in_file)) {
in_finished = true;
ret = RET_ERROR_INPUT;
}
strm.next_in = in_buf;
strm.avail_in = in_len;
/* if no more data from in_buf, flushes the
internal xz buffers and closes the xz data
with LZMA_FINISH */
action = in_finished ? LZMA_FINISH : LZMA_RUN;
/* loop until there's no pending compressed output */
do {
/* out_buf is clean at this point */
strm.next_out = out_buf;
strm.avail_out = OUT_BUF_MAX;
/* compress data */
ret_xz = lzma_code (&strm, action);
if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) {
fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz);
out_finished = true;
ret = RET_ERROR_COMPRESSION;
} else {
/* write compressed data */
out_len = OUT_BUF_MAX - strm.avail_out;
fwrite (out_buf, 1, out_len, out_file);
if (ferror (out_file)) {
out_finished = true;
ret = RET_ERROR_OUTPUT;
}
}
} while (strm.avail_out == 0);
}
lzma_end (&strm);
return ret;
}
int main ()
{
int ret;
ret = xz_compress (stdin, stdout);
return ret;
}

View File

@ -0,0 +1,123 @@
/*
* xz_pipe_decomp.c
* A simple example of pipe-only xz decompressor implementation.
* version: 2012-06-14 - by Daniel Mealha Cabrita
* Not copyrighted -- provided to the public domain.
*
* Compiling:
* Link with liblzma. GCC example:
* $ gcc -llzma xz_pipe_decomp.c -o xz_pipe_decomp
*
* Usage example:
* $ cat some_file.xz | ./xz_pipe_decomp > some_file
*/
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdbool.h>
#include <lzma.h>
/* read/write buffer sizes */
#define IN_BUF_MAX 4096
#define OUT_BUF_MAX 4096
/* error codes */
#define RET_OK 0
#define RET_ERROR_INIT 1
#define RET_ERROR_INPUT 2
#define RET_ERROR_OUTPUT 3
#define RET_ERROR_DECOMPRESSION 4
/* note: in_file and out_file must be open already */
int xz_decompress (FILE *in_file, FILE *out_file)
{
lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */
const uint32_t flags = LZMA_TELL_UNSUPPORTED_CHECK | LZMA_CONCATENATED;
const uint64_t memory_limit = UINT64_MAX; /* no memory limit */
uint8_t in_buf [IN_BUF_MAX];
uint8_t out_buf [OUT_BUF_MAX];
size_t in_len; /* length of useful data in in_buf */
size_t out_len; /* length of useful data in out_buf */
bool in_finished = false;
bool out_finished = false;
lzma_action action;
lzma_ret ret_xz;
int ret;
ret = RET_OK;
/* initialize xz decoder */
ret_xz = lzma_stream_decoder (&strm, memory_limit, flags);
if (ret_xz != LZMA_OK) {
fprintf (stderr, "lzma_stream_decoder error: %d\n", (int) ret_xz);
return RET_ERROR_INIT;
}
while ((! in_finished) && (! out_finished)) {
/* read incoming data */
in_len = fread (in_buf, 1, IN_BUF_MAX, in_file);
if (feof (in_file)) {
in_finished = true;
}
if (ferror (in_file)) {
in_finished = true;
ret = RET_ERROR_INPUT;
}
strm.next_in = in_buf;
strm.avail_in = in_len;
/* if no more data from in_buf, flushes the
internal xz buffers and closes the decompressed data
with LZMA_FINISH */
action = in_finished ? LZMA_FINISH : LZMA_RUN;
/* loop until there's no pending decompressed output */
do {
/* out_buf is clean at this point */
strm.next_out = out_buf;
strm.avail_out = OUT_BUF_MAX;
/* decompress data */
ret_xz = lzma_code (&strm, action);
if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) {
fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz);
out_finished = true;
ret = RET_ERROR_DECOMPRESSION;
} else {
/* write decompressed data */
out_len = OUT_BUF_MAX - strm.avail_out;
fwrite (out_buf, 1, out_len, out_file);
if (ferror (out_file)) {
out_finished = true;
ret = RET_ERROR_OUTPUT;
}
}
} while (strm.avail_out == 0);
}
/* Bug fix (2012-06-14): If no errors were detected, check
that the last lzma_code() call returned LZMA_STREAM_END.
If not, the file is probably truncated. */
if ((ret == RET_OK) && (ret_xz != LZMA_STREAM_END)) {
fprintf (stderr, "Input truncated or corrupt\n");
ret = RET_ERROR_DECOMPRESSION;
}
lzma_end (&strm);
return ret;
}
int main ()
{
int ret;
ret = xz_decompress (stdin, stdout);
return ret;
}

View File

@ -33,7 +33,7 @@ A: 7-Zip and LZMA SDK are the original projects. LZMA SDK is roughly
LZMA Utils. LZMA Utils.
There are several other projects using LZMA. Most are more or less There are several other projects using LZMA. Most are more or less
based on LZMA SDK. See <https://7-zip.org/links.html>. based on LZMA SDK. See <http://7-zip.org/links.html>.
Q: Why is liblzma named liblzma if its primary file format is .xz? Q: Why is liblzma named liblzma if its primary file format is .xz?
@ -115,6 +115,7 @@ Q: I cannot find BCJ and BCJ2 filters. Don't they exist in liblzma?
A: BCJ filter is called "x86" in liblzma. BCJ2 is not included, A: BCJ filter is called "x86" in liblzma. BCJ2 is not included,
because it requires using more than one encoded output stream. because it requires using more than one encoded output stream.
A streamable version of BCJ2-style filtering is planned.
Q: I need to use a script that runs "xz -9". On a system with 256 MiB Q: I need to use a script that runs "xz -9". On a system with 256 MiB
@ -153,15 +154,19 @@ A: See the documentation in XZ Embedded. In short, something like
dictionary doesn't increase memory usage. dictionary doesn't increase memory usage.
Q: How is multi-threaded compression implemented in XZ Utils? Q: Will xz support threaded compression?
A: The simplest method is splitting the uncompressed data into blocks A: It is planned and has been taken into account when designing
the .xz file format. Eventually there will probably be three types
of threading, each method having its own advantages and disadvantages.
The simplest method is splitting the uncompressed data into blocks
and compressing them in parallel independent from each other. and compressing them in parallel independent from each other.
This is currently the only threading method supported in XZ Utils.
Since the blocks are compressed independently, they can also be Since the blocks are compressed independently, they can also be
decompressed independently. Together with the index feature in .xz, decompressed independently. Together with the index feature in .xz,
this allows using threads to create .xz files for random-access this allows using threads to create .xz files for random-access
reading. This also makes threaded decompression possible. reading. This also makes threaded decompression possible, although
it is not clear if threaded decompression will ever be implemented.
The independent blocks method has a couple of disadvantages too. It The independent blocks method has a couple of disadvantages too. It
will compress worse than a single-block method. Often the difference will compress worse than a single-block method. Often the difference
@ -169,17 +174,15 @@ A: The simplest method is splitting the uncompressed data into blocks
the memory usage of the compressor increases linearly when adding the memory usage of the compressor increases linearly when adding
threads. threads.
At least two other threading methods are possible but these haven't Match finder parallelization is another threading method. It has
been implemented in XZ Utils: been in 7-Zip for ages. It doesn't affect compression ratio or
memory usage significantly. Among the three threading methods, only
Match finder parallelization has been in 7-Zip for ages. It doesn't this is useful when compressing small files (files that are not
affect compression ratio or memory usage significantly. Among the significantly bigger than the dictionary). Unfortunately this method
three threading methods, only this is useful when compressing small scales only to about two CPU cores.
files (files that are not significantly bigger than the dictionary).
Unfortunately this method scales only to about two CPU cores.
The third method is pigz-style threading (I use that name, because The third method is pigz-style threading (I use that name, because
pigz <https://www.zlib.net/pigz/> uses that method). It doesn't pigz <http://www.zlib.net/pigz/> uses that method). It doesn't
affect compression ratio significantly and scales to many cores. affect compression ratio significantly and scales to many cores.
The memory usage scales linearly when threads are added. This isn't The memory usage scales linearly when threads are added. This isn't
significant with pigz, because Deflate uses only a 32 KiB dictionary, significant with pigz, because Deflate uses only a 32 KiB dictionary,
@ -190,35 +193,12 @@ A: The simplest method is splitting the uncompressed data into blocks
cores the overhead is not a big deal anymore. cores the overhead is not a big deal anymore.
Combining the threading methods will be possible and also useful. Combining the threading methods will be possible and also useful.
For example, combining match finder parallelization with pigz-style E.g. combining match finder parallelization with pigz-style threading
threading or independent-blocks-threading can cut the memory usage can cut the memory usage by 50 %.
by 50 %.
It is possible that the single-threaded method will be modified to
Q: I told xz to use many threads but it is using only one or two create files identical to the pigz-style method. We'll see once
processor cores. What is wrong? pigz-style threading has been implemented in liblzma.
A: Since multi-threaded compression is done by splitting the data into
blocks that are compressed individually, if the input file is too
small for the block size, then many threads cannot be used. The
default block size increases when the compression level is
increased. For example, xz -6 uses 8 MiB LZMA2 dictionary and
24 MiB blocks, and xz -9 uses 64 MiB LZMA dictionary and 192 MiB
blocks. If the input file is 100 MiB, xz -6 can use five threads
of which one will finish quickly as it has only 4 MiB to compress.
However, for the same file, xz -9 can only use one thread.
One can adjust block size with --block-size=SIZE but making the
block size smaller than LZMA2 dictionary is waste of RAM: using
xz -9 with 6 MiB blocks isn't any better than using xz -6 with
6 MiB blocks. The default settings use a block size bigger than
the LZMA2 dictionary size because this was seen as a reasonable
compromise between RAM usage and compression ratio.
When decompressing, the ability to use threads depends on how the
file was created. If it was created in multi-threaded mode then
it can be decompressed in multi-threaded mode too if there are
multiple blocks in the file.
Q: How do I build a program that needs liblzmadec (lzmadec.h)? Q: How do I build a program that needs liblzmadec (lzmadec.h)?
@ -226,7 +206,7 @@ Q: How do I build a program that needs liblzmadec (lzmadec.h)?
A: liblzmadec is part of LZMA Utils. XZ Utils has liblzma, but no A: liblzmadec is part of LZMA Utils. XZ Utils has liblzma, but no
liblzmadec. The code using liblzmadec should be ported to use liblzmadec. The code using liblzmadec should be ported to use
liblzma instead. If you cannot or don't want to do that, download liblzma instead. If you cannot or don't want to do that, download
LZMA Utils from <https://tukaani.org/lzma/>. LZMA Utils from <http://tukaani.org/lzma/>.
Q: The default build of liblzma is too big. How can I make it smaller? Q: The default build of liblzma is too big. How can I make it smaller?
@ -240,5 +220,5 @@ A: Give --enable-small to the configure script. Use also appropriate
If the result is still too big, take a look at XZ Embedded. It is If the result is still too big, take a look at XZ Embedded. It is
a separate project, which provides a limited but significantly a separate project, which provides a limited but significantly
smaller XZ decoder implementation than XZ Utils. You can find it smaller XZ decoder implementation than XZ Utils. You can find it
at <https://xz.tukaani.org/xz-embedded/>. at <http://tukaani.org/xz/embedded.html>.

View File

@ -40,11 +40,7 @@ The .lzma File Format
0.2. Changes 0.2. Changes
Last modified: 2024-01-16 18:00+0800 Last modified: 2011-04-12 11:55+0300
Compared to the previous version (2022-07-13 21:00+0300)
the section 2 was modified to change links from http to
https and to update XZ links.
1. File Format 1. File Format
@ -133,10 +129,7 @@ The .lzma File Format
Uncompressed Size is stored as unsigned 64-bit little endian Uncompressed Size is stored as unsigned 64-bit little endian
integer. A special value of 0xFFFF_FFFF_FFFF_FFFF indicates integer. A special value of 0xFFFF_FFFF_FFFF_FFFF indicates
that Uncompressed Size is unknown. End of Payload Marker (*) that Uncompressed Size is unknown. End of Payload Marker (*)
is used if Uncompressed Size is unknown. End of Payload Marker is used if and only if Uncompressed Size is unknown.
is allowed but rarely used if Uncompressed Size is known.
XZ Utils 5.2.5 and older don't support .lzma files that have
End of Payload Marker together with a known Uncompressed Size.
XZ Utils rejects files whose Uncompressed Size field specifies XZ Utils rejects files whose Uncompressed Size field specifies
a known size that is 256 GiB or more. This is to reject false a known size that is 256 GiB or more. This is to reject false
@ -157,17 +150,17 @@ The .lzma File Format
2. References 2. References
LZMA SDK - The original LZMA implementation LZMA SDK - The original LZMA implementation
https://7-zip.org/sdk.html http://7-zip.org/sdk.html
7-Zip 7-Zip
https://7-zip.org/ http://7-zip.org/
LZMA Utils - LZMA adapted to POSIX-like systems LZMA Utils - LZMA adapted to POSIX-like systems
https://tukaani.org/lzma/ http://tukaani.org/lzma/
XZ Utils - The next generation of LZMA Utils XZ Utils - The next generation of LZMA Utils
https://xz.tukaani.org/xz-utils/ http://tukaani.org/xz/
The .xz file format - The successor of the .lzma format The .xz file format - The successor of the .lzma format
https://xz.tukaani.org/format/xz-file-format.txt http://tukaani.org/xz/xz-file-format.txt

View File

@ -2,7 +2,7 @@
The .xz File Format The .xz File Format
=================== ===================
Version 1.2.0 (2024-01-19) Version 1.0.4 (2009-08-27)
0. Preface 0. Preface
@ -81,26 +81,18 @@ Version 1.2.0 (2024-01-19)
0.2. Getting the Latest Version 0.2. Getting the Latest Version
The latest official version of this document can be downloaded The latest official version of this document can be downloaded
from <https://xz.tukaani.org/format/xz-file-format.txt>. from <http://tukaani.org/xz/xz-file-format.txt>.
Specific versions of this document have a filename Specific versions of this document have a filename
xz-file-format-X.Y.Z.txt where X.Y.Z is the version number. xz-file-format-X.Y.Z.txt where X.Y.Z is the version number.
For example, the version 1.0.0 of this document is available For example, the version 1.0.0 of this document is available
at <https://xz.tukaani.org/format/xz-file-format-1.0.0.txt>. at <http://tukaani.org/xz/xz-file-format-1.0.0.txt>.
0.3. Version History 0.3. Version History
Version Date Description Version Date Description
1.2.0 2024-01-19 Added RISC-V filter and updated URLs in
Sections 0.2 and 7. The URL of this
specification was changed.
1.1.0 2022-12-11 Added ARM64 filter and clarified 32-bit
ARM endianness in Section 5.3.2,
language improvements in Section 5.4
1.0.4 2009-08-27 Language improvements in Sections 1.2, 1.0.4 2009-08-27 Language improvements in Sections 1.2,
2.1.1.2, 3.1.1, 3.1.2, and 5.3.1 2.1.1.2, 3.1.1, 3.1.2, and 5.3.1
@ -923,21 +915,9 @@ Version 1.2.0 (2024-01-19)
0x04 1 byte x86 filter (BCJ) 0x04 1 byte x86 filter (BCJ)
0x05 4 bytes PowerPC (big endian) filter 0x05 4 bytes PowerPC (big endian) filter
0x06 16 bytes IA64 filter 0x06 16 bytes IA64 filter
0x07 4 bytes ARM filter [1] 0x07 4 bytes ARM (little endian) filter
0x08 2 bytes ARM Thumb filter [1] 0x08 2 bytes ARM Thumb (little endian) filter
0x09 4 bytes SPARC filter 0x09 4 bytes SPARC filter
0x0A 4 bytes ARM64 filter [2]
0x0B 2 bytes RISC-V filter
[1] These are for little endian instruction encoding.
This must not be confused with data endianness.
A processor configured for big endian data access
may still use little endian instruction encoding.
The filters don't care about the data endianness.
[2] 4096-byte alignment gives the best results
because the address in the ADRP instruction
is a multiple of 4096 bytes.
If the size of Filter Properties is four bytes, the Filter If the size of Filter Properties is four bytes, the Filter
Properties field contains the start offset used for address Properties field contains the start offset used for address
@ -1007,12 +987,12 @@ Version 1.2.0 (2024-01-19)
5.4. Custom Filter IDs 5.4. Custom Filter IDs
If a developer wants to use custom Filter IDs, there are two If a developer wants to use custom Filter IDs, he has two
choices. The first choice is to contact Lasse Collin and ask choices. The first choice is to contact Lasse Collin and ask
him to allocate a range of IDs for the developer. him to allocate a range of IDs for the developer.
The second choice is to generate a 40-bit random integer The second choice is to generate a 40-bit random integer,
which the developer can use as a personal Developer ID. which the developer can use as his personal Developer ID.
To minimize the risk of collisions, Developer ID has to be To minimize the risk of collisions, Developer ID has to be
a randomly generated integer, not manually selected "hex word". a randomly generated integer, not manually selected "hex word".
The following command, which works on many free operating The following command, which works on many free operating
@ -1020,7 +1000,7 @@ Version 1.2.0 (2024-01-19)
dd if=/dev/urandom bs=5 count=1 | hexdump dd if=/dev/urandom bs=5 count=1 | hexdump
The developer can then use the Developer ID to create unique The developer can then use his Developer ID to create unique
(well, hopefully unique) Filter IDs. (well, hopefully unique) Filter IDs.
Bits Mask Description Bits Mask Description
@ -1141,30 +1121,30 @@ Version 1.2.0 (2024-01-19)
7. References 7. References
LZMA SDK - The original LZMA implementation LZMA SDK - The original LZMA implementation
https://7-zip.org/sdk.html http://7-zip.org/sdk.html
LZMA Utils - LZMA adapted to POSIX-like systems LZMA Utils - LZMA adapted to POSIX-like systems
https://tukaani.org/lzma/ http://tukaani.org/lzma/
XZ Utils - The next generation of LZMA Utils XZ Utils - The next generation of LZMA Utils
https://xz.tukaani.org/xz-utils/ http://tukaani.org/xz/
[RFC-1952] [RFC-1952]
GZIP file format specification version 4.3 GZIP file format specification version 4.3
https://www.ietf.org/rfc/rfc1952.txt http://www.ietf.org/rfc/rfc1952.txt
- Notation of byte boxes in section "2.1. Overall conventions" - Notation of byte boxes in section "2.1. Overall conventions"
[RFC-2119] [RFC-2119]
Key words for use in RFCs to Indicate Requirement Levels Key words for use in RFCs to Indicate Requirement Levels
https://www.ietf.org/rfc/rfc2119.txt http://www.ietf.org/rfc/rfc2119.txt
[GNU-tar] [GNU-tar]
GNU tar 1.35 manual GNU tar 1.21 manual
https://www.gnu.org/software/tar/manual/html_node/Blocking-Factor.html http://www.gnu.org/software/tar/manual/html_node/Blocking-Factor.html
- Node 9.4.2 "Blocking Factor", paragraph that begins - Node 9.4.2 "Blocking Factor", paragraph that begins
"gzip will complain about trailing garbage" "gzip will complain about trailing garbage"
- Note that this URL points to the latest version of the - Note that this URL points to the latest version of the
manual, and may some day not contain the note which is in manual, and may some day not contain the note which is in
1.35. For the exact version of the manual, download GNU 1.21. For the exact version of the manual, download GNU
tar 1.35: ftp://ftp.gnu.org/pub/gnu/tar/tar-1.35.tar.gz tar 1.21: ftp://ftp.gnu.org/pub/gnu/tar/tar-1.21.tar.gz

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -1,78 +0,0 @@
Building XZ Utils for DOS
=========================
Introduction
This document explains how to build XZ Utils for DOS using DJGPP.
The resulting binaries should run at least on various DOS versions
and under Windows 95/98/98SE/ME.
This is somewhat experimental and has got very little testing.
Note: Makefile and config.h are updated only now and then. This
means that if you checked out a development version, building for
DOS might not work without updating Makefile and config.h first.
Getting and Installing DJGPP
You may use <https://www.delorie.com/djgpp/zip-picker.html> to help
deciding what to download. If you are only interested in building
XZ Utils, the zip-picker may list files that you don't strictly
need. However, using the zip-picker can still be worth it to get a
nice short summary of installation instructions (they can be found
from readme.1st too).
For a more manual method, first select a mirror from
<https://www.delorie.com/djgpp/getting.html> and go the
subdirectory named "current". You need the following files:
unzip32.exe (if you don't already have a LFN-capable unzipper)
v2/djdev205.zip
v2gnu/bnu234b.zip
v2gnu/gcc920b.zip
v2gnu/mak43b.zip
v2misc/csdpmi7b.zip
If newer versions are available, probably you should try them first.
Note that versions older than djdev205.zip aren't supported. Also
note that you want csdpmi7b.zip even if you run under Windows or
DOSEMU because the XZ Utils Makefile will embed cwsdstub.exe to
the resulting xz.exe.
See the instructions in readme.1st found from djdev205.zip. Here's
a short summary, but you should still read readme.1st.
C:\> mkdir DJGPP
C:\> cd DJGPP
C:\DJGPP> c:\download\unzip32 c:\download\djdev205.zip
C:\DJGPP> c:\download\unzip32 c:\download\bnu234b.zip
C:\DJGPP> c:\download\unzip32 c:\download\gcc920b.zip
C:\DJGPP> c:\download\unzip32 c:\download\mak43b.zip
C:\DJGPP> c:\download\unzip32 c:\download\csdpmi7b.zip
C:\DJGPP> set PATH=C:\DJGPP\BIN;%PATH%
C:\DJGPP> set DJGPP=C:\DJGPP\DJGPP.ENV
You may want to add the last two lines into AUTOEXEC.BAT or have,
for example, DJGPP.BAT which you can run before using DJGPP.
Make sure you use completely upper case path in the DJGPP environment
variable. This is not required by DJGPP, but the XZ Utils Makefile is
a bit stupid and expects that everything in DJGPP environment variable
is uppercase.
Building
You need to have an environment that supports long filenames (LFN).
Once you have built XZ Utils, the resulting binaries can be run
without long filename support.
Run "make" in this directory (the directory containing this
INSTALL.txt). You should get xz.exe (and a bunch of temporary files).
Other tools are not built. Having e.g. xzdec.exe doesn't save much
space compared to xz.exe because the DJGPP runtime makes the .exe
quite big anyway.

View File

@ -1,11 +1,12 @@
# SPDX-License-Identifier: 0BSD
############################################################################### ###############################################################################
# #
# Makefile to build XZ Utils using DJGPP # Makefile to build XZ Utils using DJGPP
# #
# Author: Lasse Collin # Author: Lasse Collin
# #
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
############################################################################### ###############################################################################
# For debugging, set comment "#define NDEBUG 1" from config.h to enable # For debugging, set comment "#define NDEBUG 1" from config.h to enable
@ -17,7 +18,9 @@ CPPFLAGS =
CFLAGS = -g -Wall -Wextra -Wfatal-errors -march=i386 -mtune=i686 -O2 CFLAGS = -g -Wall -Wextra -Wfatal-errors -march=i386 -mtune=i686 -O2
LDFLAGS = -lemu LDFLAGS = -lemu
ALL_CFLAGS = -std=gnu99 # NOTE: -fgnu89-inline is needed on DJGPP 2.04 beta and GCC >= 4.3.0
# because time.h uses GNU-style "extern inline".
ALL_CFLAGS = -std=gnu99 -fgnu89-inline
ALL_CPPFLAGS = \ ALL_CPPFLAGS = \
-I. \ -I. \
@ -61,7 +64,6 @@ SRCS_C = \
../src/liblzma/common/block_header_encoder.c \ ../src/liblzma/common/block_header_encoder.c \
../src/liblzma/common/block_util.c \ ../src/liblzma/common/block_util.c \
../src/liblzma/common/common.c \ ../src/liblzma/common/common.c \
../src/liblzma/common/file_info.c \
../src/liblzma/common/filter_common.c \ ../src/liblzma/common/filter_common.c \
../src/liblzma/common/filter_decoder.c \ ../src/liblzma/common/filter_decoder.c \
../src/liblzma/common/filter_encoder.c \ ../src/liblzma/common/filter_encoder.c \
@ -72,13 +74,11 @@ SRCS_C = \
../src/liblzma/common/index_decoder.c \ ../src/liblzma/common/index_decoder.c \
../src/liblzma/common/index_encoder.c \ ../src/liblzma/common/index_encoder.c \
../src/liblzma/common/index_hash.c \ ../src/liblzma/common/index_hash.c \
../src/liblzma/common/lzip_decoder.c \
../src/liblzma/common/stream_decoder.c \ ../src/liblzma/common/stream_decoder.c \
../src/liblzma/common/stream_encoder.c \ ../src/liblzma/common/stream_encoder.c \
../src/liblzma/common/stream_flags_common.c \ ../src/liblzma/common/stream_flags_common.c \
../src/liblzma/common/stream_flags_decoder.c \ ../src/liblzma/common/stream_flags_decoder.c \
../src/liblzma/common/stream_flags_encoder.c \ ../src/liblzma/common/stream_flags_encoder.c \
../src/liblzma/common/string_conversion.c \
../src/liblzma/common/vli_decoder.c \ ../src/liblzma/common/vli_decoder.c \
../src/liblzma/common/vli_encoder.c \ ../src/liblzma/common/vli_encoder.c \
../src/liblzma/common/vli_size.c \ ../src/liblzma/common/vli_size.c \
@ -98,7 +98,6 @@ SRCS_C = \
../src/liblzma/lzma/lzma_encoder_presets.c \ ../src/liblzma/lzma/lzma_encoder_presets.c \
../src/liblzma/rangecoder/price_table.c \ ../src/liblzma/rangecoder/price_table.c \
../src/liblzma/simple/arm.c \ ../src/liblzma/simple/arm.c \
../src/liblzma/simple/arm64.c \
../src/liblzma/simple/armthumb.c \ ../src/liblzma/simple/armthumb.c \
../src/liblzma/simple/ia64.c \ ../src/liblzma/simple/ia64.c \
../src/liblzma/simple/powerpc.c \ ../src/liblzma/simple/powerpc.c \
@ -114,7 +113,6 @@ SRCS_C = \
../src/xz/list.c \ ../src/xz/list.c \
../src/xz/main.c \ ../src/xz/main.c \
../src/xz/message.c \ ../src/xz/message.c \
../src/xz/mytime.c \
../src/xz/options.c \ ../src/xz/options.c \
../src/xz/signals.c \ ../src/xz/signals.c \
../src/xz/suffix.c \ ../src/xz/suffix.c \

88
dos/README Normal file
View File

@ -0,0 +1,88 @@
XZ Utils on DOS
===============
Introduction
This document explains how to build XZ Utils for DOS using DJGPP.
The resulting binaries should run at least on various DOS versions
and under Windows 95/98/98SE/ME, although the Windows version of
XZ Utils is recommended under Windows 95 and later.
This is currently experimental and has got very little testing.
Note: Makefile and config.h are updated only now and then. This
means that especially if you checked out a development version,
building for DOS probably won't work without updating Makefile
and config.h first.
Getting and Installing DJGPP
You may use <http://www.delorie.com/djgpp/zip-picker.html> to help
deciding what to download, but as of writing (2010-10-09) that may
not be the most convenient way taking into account what components
are actually required to build XZ Utils. However, using the
zip-picker can still be worth doing to get nice short summary of
installation instructions (they can be found from readme.1st too).
For a more manual method, first select a mirror from
<http://www.delorie.com/djgpp/getting.html>. You need
the following files:
unzip32.exe (if you don't already have a LFN-capable unzipper)
beta/v2/djdev204.zip
v2gnu/bnu219b.zip
v2gnu/gcc444b.zip
v2gnu/mak3791b.zip
v2misc/csdpmi7b.zip
If newer versions are available, probably you should try them first.
Note that djdev203.zip is too old to build XZ Utils; you need at
least djdev204.zip. Also note that you want csdpmi7b.zip even if you
run under Windows or DOSEMU, because the XZ Utils Makefile will embed
cwsdstub.exe to the resulting binaries.
See the instructions in readme.1st found from djdev204.zip. Here's
a short summary, but you should still read readme.1st.
C:\> mkdir DJGPP
C:\> cd DJGPP
C:\DJGPP> c:\download\unzip32 c:\download\djdev204.zip
C:\DJGPP> c:\download\unzip32 c:\download\bnu219b.zip
C:\DJGPP> c:\download\unzip32 c:\download\gcc444b.zip
C:\DJGPP> c:\download\unzip32 c:\download\mak3791b.zip
C:\DJGPP> c:\download\unzip32 c:\download\csdpmi7b.zip
C:\DJGPP> set PATH=C:\DJGPP\BIN;%PATH%
C:\DJGPP> set DJGPP=C:\DJGPP\DJGPP.ENV
You may want to add the last two lines into AUTOEXEC.BAT or have,
for example, DJGPP.BAT which you can run before using DJGPP.
Make sure you use completely upper case path in the DJGPP environment
variable. This is not required by DJGPP, but the XZ Utils Makefile is
a bit stupid and expects that everything in DJGPP environment variable
is uppercase.
Building
You need to have an environment that supports long filenames (LFN).
Once you have built XZ Utils, the resulting binaries can be run
without long filename support.
Run "make" in this directory (the directory containing this README).
You should get xz.exe (and a bunch of temporary files). Other tools
are not built. Having e.g. xzdec.exe doesn't save much space compared
to xz.exe, because the DJGPP runtime makes the .exe quite big anyway.
Bugs
xz doesn't necessarily work in Dosbox. It should work in DOSEMU.
Pressing Ctrl-c or Ctrl-Break won't remove the incomplete target file
when running under Windows XP Command Prompt (something goes wrong
with SIGINT handling). It works correctly under Windows 95/98/98SE/ME.

View File

@ -1,123 +0,0 @@
XZ Utils on DOS
===============
DOS-specific filename handling
xz detects at runtime if long filename (LFN) support is
available and will use it by default. It can be disabled by
setting an environment variable:
set lfn=n
When xz is in LFN mode, it behaves pretty much the same as it
does on other operating systems. Examples:
xz foo.tar -> foo.tar.xz
xz -d foo.tar.xz -> foo.tar
xz -F lzma foo.tar -> foo.tar.lzma
xz -d foo.tar.lzma -> foo.tar
When LFN support isn't available or it is disabled with LFN=n
environment setting, xz works in short filename (SFN) mode. This
affects filename suffix handling when compressing.
When compressing to the .xz format in SFN mode:
- Files without an extension get .xz just like on LFN systems.
- *.tar files become *.txz (shorthand for *.tar.xz). *.txz
is recognized by xz on all supported operating systems.
(Try to avoid confusing this with gzipped .txt files.)
- Files with 1-3 character extension have their extension modified
so that the last character is a dash ("-"). If the extension
is already three characters, the last character is lost. The
resulting *.?- or *.??- filename is recognized in LFN mode, but
it isn't recognized by xz on other operating systems.
Examples:
xz foo -> foo.xz | xz -d foo.xz -> foo
xz foo.tar -> foo.txz | xz -d foo.txz -> foo.tar
xz foo.c -> foo.c- | xz -d foo.c- -> foo.c
xz read.me -> read.me- | xz -d read.me- -> read.me
xz foo.txt -> foo.tx- | xz -d foo.tx- -> foo.tx !
Note that in the last example above, the third character of the
filename extension is lost.
When compressing to the legacy .lzma format in SFN mode:
- *.tar files become *.tlz (shorthand for *.tar.lzma). *.tlz
is recognized by xz on all supported operating systems.
- Other files become *.lzm. The original filename extension
is lost. *.lzm is recognized also in LFN mode, but it is not
recognized by xz on other operating systems.
Examples:
xz -F lzma foo -> foo.lzm | xz -d foo.lzm -> foo
xz -F lzma foo.tar -> foo.tlz | xz -d foo.tlz -> foo.tar
xz -F lzma foo.c -> foo.lzm | xz -d foo.lzm -> foo !
xz -F lzma read.me -> read.lzm | xz -d read.lzm -> read !
xz -F lzma foo.txt -> foo.lzm | xz -d foo.lzm -> foo !
When compressing with a custom suffix (-S .SUF, --suffix=.SUF) to
any file format:
- If the suffix begins with a dot, the filename extension is
replaced with the new suffix. The original extension is lost.
- If the suffix doesn't begin with a dot and the filename has no
extension and the filename given on the command line doesn't
have a dot at the end, the custom suffix is appended just like
on LFN systems.
- If the suffix doesn't begin with a dot and the filename has
an extension (or an extension-less filename is given with a dot
at the end), the last 1-3 characters of the filename extension
may get overwritten to fit the given custom suffix.
Examples:
xz -S x foo -> foox | xz -dS x foox -> foo
xz -S x foo. -> foo.x | xz -dS x foo.x -> foo
xz -S .x foo -> foo.x | xz -dS .x foo.x -> foo
xz -S .x foo. -> foo.x | xz -dS .x foo.x -> foo
xz -S x.y foo -> foox.y | xz -dS x.y foox.y -> foo
xz -S .a foo.c -> foo.a | xz -dS .a foo.a -> foo !
xz -S a foo.c -> foo.ca | xz -dS a foo.ca -> foo.c
xz -S ab foo.c -> foo.cab | xz -dS ab foo.cab -> foo.c
xz -S ab read.me -> read.mab | xz -dS ab read.mab -> read.m !
xz -S ab foo.txt -> foo.tab | xz -dS ab foo.tab -> foo.t !
xz -S abc foo.txt -> foo.abc | xz -dS abc foo.abc -> foo !
When decompressing, the suffix handling in SFN mode is the same as
in LFN mode. The DOS-specific filenames *.lzm, *.?-, and *.??- are
recognized also in LFN mode.
xz handles certain uncommon situations safely:
- If the generated output filename refers to the same file as
the input file, xz detects this and refuses to compress or
decompress the input file even if --force is used. This can
happen when giving an overlong filename in SFN mode. E.g.
"xz -S x foo.texinfo" would try to write to foo.tex which on
SFN system is the same file as foo.texinfo.
- If the generated output filename is a special file like "con"
or "prn", xz detects this and refuses to compress or decompress
the input file even if --force is used.
Bugs
xz doesn't necessarily work in Dosbox. It should work in DOSEMU.
Pressing Ctrl-c or Ctrl-Break won't remove the incomplete target file
when running under Windows XP Command Prompt (something goes wrong
with SIGINT handling). It works correctly under Windows 95/98/98SE/ME.

View File

@ -1,5 +1,3 @@
/* SPDX-License-Identifier: 0BSD */
/* How many MiB of RAM to assume if the real amount cannot be determined. */ /* How many MiB of RAM to assume if the real amount cannot be determined. */
#define ASSUME_RAM 32 #define ASSUME_RAM 32
@ -12,15 +10,9 @@
/* Define to 1 if sha256 integrity check is enabled. */ /* Define to 1 if sha256 integrity check is enabled. */
#define HAVE_CHECK_SHA256 1 #define HAVE_CHECK_SHA256 1
/* Define to 1 if any of HAVE_DECODER_foo have been defined. */
#define HAVE_DECODERS 1
/* Define to 1 if arm decoder is enabled. */ /* Define to 1 if arm decoder is enabled. */
#define HAVE_DECODER_ARM 1 #define HAVE_DECODER_ARM 1
/* Define to 1 if arm64 decoder is enabled. */
#define HAVE_DECODER_ARM64 1
/* Define to 1 if armthumb decoder is enabled. */ /* Define to 1 if armthumb decoder is enabled. */
#define HAVE_DECODER_ARMTHUMB 1 #define HAVE_DECODER_ARMTHUMB 1
@ -45,15 +37,9 @@
/* Define to 1 if x86 decoder is enabled. */ /* Define to 1 if x86 decoder is enabled. */
#define HAVE_DECODER_X86 1 #define HAVE_DECODER_X86 1
/* Define to 1 if any of HAVE_ENCODER_foo have been defined. */
#define HAVE_ENCODERS 1
/* Define to 1 if arm encoder is enabled. */ /* Define to 1 if arm encoder is enabled. */
#define HAVE_ENCODER_ARM 1 #define HAVE_ENCODER_ARM 1
/* Define to 1 if arm64 encoder is enabled. */
#define HAVE_ENCODER_ARM64 1
/* Define to 1 if armthumb encoder is enabled. */ /* Define to 1 if armthumb encoder is enabled. */
#define HAVE_ENCODER_ARMTHUMB 1 #define HAVE_ENCODER_ARMTHUMB 1
@ -84,9 +70,6 @@
/* Define to 1 if you have the <limits.h> header file. */ /* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1 #define HAVE_LIMITS_H 1
/* Define to 1 if .lz (lzip) decompression support is enabled. */
#define HAVE_LZIP_DECODER 1
/* Define to 1 to enable bt2 match finder. */ /* Define to 1 to enable bt2 match finder. */
#define HAVE_MF_BT2 1 #define HAVE_MF_BT2 1
@ -117,37 +100,29 @@
/* Define to 1 if you have the <sys/time.h> header file. */ /* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1 #define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the 'utimes' function. */ /* Define to 1 if you have the `utimes' function. */
#define HAVE_UTIMES 1 #define HAVE_UTIMES 1
/* Define to 1 or 0, depending whether the compiler supports simple visibility /* Define to 1 or 0, depending whether the compiler supports simple visibility
declarations. */ declarations. */
#define HAVE_VISIBILITY 0 #define HAVE_VISIBILITY 0
/* Define to 1 if the system has the type '_Bool'. */ /* Define to 1 if the system has the type `_Bool'. */
#define HAVE__BOOL 1 #define HAVE__BOOL 1
/* Define to 1 if the GNU C extension __builtin_assume_aligned is supported.
*/
#define HAVE___BUILTIN_ASSUME_ALIGNED 1
/* Define to 1 if the GNU C extensions __builtin_bswap16/32/64 are supported.
*/
#define HAVE___BUILTIN_BSWAPXX 1
/* Define to 1 to disable debugging code. */ /* Define to 1 to disable debugging code. */
#define NDEBUG 1 #define NDEBUG 1
/* Define to the address where bug reports for this package should be sent. */ /* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "xz@tukaani.org" #define PACKAGE_BUGREPORT "lasse.collin@tukaani.org"
/* Define to the full name of this package. */ /* Define to the full name of this package. */
#define PACKAGE_NAME "XZ Utils" #define PACKAGE_NAME "XZ Utils"
/* Define to the home page for this package. */ /* Define to the home page for this package. */
#define PACKAGE_URL "https://xz.tukaani.org/xz-utils/" #define PACKAGE_URL "http://tukaani.org/xz/"
/* The size of 'size_t', as computed by sizeof. */ /* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T 4 #define SIZEOF_SIZE_T 4
/* Define to 1 if the system supports fast unaligned access to 16-bit and /* Define to 1 if the system supports fast unaligned access to 16-bit and

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +0,0 @@
<hr class="footer"/>
<p style="text-align: right;padding-right: 12px;">
XZ logo &copy; 2023 by Jia Tan is licensed under
<a href="COPYING.CC-BY-SA-4.0"
rel="license"
style="display:inline-block;">
CC BY-SA 4.0
</a>
</p>
</body>
</html>

View File

@ -1,109 +0,0 @@
#!/bin/sh
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# Updates the Doxygen generated documentation files in the source tree.
# If the doxygen command is not installed, it will exit with an error.
# This script can generate Doxygen documentation for all source files or for
# just liblzma API header files.
#
# It is recommended to use this script to update the Doxygen-generated HTML
# files since this will include the package version in the output and,
# in case of liblzma API docs, strip JavaScript files from the output.
#
#############################################################################
#
# Authors: Jia Tan
# Lasse Collin
#
#############################################################################
set -e
if type doxygen > /dev/null 2>&1; then
:
else
echo "doxygen/update-doxygen: 'doxygen' command not found." >&2
echo "doxygen/update-doxygen: Skipping Doxygen docs generation." >&2
exit 1
fi
if test ! -f Doxyfile; then
cd `dirname "$0"` || exit 1
if test ! -f Doxyfile; then
echo "doxygen/update-doxygen: Cannot find Doxyfile" >&2
exit 1
fi
fi
# Get the package version so that it can be included in the generated docs.
PACKAGE_VERSION=`cd .. && sh build-aux/version.sh` || exit 1
# If no arguments are specified, default to generating liblzma API header
# documentation only.
case $1 in
'' | api)
# Remove old documentation before re-generating the new.
rm -rf ../doc/api
# Generate the HTML documentation by preparing the Doxyfile
# in stdin and piping the result to the doxygen command.
# With Doxygen, the last assignment of a value to a tag will
# override any earlier assignment. So, we can use this
# feature to override the tags that need to change between
# "api" and "internal" modes.
(
cat Doxyfile
echo "PROJECT_NUMBER = $PACKAGE_VERSION"
) | doxygen -
# As of Doxygen 1.8.0 - 1.9.6 and the Doxyfile options we use,
# the output is good without any JavaScript. Unfortunately
# Doxygen doesn't have an option to disable JavaScript usage
# completely so we strip it away with the hack below.
#
# Omitting the JavaScript code avoids some license hassle
# as jquery.js is fairly big, it contains more than jQuery
# itself, and doesn't include the actual license text (it
# only refers to the MIT license by name).
echo "Stripping JavaScript from Doxygen output..."
for F in ../doc/api/*.html
do
sed 's/<script [^>]*><\/script>//g
s/onclick="[^"]*"//g' \
"$F" > ../doc/api/tmp
mv -f ../doc/api/tmp "$F"
done
rm -f ../doc/api/*.js
;;
internal)
# The docs from internal aren't for distribution so
# the JavaScript files aren't an issue here.
rm -rf ../doc/internal
(
cat Doxyfile
echo "PROJECT_NUMBER = $PACKAGE_VERSION"
echo 'PROJECT_NAME = "XZ Utils"'
echo 'STRIP_FROM_PATH = ../src'
echo 'INPUT = ../src'
echo 'HTML_OUTPUT = internal'
echo 'EXTRACT_PRIVATE = YES'
echo 'EXTRACT_STATIC = YES'
echo 'EXTRACT_LOCAL_CLASSES = YES'
echo 'SEARCHENGINE = YES'
) | doxygen -
;;
*)
echo "doxygen/update-doxygen: Error: mode argument '$1'" \
"is not supported." >&2
echo "doxygen/update-doxygen: Supported modes:" >&2
echo "doxygen/update-doxygen: - 'api' (default):" \
"liblzma API docs into doc/api" >&2
echo "doxygen/update-doxygen: - 'internal':"\
"internal docs into doc/internal" >&2
exit 1
;;
esac

View File

@ -1,6 +1,5 @@
#!/bin/bash #!/bin/bash
# SPDX-License-Identifier: 0BSD #
############################################################################# #############################################################################
# #
# 7z2lzma.bash is very primitive .7z to .lzma converter. The input file must # 7z2lzma.bash is very primitive .7z to .lzma converter. The input file must
@ -18,6 +17,9 @@
# #
# Author: Lasse Collin <lasse.collin@tukaani.org> # Author: Lasse Collin <lasse.collin@tukaani.org>
# #
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
############################################################################# #############################################################################
# You can use 7z or 7za, both will work. # You can use 7z or 7za, both will work.

View File

@ -1,5 +1,3 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/* /*
scanlzma, scan for lzma compressed data in stdin and echo it to stdout. scanlzma, scan for lzma compressed data in stdin and echo it to stdout.
Copyright (C) 2006 Timo Lindfors Copyright (C) 2006 Timo Lindfors
@ -39,10 +37,6 @@
/* 5 8 Uncompressed size (little endian). -1 means unknown size */ /* 5 8 Uncompressed size (little endian). -1 means unknown size */
/* 13 Compressed data */ /* 13 Compressed data */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define BUFSIZE 4096 #define BUFSIZE 4096
int find_lzma_header(unsigned char *buf) { int find_lzma_header(unsigned char *buf) {
@ -54,7 +48,7 @@ int find_lzma_header(unsigned char *buf) {
} }
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
unsigned char buf[BUFSIZE]; char buf[BUFSIZE];
int ret, i, numlzma, blocks=0; int ret, i, numlzma, blocks=0;
if (argc != 2) { if (argc != 2) {

View File

@ -1,5 +1,3 @@
## SPDX-License-Identifier: GPL-2.0-or-later
## ##
## Copyright (C) 2004-2007 Free Software Foundation, Inc. ## Copyright (C) 2004-2007 Free Software Foundation, Inc.
## ##
@ -23,17 +21,7 @@ libgnu_a_SOURCES =
libgnu_a_DEPENDENCIES = $(LIBOBJS) libgnu_a_DEPENDENCIES = $(LIBOBJS)
libgnu_a_LIBADD = $(LIBOBJS) libgnu_a_LIBADD = $(LIBOBJS)
EXTRA_DIST = \ EXTRA_DIST = getopt.in.h getopt.c getopt1.c getopt_int.h
getopt.in.h \
getopt.c \
getopt1.c \
getopt_int.h \
getopt-cdefs.h \
getopt-core.h \
getopt-ext.h \
getopt-pfx-core.h \
getopt-pfx-ext.h
BUILT_SOURCES = $(GETOPT_H) BUILT_SOURCES = $(GETOPT_H)
MOSTLYCLEANFILES = getopt.h getopt.h-t MOSTLYCLEANFILES = getopt.h getopt.h-t

View File

@ -1,72 +0,0 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* getopt-on-non-glibc compatibility macros.
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of gnulib.
Unlike most of the getopt implementation, it is NOT shared
with the GNU C Library.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _GETOPT_CDEFS_H
#define _GETOPT_CDEFS_H 1
/* This header should not be used directly; include getopt.h or
unistd.h instead. It does not have a protective #error, because
the guard macro for getopt.h in gnulib is not fixed. */
/* getopt-core.h and getopt-ext.h are shared with GNU libc, and expect
a number of the internal macros supplied to GNU libc's headers by
sys/cdefs.h. Provide fallback definitions for all of them. */
#ifdef HAVE_SYS_CDEFS_H
# include <sys/cdefs.h>
#endif
#ifndef __BEGIN_DECLS
# ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# else
# define __BEGIN_DECLS /* nothing */
# endif
#endif
#ifndef __END_DECLS
# ifdef __cplusplus
# define __END_DECLS }
# else
# define __END_DECLS /* nothing */
# endif
#endif
#ifndef __GNUC_PREREQ
# if defined __GNUC__ && defined __GNUC_VERSION__
# define __GNUC_PREREQ(maj, min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
# else
# define __GNUC_PREREQ(maj, min) 0
# endif
#endif
#ifndef __THROW
# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
# if __cplusplus >= 201103L
# define __THROW noexcept (true)
# else
# define __THROW throw ()
# endif
# else
# define __THROW
# endif
#endif
#endif /* _GETOPT_CDEFS_H */

View File

@ -1,98 +0,0 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Declarations for getopt (basic, portable features only).
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.
Patches to this file should be submitted to both projects.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#ifndef _GETOPT_CORE_H
#define _GETOPT_CORE_H 1
/* This header should not be used directly; include getopt.h or
unistd.h instead. Unlike most bits headers, it does not have
a protective #error, because the guard macro for getopt.h in
gnulib is not fixed. */
__BEGIN_DECLS
/* For communication from 'getopt' to the caller.
When 'getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when 'ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
extern char *optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to 'getopt'.
On entry to 'getopt', zero means this is the first call; initialize.
When 'getopt' returns -1, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, 'optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
extern int optind;
/* Callers store zero here to inhibit the error message 'getopt' prints
for unrecognized options. */
extern int opterr;
/* Set to an option character which was unrecognized. */
extern int optopt;
/* Get definitions and prototypes for functions to process the
arguments in ARGV (ARGC of them, minus the program name) for
options given in OPTS.
Return the option character from OPTS just read. Return -1 when
there are no more options. For unrecognized options, or options
missing arguments, 'optopt' is set to the option letter, and '?' is
returned.
The OPTS string is a list of characters which are recognized option
letters, optionally followed by colons, specifying that that letter
takes an argument, to be placed in 'optarg'.
If a letter in OPTS is followed by two colons, its argument is
optional. This behavior is specific to the GNU 'getopt'.
The argument '--' causes premature termination of argument
scanning, explicitly telling 'getopt' that there are no more
options.
If OPTS begins with '-', then non-option arguments are treated as
arguments to the option '\1'. This behavior is specific to the GNU
'getopt'. If OPTS begins with '+', or POSIXLY_CORRECT is set in
the environment, then do not permute arguments.
For standards compliance, the 'argv' argument has the type
char *const *, but this is inaccurate; if argument permutation is
enabled, the argv array (not the strings it points to) must be
writable. */
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
__THROW _GL_ARG_NONNULL ((2, 3));
__END_DECLS
#endif /* _GETOPT_CORE_H */

View File

@ -1,79 +0,0 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Declarations for getopt (GNU extensions).
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.
Patches to this file should be submitted to both projects.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#ifndef _GETOPT_EXT_H
#define _GETOPT_EXT_H 1
/* This header should not be used directly; include getopt.h instead.
Unlike most bits headers, it does not have a protective #error,
because the guard macro for getopt.h in gnulib is not fixed. */
__BEGIN_DECLS
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of 'struct option' terminated by an element containing a name which is
zero.
The field 'has_arg' is:
no_argument (or 0) if the option does not take an argument,
required_argument (or 1) if the option requires an argument,
optional_argument (or 2) if the option takes an optional argument.
If the field 'flag' is not NULL, it points to a variable that is set
to the value given in the field 'val' when the option is found, but
left unchanged if the option is not found.
To have a long-named option do something other than set an 'int' to
a compiled-in constant, such as set a value from 'optarg', set the
option's 'flag' field to zero and its 'val' field to a nonzero
value (the equivalent single-letter option character, if there is
one). For long options that have a zero 'flag' field, 'getopt'
returns the contents of the 'val' field. */
struct option
{
const char *name;
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
int *flag;
int val;
};
/* Names for the values of the 'has_arg' field of 'struct option'. */
#define no_argument 0
#define required_argument 1
#define optional_argument 2
extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind)
__THROW _GL_ARG_NONNULL ((2, 3));
extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind)
__THROW _GL_ARG_NONNULL ((2, 3));
__END_DECLS
#endif /* _GETOPT_EXT_H */

View File

@ -1,68 +0,0 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* getopt (basic, portable features) gnulib wrapper header.
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of gnulib.
Unlike most of the getopt implementation, it is NOT shared
with the GNU C Library.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _GETOPT_PFX_CORE_H
#define _GETOPT_PFX_CORE_H 1
/* This header should not be used directly; include getopt.h or
unistd.h instead. It does not have a protective #error, because
the guard macro for getopt.h in gnulib is not fixed. */
/* Standalone applications should #define __GETOPT_PREFIX to an
identifier that prefixes the external functions and variables
defined in getopt-core.h and getopt-ext.h. Systematically
rename identifiers so that they do not collide with the system
functions and variables. Renaming avoids problems with some
compilers and linkers. */
#ifdef __GETOPT_PREFIX
# ifndef __GETOPT_ID
# define __GETOPT_CONCAT(x, y) x ## y
# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
# endif
# undef getopt
# undef optarg
# undef opterr
# undef optind
# undef optopt
# define getopt __GETOPT_ID (getopt)
# define optarg __GETOPT_ID (optarg)
# define opterr __GETOPT_ID (opterr)
# define optind __GETOPT_ID (optind)
# define optopt __GETOPT_ID (optopt)
/* Work around a problem on macOS, which declares getopt with a
trailing __DARWIN_ALIAS(getopt) that would expand to something like
__asm("_" "rpl_getopt" "$UNIX2003") were it not for the following
hack to suppress the macOS declaration <https://bugs.gnu.org/40205>. */
# ifdef __APPLE__
# define _GETOPT
# endif
/* The system's getopt.h may have already included getopt-core.h to
declare the unprefixed identifiers. Undef _GETOPT_CORE_H so that
getopt-core.h declares them with prefixes. */
# undef _GETOPT_CORE_H
#endif
#include <getopt-core.h>
#endif /* _GETOPT_PFX_CORE_H */

View File

@ -1,72 +0,0 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* getopt (GNU extensions) gnulib wrapper header.
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of gnulib.
Unlike most of the getopt implementation, it is NOT shared
with the GNU C Library.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _GETOPT_PFX_EXT_H
#define _GETOPT_PFX_EXT_H 1
/* This header should not be used directly; include getopt.h instead.
It does not have a protective #error, because the guard macro for
getopt.h in gnulib is not fixed. */
/* Standalone applications should #define __GETOPT_PREFIX to an
identifier that prefixes the external functions and variables
defined in getopt-core.h and getopt-ext.h. Systematically
rename identifiers so that they do not collide with the system
functions and variables. Renaming avoids problems with some
compilers and linkers. */
#ifdef __GETOPT_PREFIX
# ifndef __GETOPT_ID
# define __GETOPT_CONCAT(x, y) x ## y
# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
# endif
# undef getopt_long
# undef getopt_long_only
# undef option
# undef _getopt_internal
# define getopt_long __GETOPT_ID (getopt_long)
# define getopt_long_only __GETOPT_ID (getopt_long_only)
# define option __GETOPT_ID (option)
# define _getopt_internal __GETOPT_ID (getopt_internal)
/* The system's getopt.h may have already included getopt-ext.h to
declare the unprefixed identifiers. Undef _GETOPT_EXT_H so that
getopt-ext.h declares them with prefixes. */
# undef _GETOPT_EXT_H
#endif
/* Standalone applications get correct prototypes for getopt_long and
getopt_long_only; they declare "char **argv". For backward
compatibility with old applications, if __GETOPT_PREFIX is not
defined, we supply GNU-libc-compatible, but incorrect, prototypes
using "char *const *argv". (GNU libc is stuck with the incorrect
prototypes, as they are baked into older versions of LSB.) */
#ifndef __getopt_argv_const
# if defined __GETOPT_PREFIX
# define __getopt_argv_const /* empty */
# else
# define __getopt_argv_const const
# endif
#endif
#include <getopt-ext.h>
#endif /* _GETOPT_PFX_EXT_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +1,27 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Declarations for getopt. /* Declarations for getopt.
Copyright (C) 1989-2023 Free Software Foundation, Inc. Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005,2006,2007
This file is part of gnulib. Free Software Foundation, Inc.
Unlike most of the getopt implementation, it is NOT shared This file is part of the GNU C Library.
with the GNU C Library, which supplies a different version of
this file.
This file is free software: you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as it under the terms of the GNU Lesser General Public License as published by
published by the Free Software Foundation; either version 2.1 of the the Free Software Foundation; either version 2.1, or (at your option)
License, or (at your option) any later version. any later version.
This file is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License along
along with this program. If not, see <https://www.gnu.org/licenses/>. */ with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _GETOPT_H #ifndef _GETOPT_H
#define _GETOPT_H 1 #ifndef __need_getopt
# define _GETOPT_H 1
#endif
/* Standalone applications should #define __GETOPT_PREFIX to an /* Standalone applications should #define __GETOPT_PREFIX to an
identifier that prefixes the external functions and variables identifier that prefixes the external functions and variables
@ -32,29 +31,196 @@
identifiers so that they do not collide with the system functions identifiers so that they do not collide with the system functions
and variables. Renaming avoids problems with some compilers and and variables. Renaming avoids problems with some compilers and
linkers. */ linkers. */
#if defined __GETOPT_PREFIX #if defined __GETOPT_PREFIX && !defined __need_getopt
# include <stdlib.h> # include <stdlib.h>
# include <stdio.h> # include <stdio.h>
# include <unistd.h>
# ifndef _MSC_VER # undef __need_getopt
# include <unistd.h> # undef getopt
# endif # undef getopt_long
# undef getopt_long_only
# undef optarg
# undef opterr
# undef optind
# undef optopt
# define __GETOPT_CONCAT(x, y) x ## y
# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
# define getopt __GETOPT_ID (getopt)
# define getopt_long __GETOPT_ID (getopt_long)
# define getopt_long_only __GETOPT_ID (getopt_long_only)
# define optarg __GETOPT_ID (optarg)
# define opterr __GETOPT_ID (opterr)
# define optind __GETOPT_ID (optind)
# define optopt __GETOPT_ID (optopt)
#endif #endif
/* From Gnulib's lib/arg-nonnull.h: */ /* Standalone applications get correct prototypes for getopt_long and
/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools getopt_long_only; they declare "char **argv". libc uses prototypes
that the values passed as arguments n, ..., m must be non-NULL pointers. with "char *const *argv" that are incorrect because getopt_long and
n = 1 stands for the first argument, n = 2 for the second argument etc. */ getopt_long_only can permute argv; this is required for backward
#ifndef _GL_ARG_NONNULL compatibility (e.g., for LSB 2.0.1).
# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt',
but it caused redefinition warnings if both unistd.h and getopt.h were
included, since unistd.h includes getopt.h having previously defined
__need_getopt.
The only place where __getopt_argv_const is used is in definitions
of getopt_long and getopt_long_only below, but these are visible
only if __need_getopt is not defined, so it is quite safe to rewrite
the conditional as follows:
*/
#if !defined __need_getopt
# if defined __GETOPT_PREFIX
# define __getopt_argv_const /* empty */
# else # else
# define _GL_ARG_NONNULL(params) # define __getopt_argv_const const
# endif # endif
#endif #endif
#include <getopt-cdefs.h> /* If __GNU_LIBRARY__ is not already defined, either we are being used
#include <getopt-pfx-core.h> standalone, or this is the first header included in the source file.
#include <getopt-pfx-ext.h> If we are being used with glibc, we need to include <features.h>, but
that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
not defined, include <ctype.h>, which will pull in <features.h> for us
if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
doesn't flood the namespace with stuff the way some other headers do.) */
#if !defined __GNU_LIBRARY__
# include <ctype.h>
#endif
#endif /* _GETOPT_H */ #ifndef __THROW
# ifndef __GNUC_PREREQ
# define __GNUC_PREREQ(maj, min) (0)
# endif
# if defined __cplusplus && __GNUC_PREREQ (2,8)
# define __THROW throw ()
# else
# define __THROW
# endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
extern char *optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns -1, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
extern int optind;
/* Callers store zero here to inhibit the error message `getopt' prints
for unrecognized options. */
extern int opterr;
/* Set to an option character which was unrecognized. */
extern int optopt;
#ifndef __need_getopt
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of `struct option' terminated by an element containing a name which is
zero.
The field `has_arg' is:
no_argument (or 0) if the option does not take an argument,
required_argument (or 1) if the option requires an argument,
optional_argument (or 2) if the option takes an optional argument.
If the field `flag' is not NULL, it points to a variable that is set
to the value given in the field `val' when the option is found, but
left unchanged if the option is not found.
To have a long-named option do something other than set an `int' to
a compiled-in constant, such as set a value from `optarg', set the
option's `flag' field to zero and its `val' field to a nonzero
value (the equivalent single-letter option character, if there is
one). For long options that have a zero `flag' field, `getopt'
returns the contents of the `val' field. */
struct option
{
const char *name;
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
int *flag;
int val;
};
/* Names for the values of the `has_arg' field of `struct option'. */
# define no_argument 0
# define required_argument 1
# define optional_argument 2
#endif /* need getopt */
/* Get definitions and prototypes for functions to process the
arguments in ARGV (ARGC of them, minus the program name) for
options given in OPTS.
Return the option character from OPTS just read. Return -1 when
there are no more options. For unrecognized options, or options
missing arguments, `optopt' is set to the option letter, and '?' is
returned.
The OPTS string is a list of characters which are recognized option
letters, optionally followed by colons, specifying that that letter
takes an argument, to be placed in `optarg'.
If a letter in OPTS is followed by two colons, its argument is
optional. This behavior is specific to the GNU `getopt'.
The argument `--' causes premature termination of argument
scanning, explicitly telling `getopt' that there are no more
options.
If OPTS begins with `-', then non-option arguments are treated as
arguments to the option '\1'. This behavior is specific to the GNU
`getopt'. If OPTS begins with `+', or POSIXLY_CORRECT is set in
the environment, then do not permute arguments. */
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
__THROW;
#ifndef __need_getopt
extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind)
__THROW;
extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind)
__THROW;
#endif
#ifdef __cplusplus
}
#endif
/* Make sure we later can get all the definitions and declarations. */
#undef __need_getopt
#endif /* getopt.h */

View File

@ -1,32 +1,41 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* getopt_long and getopt_long_only entry points for GNU getopt. /* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987-2023 Free Software Foundation, Inc. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006
This file is part of the GNU C Library and is also part of gnulib. Free Software Foundation, Inc.
Patches to this file should be submitted to both projects. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or modify
modify it under the terms of the GNU Lesser General Public it under the terms of the GNU Lesser General Public License as published by
License as published by the Free Software Foundation; either the Free Software Foundation; either version 2.1, or (at your option)
version 2.1 of the License, or (at your option) any later version. any later version.
The GNU C Library is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public License along
License along with the GNU C Library; if not, see with this program; if not, write to the Free Software Foundation,
<https://www.gnu.org/licenses/>. */ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _LIBC #ifdef _LIBC
# ifdef HAVE_CONFIG_H # include <getopt.h>
# include <config.h> #else
# endif # include <config.h>
# include "getopt.h"
#endif
#include "getopt_int.h"
#include <stdio.h>
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#include <stdlib.h>
#endif #endif
#include "getopt.h" #ifndef NULL
#include "getopt_int.h" #define NULL 0
#endif
int int
getopt_long (int argc, char *__getopt_argv_const *argv, const char *options, getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
@ -42,7 +51,7 @@ _getopt_long_r (int argc, char **argv, const char *options,
struct _getopt_data *d) struct _getopt_data *d)
{ {
return _getopt_internal_r (argc, argv, options, long_options, opt_index, return _getopt_internal_r (argc, argv, options, long_options, opt_index,
0, d, 0); 0, 0, d);
} }
/* Like getopt_long, but '-' as well as '--' can indicate a long option. /* Like getopt_long, but '-' as well as '--' can indicate a long option.
@ -65,14 +74,13 @@ _getopt_long_only_r (int argc, char **argv, const char *options,
struct _getopt_data *d) struct _getopt_data *d)
{ {
return _getopt_internal_r (argc, argv, options, long_options, opt_index, return _getopt_internal_r (argc, argv, options, long_options, opt_index,
1, d, 0); 1, 0, d);
} }
#ifdef TEST #ifdef TEST
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
int int
main (int argc, char **argv) main (int argc, char **argv)
@ -84,7 +92,7 @@ main (int argc, char **argv)
{ {
int this_option_optind = optind ? optind : 1; int this_option_optind = optind ? optind : 1;
int option_index = 0; int option_index = 0;
static const struct option long_options[] = static struct option long_options[] =
{ {
{"add", 1, 0, 0}, {"add", 1, 0, 0},
{"append", 0, 0, 0}, {"append", 0, 0, 0},
@ -134,11 +142,11 @@ main (int argc, char **argv)
break; break;
case 'c': case 'c':
printf ("option c with value '%s'\n", optarg); printf ("option c with value `%s'\n", optarg);
break; break;
case 'd': case 'd':
printf ("option d with value '%s'\n", optarg); printf ("option d with value `%s'\n", optarg);
break; break;
case '?': case '?':

View File

@ -1,64 +1,34 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Internal declarations for getopt. /* Internal declarations for getopt.
Copyright (C) 1989-2023 Free Software Foundation, Inc. Copyright (C) 1989-1994,1996-1999,2001,2003,2004
This file is part of the GNU C Library and is also part of gnulib. Free Software Foundation, Inc.
Patches to this file should be submitted to both projects. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or modify
modify it under the terms of the GNU Lesser General Public it under the terms of the GNU General Public License as published by
License as published by the Free Software Foundation; either the Free Software Foundation; either version 2, or (at your option)
version 2.1 of the License, or (at your option) any later version. any later version.
The GNU C Library is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Lesser General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU General Public License along
License along with the GNU C Library; if not, see with this program; if not, write to the Free Software Foundation,
<https://www.gnu.org/licenses/>. */ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _GETOPT_INT_H #ifndef _GETOPT_INT_H
#define _GETOPT_INT_H 1 #define _GETOPT_INT_H 1
#include <getopt.h>
extern int _getopt_internal (int ___argc, char **___argv, extern int _getopt_internal (int ___argc, char **___argv,
const char *__shortopts, const char *__shortopts,
const struct option *__longopts, int *__longind, const struct option *__longopts, int *__longind,
int __long_only, int __posixly_correct); int __long_only, int __posixly_correct);
/* Reentrant versions which can handle parsing multiple argument /* Reentrant versions which can handle parsing multiple argument
vectors at the same time. */ vectors at the same time. */
/* Describe how to deal with options that follow non-option ARGV-elements.
REQUIRE_ORDER means don't recognize them as options; stop option
processing when the first non-option is seen. This is what POSIX
specifies should happen.
PERMUTE means permute the contents of ARGV as we scan, so that
eventually all the non-options are at the end. This allows options
to be given in any order, even with programs that were not written
to expect this.
RETURN_IN_ORDER is an option available to programs that were
written to expect options and other ARGV-elements in any order
and that care about the ordering of the two. We describe each
non-option ARGV-element as if it were the argument of an option
with character code 1.
The special argument '--' forces an end of option-scanning regardless
of the value of 'ordering'. In the case of RETURN_IN_ORDER, only
'--' can cause 'getopt' to return -1 with 'optind' != ARGC. */
enum __ord
{
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
};
/* Data type for reentrant functions. */ /* Data type for reentrant functions. */
struct _getopt_data struct _getopt_data
{ {
@ -83,17 +53,58 @@ struct _getopt_data
by advancing to the next ARGV-element. */ by advancing to the next ARGV-element. */
char *__nextchar; char *__nextchar;
/* See __ord above. */ /* Describe how to deal with options that follow non-option ARGV-elements.
enum __ord __ordering;
If the caller did not specify anything,
the default is REQUIRE_ORDER if the environment variable
POSIXLY_CORRECT is defined, PERMUTE otherwise.
REQUIRE_ORDER means don't recognize them as options;
stop option processing when the first non-option is seen.
This is what Unix does.
This mode of operation is selected by either setting the environment
variable POSIXLY_CORRECT, or using `+' as the first character
of the list of option characters, or by calling getopt.
PERMUTE is the default. We permute the contents of ARGV as we
scan, so that eventually all the non-options are at the end.
This allows options to be given in any order, even with programs
that were not written to expect this.
RETURN_IN_ORDER is an option available to programs that were
written to expect options and other ARGV-elements in any order
and that care about the ordering of the two. We describe each
non-option ARGV-element as if it were the argument of an option
with character code 1. Using `-' as the first character of the
list of option characters selects this mode of operation.
The special argument `--' forces an end of option-scanning regardless
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
`--' can cause `getopt' to return -1 with `optind' != ARGC. */
enum
{
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
} __ordering;
/* If the POSIXLY_CORRECT environment variable is set
or getopt was called. */
int __posixly_correct;
/* Handle permutation of arguments. */ /* Handle permutation of arguments. */
/* Describe the part of ARGV that contains non-options that have /* Describe the part of ARGV that contains non-options that have
been skipped. 'first_nonopt' is the index in ARGV of the first been skipped. `first_nonopt' is the index in ARGV of the first
of them; 'last_nonopt' is the index after the last of them. */ of them; `last_nonopt' is the index after the last of them. */
int __first_nonopt; int __first_nonopt;
int __last_nonopt; int __last_nonopt;
#if defined _LIBC && defined USE_NONOPTION_FLAGS
int __nonoption_flags_max_len;
int __nonoption_flags_len;
# endif
}; };
/* The initializer is necessary to set OPTIND and OPTERR to their /* The initializer is necessary to set OPTIND and OPTERR to their
@ -103,8 +114,8 @@ struct _getopt_data
extern int _getopt_internal_r (int ___argc, char **___argv, extern int _getopt_internal_r (int ___argc, char **___argv,
const char *__shortopts, const char *__shortopts,
const struct option *__longopts, int *__longind, const struct option *__longopts, int *__longind,
int __long_only, struct _getopt_data *__data, int __long_only, int __posixly_correct,
int __posixly_correct); struct _getopt_data *__data);
extern int _getopt_long_r (int ___argc, char **___argv, extern int _getopt_long_r (int ___argc, char **___argv,
const char *__shortopts, const char *__shortopts,

7
m4/.gitignore vendored
View File

@ -1,16 +1,11 @@
build-to-host.m4
codeset.m4 codeset.m4
extern-inline.m4
fcntl-o.m4
gettext.m4 gettext.m4
glibc2.m4 glibc2.m4
glibc21.m4 glibc21.m4
host-cpu-c-abi.m4
iconv.m4 iconv.m4
intdiv0.m4 intdiv0.m4
intl.m4 intl.m4
intldir.m4 intldir.m4
intlmacosx.m4
intmax.m4 intmax.m4
inttypes-pri.m4 inttypes-pri.m4
inttypes_h.m4 inttypes_h.m4
@ -32,9 +27,9 @@ printf-posix.m4
progtest.m4 progtest.m4
size_max.m4 size_max.m4
stdint_h.m4 stdint_h.m4
threadlib.m4
uintmax_t.m4 uintmax_t.m4
ulonglong.m4 ulonglong.m4
visibility.m4
wchar_t.m4 wchar_t.m4
wint_t.m4 wint_t.m4
xsize.m4 xsize.m4

View File

@ -1,7 +1,5 @@
dnl SPDX-License-Identifier: GPL-3.0-or-later WITH Autoconf-exception-macro
# =========================================================================== # ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html # http://www.gnu.org/software/autoconf-archive/ax_pthread.html
# =========================================================================== # ===========================================================================
# #
# SYNOPSIS # SYNOPSIS
@ -16,28 +14,24 @@ dnl SPDX-License-Identifier: GPL-3.0-or-later WITH Autoconf-exception-macro
# flags that are needed. (The user can also force certain compiler # flags that are needed. (The user can also force certain compiler
# flags/libs to be tested by setting these environment variables.) # flags/libs to be tested by setting these environment variables.)
# #
# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is # Also sets PTHREAD_CC to any special C compiler that is needed for
# needed for multi-threaded programs (defaults to the value of CC # multi-threaded programs (defaults to the value of CC otherwise). (This
# respectively CXX otherwise). (This is necessary on e.g. AIX to use the # is necessary on AIX to use the special cc_r compiler alias.)
# special cc_r/CC_r compiler alias.)
# #
# NOTE: You are assumed to not only compile your program with these flags, # NOTE: You are assumed to not only compile your program with these flags,
# but also to link with them as well. For example, you might link with # but also link it with them as well. e.g. you should link with
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
# #
# If you are only building threaded programs, you may wish to use these # If you are only building threads programs, you may wish to use these
# variables in your default LIBS, CFLAGS, and CC: # variables in your default LIBS, CFLAGS, and CC:
# #
# LIBS="$PTHREAD_LIBS $LIBS" # LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC" # CC="$PTHREAD_CC"
# CXX="$PTHREAD_CXX"
# #
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to # has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
# #
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the # Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with # PTHREAD_PRIO_INHERIT symbol is defined when compiling with
@ -61,7 +55,6 @@ dnl SPDX-License-Identifier: GPL-3.0-or-later WITH Autoconf-exception-macro
# #
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG> # Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
# Copyright (c) 2019 Marc Stevens <marc.stevens@cwi.nl>
# #
# This program is free software: you can redistribute it and/or modify it # This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the # under the terms of the GNU General Public License as published by the
@ -74,7 +67,7 @@ dnl SPDX-License-Identifier: GPL-3.0-or-later WITH Autoconf-exception-macro
# Public License for more details. # Public License for more details.
# #
# You should have received a copy of the GNU General Public License along # You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
# #
# As a special exception, the respective Autoconf Macro's copyright owner # As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure # gives unlimited permission to copy, distribute and modify the configure
@ -89,41 +82,35 @@ dnl SPDX-License-Identifier: GPL-3.0-or-later WITH Autoconf-exception-macro
# modified version of the Autoconf Macro, you may extend this special # modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well. # exception to the GPL to apply to your modified version as well.
#serial 31 #serial 21
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [ AC_DEFUN([AX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_SED])
AC_LANG_PUSH([C]) AC_LANG_PUSH([C])
ax_pthread_ok=no ax_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h # We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on Tru64 or Sequent). # requires special compiler flags (e.g. on True64 or Sequent).
# It gets checked for in the link test anyway. # It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS, # First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using # etcetera environment variables, and if threads linking works using
# them: # them:
if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
ax_pthread_save_CC="$CC" save_CFLAGS="$CFLAGS"
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"])
CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS" LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes])
AC_MSG_RESULT([$ax_pthread_ok]) AC_MSG_RESULT([$ax_pthread_ok])
if test "x$ax_pthread_ok" = "xno"; then if test x"$ax_pthread_ok" = xno; then
PTHREAD_LIBS="" PTHREAD_LIBS=""
PTHREAD_CFLAGS="" PTHREAD_CFLAGS=""
fi fi
CC="$ax_pthread_save_CC" LIBS="$save_LIBS"
CFLAGS="$ax_pthread_save_CFLAGS" CFLAGS="$save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
fi fi
# We must check for the threads library under a number of different # We must check for the threads library under a number of different
@ -131,14 +118,12 @@ fi
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the # (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX). # libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items with a "," contain both # Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags (before ",") and linker flags (after ","). Other items # C compiler flags, and other items are library names, except for "none"
# starting with a "-" are C compiler flags, and remaining items are # which indicates that we try without any flags at all, and "pthread-config"
# library names, except for "none" which indicates that we try without # which is a program returning the flags for the Pth emulation library.
# any flags at all, and "pthread-config" which is a program returning
# the flags for the Pth emulation library.
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the # The ordering *is* (sometimes) important. Some notes on the
# individual items follow: # individual items follow:
@ -147,163 +132,82 @@ ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --
# none: in case threads are in libc; should be tried before -Kthread and # none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings # other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# (Note: HP C rejects this with "bad form for `-t' option") # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthreads: Solaris/gcc (Note: HP C also rejects) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # -pthreads: Solaris/gcc
# doesn't hurt to check since this sometimes defines pthreads and
# -D_REENTRANT too), HP C (must be checked before -lpthread, which
# is present but should not be used directly; and before -mthreads,
# because the compiler interprets this as "-mt" + "-hreads")
# -mthreads: Mingw32/gcc, Lynx/gcc # -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# ... -mt is also the pthreads flag for HP/aCC
# pthread: Linux, etcetera # pthread: Linux, etcetera
# --thread-safe: KAI C++ # --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library) # pthread-config: use pthread-config program (for GNU Pth library)
case $host_os in case ${host_os} in
freebsd*)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
ax_pthread_flags="-kthread lthread $ax_pthread_flags"
;;
hpux*)
# From the cc(1) man page: "[-mt] Sets various -D flags to enable
# multi-threading and also sets -lpthread."
ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
;;
openedition*)
# IBM z/OS requires a feature-test macro to be defined in order to
# enable POSIX threads at all, so give the user a hint if this is
# not set. (We don't define these ourselves, as they can affect
# other portions of the system API in unpredictable ways.)
AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
[
# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
AX_PTHREAD_ZOS_MISSING
# endif
],
[AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
;;
solaris*) solaris*)
# On Solaris (at least, for some versions), libc contains stubbed # On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based # (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (N.B.: The stubs are missing # tests will erroneously succeed. (We need to link with -pthreads/-mt/
# pthread_cleanup_push, or rather a function called by this macro, # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# so we could check for that, but who knows whether they'll stub # a function called by this macro, so we could check for that, but
# that too in a future libc.) So we'll check first for the # who knows whether they'll stub that too in a future libc.) So,
# standard Solaris way of linking pthreads (-mt -lpthread). # we'll just look for -pthreads and -lpthread first:
ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
;;
darwin*)
ax_pthread_flags="-pthread $ax_pthread_flags"
;; ;;
esac esac
# Are we compiling with Clang? # Clang doesn't consider unrecognized options an error unless we specify
# -Werror. We throw in some extra Clang-specific options to ensure that
# this doesn't happen for GCC, which also accepts -Werror.
AC_CACHE_CHECK([whether $CC is Clang], AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
[ax_cv_PTHREAD_CLANG], save_CFLAGS="$CFLAGS"
[ax_cv_PTHREAD_CLANG=no ax_pthread_extra_flags="-Werror"
# Note that Autoconf sets GCC=yes for Clang as well as GCC CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
if test "x$GCC" = "xyes"; then AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], [AC_MSG_RESULT([yes])],
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ [ax_pthread_extra_flags=
# if defined(__clang__) && defined(__llvm__) AC_MSG_RESULT([no])])
AX_PTHREAD_CC_IS_CLANG CFLAGS="$save_CFLAGS"
# endif
],
[ax_cv_PTHREAD_CLANG=yes])
fi
])
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
if test x"$ax_pthread_ok" = xno; then
for flag in $ax_pthread_flags; do
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) case $flag in
# Note that for GCC and Clang -pthread generally implies -lpthread,
# except when -nostdlib is passed.
# This is problematic using libtool to build C++ shared libraries with pthread:
# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333
# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555
# To solve this, first try -pthread together with -lpthread for GCC
AS_IF([test "x$GCC" = "xyes"],
[ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"])
# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first
AS_IF([test "x$ax_pthread_clang" = "xyes"],
[ax_pthread_flags="-pthread,-lpthread -pthread"])
# The presence of a feature test macro requesting re-entrant function
# definitions is, on some systems, a strong hint that pthreads support is
# correctly enabled
case $host_os in
darwin* | hpux* | linux* | osf* | solaris*)
ax_pthread_check_macro="_REENTRANT"
;;
aix*)
ax_pthread_check_macro="_THREAD_SAFE"
;;
*)
ax_pthread_check_macro="--"
;;
esac
AS_IF([test "x$ax_pthread_check_macro" = "x--"],
[ax_pthread_check_cond=0],
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
if test "x$ax_pthread_ok" = "xno"; then
for ax_pthread_try_flag in $ax_pthread_flags; do
case $ax_pthread_try_flag in
none) none)
AC_MSG_CHECKING([whether pthreads work without any flags]) AC_MSG_CHECKING([whether pthreads work without any flags])
;; ;;
*,*)
PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"`
PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"`
AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"])
;;
-*) -*)
AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$ax_pthread_try_flag" PTHREAD_CFLAGS="$flag"
;; ;;
pthread-config) pthread-config)
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) if test x"$ax_pthread_config" = xno; then continue; fi
PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;; ;;
*) *)
AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$ax_pthread_try_flag" PTHREAD_LIBS="-l$flag"
;; ;;
esac esac
ax_pthread_save_CFLAGS="$CFLAGS" save_LIBS="$LIBS"
ax_pthread_save_LIBS="$LIBS" save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS" LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
# Check for various functions. We must include pthread.h, # Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we # since some functions may be macros. (On the Sequent, we
@ -314,18 +218,8 @@ for ax_pthread_try_flag in $ax_pthread_flags; do
# pthread_cleanup_push because it is one of the few pthread # pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub. # functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles. # We try pthread_create on general principles.
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h> AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
# if $ax_pthread_check_cond static void routine(void *a) { a = 0; }
# error "$ax_pthread_check_macro must be defined"
# endif
static void *some_global = NULL;
static void routine(void *a)
{
/* To avoid any unused-parameter or
unused-but-set-parameter warning. */
some_global = a;
}
static void *start_routine(void *a) { return a; }], static void *start_routine(void *a) { return a; }],
[pthread_t th; pthread_attr_t attr; [pthread_t th; pthread_attr_t attr;
pthread_create(&th, 0, start_routine, 0); pthread_create(&th, 0, start_routine, 0);
@ -333,187 +227,101 @@ for ax_pthread_try_flag in $ax_pthread_flags; do
pthread_attr_init(&attr); pthread_attr_init(&attr);
pthread_cleanup_push(routine, 0); pthread_cleanup_push(routine, 0);
pthread_cleanup_pop(0) /* ; */])], pthread_cleanup_pop(0) /* ; */])],
[ax_pthread_ok=yes], [ax_pthread_ok=yes],
[]) [])
CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$save_LIBS"
LIBS="$ax_pthread_save_LIBS" CFLAGS="$save_CFLAGS"
AC_MSG_RESULT([$ax_pthread_ok]) AC_MSG_RESULT([$ax_pthread_ok])
AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) if test "x$ax_pthread_ok" = xyes; then
break;
fi
PTHREAD_LIBS="" PTHREAD_LIBS=""
PTHREAD_CFLAGS="" PTHREAD_CFLAGS=""
done done
fi fi
# Clang needs special handling, because older versions handle the -pthread
# option in a rather... idiosyncratic way
if test "x$ax_pthread_clang" = "xyes"; then
# Clang takes -pthread; it has never supported any other flag
# (Note 1: This will need to be revisited if a system that Clang
# supports has POSIX threads in a separate library. This tends not
# to be the way of modern systems, but it's conceivable.)
# (Note 2: On some systems, notably Darwin, -pthread is not needed
# to get POSIX threads support; the API is always present and
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
# -pthread does define _REENTRANT, and while the Darwin headers
# ignore this macro, third-party headers might not.)
# However, older versions of Clang make a point of warning the user
# that, in an invocation where only linking and no compilation is
# taking place, the -pthread option has no effect ("argument unused
# during compilation"). They expect -pthread to be passed in only
# when source code is being compiled.
#
# Problem is, this is at odds with the way Automake and most other
# C build frameworks function, which is that the same flags used in
# compilation (CFLAGS) are also used in linking. Many systems
# supported by AX_PTHREAD require exactly this for POSIX threads
# support, and in fact it is often not straightforward to specify a
# flag that is used only in the compilation phase and not in
# linking. Such a scenario is extremely rare in practice.
#
# Even though use of the -pthread flag in linking would only print
# a warning, this can be a nuisance for well-run software projects
# that build with -Werror. So if the active version of Clang has
# this misfeature, we search for an option to squash it.
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
# Create an alternate version of $ac_link that compiles and
# links in two steps (.c -> .o, .o -> exe) instead of one
# (.c -> exe), because the warning occurs only in the second
# step
ax_pthread_save_ac_link="$ac_link"
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"`
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
ax_pthread_save_CFLAGS="$CFLAGS"
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
ac_link="$ax_pthread_save_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[ac_link="$ax_pthread_2step_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[break])
])
done
ac_link="$ax_pthread_save_ac_link"
CFLAGS="$ax_pthread_save_CFLAGS"
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
])
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
no | unknown) ;;
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
esac
fi # $ax_pthread_clang = yes
# Various other checks: # Various other checks:
if test "x$ax_pthread_ok" = "xyes"; then if test "x$ax_pthread_ok" = xyes; then
ax_pthread_save_CFLAGS="$CFLAGS" save_LIBS="$LIBS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS" LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED. # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_CACHE_CHECK([for joinable pthread attribute], AC_MSG_CHECKING([for joinable pthread attribute])
[ax_cv_PTHREAD_JOINABLE_ATTR], attr_name=unknown
[ax_cv_PTHREAD_JOINABLE_ATTR=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], [int attr = $attr; return attr /* ; */])],
[int attr = $ax_pthread_attr; return attr /* ; */])], [attr_name=$attr; break],
[ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], [])
[]) done
done AC_MSG_RESULT([$attr_name])
]) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name],
test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ [Define to necessary symbol if this constant
test "x$ax_pthread_joinable_attr_defined" != "xyes"], uses a non-standard name on your system.])
[AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], fi
[$ax_cv_PTHREAD_JOINABLE_ATTR],
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
ax_pthread_joinable_attr_defined=yes
])
AC_CACHE_CHECK([whether more special flags are required for pthreads], AC_MSG_CHECKING([if more special flags are required for pthreads])
[ax_cv_PTHREAD_SPECIAL_FLAGS], flag=no
[ax_cv_PTHREAD_SPECIAL_FLAGS=no case ${host_os} in
case $host_os in aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
solaris*) osf* | hpux*) flag="-D_REENTRANT";;
ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" solaris*)
;; if test "$GCC" = "yes"; then
esac flag="-D_REENTRANT"
]) else
AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ # TODO: What about Clang on Solaris?
test "x$ax_pthread_special_flags_added" != "xyes"], flag="-mt -D_REENTRANT"
[PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" fi
ax_pthread_special_flags_added=yes]) ;;
esac
AC_MSG_RESULT([$flag])
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
[ax_cv_PTHREAD_PRIO_INHERIT], [ax_cv_PTHREAD_PRIO_INHERIT], [
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
[[int i = PTHREAD_PRIO_INHERIT; [[int i = PTHREAD_PRIO_INHERIT;]])],
return i;]])], [ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=yes], [ax_cv_PTHREAD_PRIO_INHERIT=no])
[ax_cv_PTHREAD_PRIO_INHERIT=no])
]) ])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
test "x$ax_pthread_prio_inherit_defined" != "xyes"], [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
ax_pthread_prio_inherit_defined=yes
])
CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$save_LIBS"
LIBS="$ax_pthread_save_LIBS" CFLAGS="$save_CFLAGS"
# More AIX lossage: compile with *_r variant # More AIX lossage: compile with *_r variant
if test "x$GCC" != "xyes"; then if test "x$GCC" != xyes; then
case $host_os in case $host_os in
aix*) aix*)
AS_CASE(["x/$CC"], AS_CASE(["x/$CC"],
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
[#handle absolute path differently from PATH based program lookup [#handle absolute path differently from PATH based program lookup
AS_CASE(["x$CC"], AS_CASE(["x$CC"],
[x/*], [x/*],
[ [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])])
],
[
AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])
AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])])
]
)
])
;; ;;
esac esac
fi fi
fi fi
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
AC_SUBST([PTHREAD_LIBS]) AC_SUBST([PTHREAD_LIBS])
AC_SUBST([PTHREAD_CFLAGS]) AC_SUBST([PTHREAD_CFLAGS])
AC_SUBST([PTHREAD_CC]) AC_SUBST([PTHREAD_CC])
AC_SUBST([PTHREAD_CXX])
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test "x$ax_pthread_ok" = "xyes"; then if test x"$ax_pthread_ok" = xyes; then
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
: :
else else

View File

@ -1,72 +1,71 @@
dnl SPDX-License-Identifier: FSFULLR # getopt.m4 serial 14 (modified version)
dnl Copyright (C) 2002-2006, 2008 Free Software Foundation, Inc.
# getopt.m4 serial 49 (modified version)
dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
# This version has been modified to reduce complexity since we only need # The getopt module assume you want GNU getopt, with getopt_long etc,
# GNU getopt_long and do not care about replacing getopt. # rather than vanilla POSIX getopt. This means your code should
# always include <getopt.h> for the getopt prototypes.
# Check for a POSIX compliant getopt function with GNU extensions (such as AC_DEFUN([gl_GETOPT_SUBSTITUTE],
# options with optional arguments) and the functions getopt_long,
# getopt_long_only.
AC_DEFUN([gl_FUNC_GETOPT_GNU],
[ [
AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) AC_LIBOBJ([getopt])
AC_LIBOBJ([getopt1])
gl_GETOPT_SUBSTITUTE_HEADER
])
if test -n "$gl_replace_getopt"; then AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
gl_GETOPT_SUBSTITUTE [
fi GETOPT_H=getopt.h
AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
[Define to rpl_ if the getopt replacement functions and variables
should be used.])
AC_SUBST([GETOPT_H])
]) ])
AC_DEFUN([gl_GETOPT_CHECK_HEADERS], AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
[ [
gl_replace_getopt= if test -z "$GETOPT_H"; then
AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
if test -z "$gl_replace_getopt"; then
AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes])
fi fi
if test -z "$gl_replace_getopt"; then if test -z "$GETOPT_H"; then
AC_CHECK_FUNCS([getopt_long], [], [gl_replace_getopt=yes]) AC_CHECK_FUNCS([getopt_long], [], [GETOPT_H=getopt.h])
fi fi
dnl BSD getopt_long uses a way to reset option processing, that is different dnl BSD getopt_long uses a way to reset option processing, that is different
dnl from GNU and Solaris (which copied the GNU behavior). We support both dnl from GNU and Solaris (which copied the GNU behavior). We support both
dnl GNU and BSD style resetting of getopt_long(), so there's no need to use dnl GNU and BSD style resetting of getopt_long(), so there's no need to use
dnl GNU getopt_long() on BSD due to different resetting style. dnl GNU getopt_long() on BSD due to different resetting style.
if test -z "$gl_replace_getopt"; then dnl
dnl With getopt_long(), some BSD versions have a bug in handling optional
dnl arguments. This bug appears only if the environment variable
dnl POSIXLY_CORRECT has been set, so it shouldn't be too bad in most
dnl cases; probably most don't have that variable set. But if we actually
dnl hit this bug, it is a real problem due to our heavy use of optional
dnl arguments.
dnl
dnl According to CVS logs, the bug was introduced in OpenBSD in 2003-09-22
dnl and copied to FreeBSD in 2004-02-24. It was fixed in both in 2006-09-22,
dnl so the affected versions shouldn't be popular anymore anyway. NetBSD
dnl never had this bug. TODO: What about Darwin and others?
if test -z "$GETOPT_H"; then
AC_CHECK_DECL([optreset], AC_CHECK_DECL([optreset],
[AC_DEFINE([HAVE_OPTRESET], 1, [AC_DEFINE([HAVE_OPTRESET], 1,
[Define to 1 if getopt.h declares extern int optreset.])], [Define to 1 if getopt.h declares extern int optreset.])],
[], [#include <getopt.h>]) [], [#include <getopt.h>])
fi fi
dnl POSIX 2008 does not specify leading '+' behavior, but see dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on dnl option string (as of 2005-05-05). We don't use that feature, so this
dnl the next version of POSIX. We don't use that feature, so this
dnl is not a problem for us. Thus, the respective test was removed here. dnl is not a problem for us. Thus, the respective test was removed here.
dnl Checks for getopt handling '-' as a leading character in an option
dnl string were removed, since we also don't use that feature.
]) ])
AC_DEFUN([gl_GETOPT_SUBSTITUTE], AC_DEFUN([gl_GETOPT_IFELSE],
[ [
AC_LIBOBJ([getopt]) AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
AC_LIBOBJ([getopt1]) AS_IF([test -n "$GETOPT_H"], [$1], [$2])
AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
[Define to rpl_ if the getopt replacement functions and variables
should be used.])
GETOPT_H=getopt.h
AC_SUBST([GETOPT_H])
]) ])
AC_DEFUN([gl_GETOPT], [gl_FUNC_GETOPT_GNU]) AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])])

View File

@ -1,5 +1,3 @@
dnl SPDX-License-Identifier: FSFULLR
# Find a POSIX-conforming shell. # Find a POSIX-conforming shell.
# Copyright (C) 2007-2008 Free Software Foundation, Inc. # Copyright (C) 2007-2008 Free Software Foundation, Inc.

View File

@ -1,6 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# SYNOPSIS # SYNOPSIS
# #
@ -10,11 +7,13 @@
# #
# Common checks for tuklib. # Common checks for tuklib.
# #
############################################################################# # COPYING
# #
# Author: Lasse Collin # Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
# #
#############################################################################
AC_DEFUN_ONCE([TUKLIB_COMMON], [ AC_DEFUN_ONCE([TUKLIB_COMMON], [
AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_CANONICAL_HOST])

View File

@ -1,6 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# SYNOPSIS # SYNOPSIS
# #
@ -12,19 +9,17 @@
# This information is used by tuklib_cpucores.c. # This information is used by tuklib_cpucores.c.
# #
# Supported methods: # Supported methods:
# - GetSystemInfo(): Windows (including Cygwin)
# - sched_getaffinity(): glibc (GNU/Linux, GNU/kFreeBSD)
# - cpuset_getaffinity(): FreeBSD
# - sysctl(): BSDs, OS/2 # - sysctl(): BSDs, OS/2
# - sysconf(): GNU/Linux, Solaris, Tru64, IRIX, AIX, QNX, Cygwin (but # - sysconf(): GNU/Linux, Solaris, Tru64, IRIX, AIX, Cygwin
# GetSystemInfo() is used on Cygwin)
# - pstat_getdynamic(): HP-UX # - pstat_getdynamic(): HP-UX
# #
############################################################################# # COPYING
# #
# Author: Lasse Collin # Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
# #
#############################################################################
AC_DEFUN_ONCE([TUKLIB_CPUCORES], [ AC_DEFUN_ONCE([TUKLIB_CPUCORES], [
AC_REQUIRE([TUKLIB_COMMON]) AC_REQUIRE([TUKLIB_COMMON])
@ -35,67 +30,11 @@ AC_CHECK_HEADERS([sys/param.h])
AC_CACHE_CHECK([how to detect the number of available CPU cores], AC_CACHE_CHECK([how to detect the number of available CPU cores],
[tuklib_cv_cpucores_method], [ [tuklib_cv_cpucores_method], [
# Maybe checking $host_os would be enough but this matches what # Look for sysctl() solution first, because on OS/2, both sysconf()
# tuklib_cpucores.c does. # and sysctl() pass the tests in this file, but only sysctl()
# # actually works.
# NOTE: IRIX has a compiler that doesn't error out with #error, so use
# a non-compilable text instead of #error to generate an error.
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#if defined(_WIN32) || defined(__CYGWIN__) #include <sys/types.h>
int main(void) { return 0; }
#else
compile error
#endif
]])], [tuklib_cv_cpucores_method=special], [
# glibc-based systems (GNU/Linux and GNU/kFreeBSD) have sched_getaffinity().
# The CPU_COUNT() macro was added in glibc 2.9 so we try to link the
# test program instead of merely compiling it. glibc 2.9 is old enough that
# if someone uses the code on older glibc, the fallback to sysconf() should
# be good enough.
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <sched.h>
int
main(void)
{
cpu_set_t cpu_mask;
sched_getaffinity(0, sizeof(cpu_mask), &cpu_mask);
return CPU_COUNT(&cpu_mask);
}
]])], [tuklib_cv_cpucores_method=sched_getaffinity], [
# FreeBSD has both cpuset and sysctl. Look for cpuset first because
# it's a better approach.
#
# This test would match on GNU/kFreeBSD too but it would require
# -lfreebsd-glue when linking and thus in the current form this would
# fail on GNU/kFreeBSD. The above test for sched_getaffinity() matches
# on GNU/kFreeBSD so the test below should never run on that OS.
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <sys/param.h>
#include <sys/cpuset.h>
int
main(void)
{
cpuset_t set;
cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1,
sizeof(set), &set);
return 0;
}
]])], [tuklib_cv_cpucores_method=cpuset], [
# On OS/2, both sysconf() and sysctl() pass the tests in this file,
# but only sysctl() works. On QNX it's the opposite: only sysconf() works
# (although it assumes that _POSIX_SOURCE, _XOPEN_SOURCE, and _POSIX_C_SOURCE
# are undefined or alternatively _QNX_SOURCE is defined).
#
# We test sysctl() first and intentionally break the sysctl() test on QNX
# so that sysctl() is never used on QNX.
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#ifdef __QNX__
compile error
#endif
#ifdef HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
# include <sys/param.h> # include <sys/param.h>
#endif #endif
@ -103,12 +42,7 @@ compile error
int int
main(void) main(void)
{ {
#ifdef HW_NCPUONLINE
/* This is preferred on OpenBSD, see tuklib_cpucores.c. */
int name[2] = { CTL_HW, HW_NCPUONLINE };
#else
int name[2] = { CTL_HW, HW_NCPU }; int name[2] = { CTL_HW, HW_NCPU };
#endif
int cpus; int cpus;
size_t cpus_size = sizeof(cpus); size_t cpus_size = sizeof(cpus);
sysctl(name, 2, &cpus, &cpus_size, NULL, 0); sysctl(name, 2, &cpus, &cpus_size, NULL, 0);
@ -148,19 +82,9 @@ main(void)
]])], [tuklib_cv_cpucores_method=pstat_getdynamic], [ ]])], [tuklib_cv_cpucores_method=pstat_getdynamic], [
tuklib_cv_cpucores_method=unknown tuklib_cv_cpucores_method=unknown
])])])])])])]) ])])])])
case $tuklib_cv_cpucores_method in case $tuklib_cv_cpucores_method in
sched_getaffinity)
AC_DEFINE([TUKLIB_CPUCORES_SCHED_GETAFFINITY], [1],
[Define to 1 if the number of available CPU cores
can be detected with sched_getaffinity()])
;;
cpuset)
AC_DEFINE([TUKLIB_CPUCORES_CPUSET], [1],
[Define to 1 if the number of available CPU cores
can be detected with cpuset(2).])
;;
sysctl) sysctl)
AC_DEFINE([TUKLIB_CPUCORES_SYSCTL], [1], AC_DEFINE([TUKLIB_CPUCORES_SYSCTL], [1],
[Define to 1 if the number of available CPU cores [Define to 1 if the number of available CPU cores

View File

@ -1,6 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# SYNOPSIS # SYNOPSIS
# #
@ -10,41 +7,28 @@
# #
# Checks for tuklib_integer.h: # Checks for tuklib_integer.h:
# - Endianness # - Endianness
# - Does the compiler or the operating system provide byte swapping macros # - Does operating system provide byte swapping macros
# - Does the hardware support fast unaligned access to 16-bit, 32-bit, # - Does the hardware support fast unaligned access to 16-bit
# and 64-bit integers # and 32-bit integers
# #
############################################################################# # COPYING
# #
# Author: Lasse Collin # Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
# #
#############################################################################
AC_DEFUN_ONCE([TUKLIB_INTEGER], [ AC_DEFUN_ONCE([TUKLIB_INTEGER], [
AC_REQUIRE([TUKLIB_COMMON]) AC_REQUIRE([TUKLIB_COMMON])
AC_REQUIRE([AC_C_BIGENDIAN]) AC_REQUIRE([AC_C_BIGENDIAN])
AC_CHECK_HEADERS([byteswap.h sys/endian.h sys/byteorder.h], [break])
AC_MSG_CHECKING([if __builtin_bswap16/32/64 are supported]) # Even if we have byteswap.h, we may lack the specific macros/functions.
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], if test x$ac_cv_header_byteswap_h = xyes ; then
[[__builtin_bswap16(1); m4_foreach([FUNC], [bswap_16,bswap_32,bswap_64], [
__builtin_bswap32(1); AC_MSG_CHECKING([if FUNC is available])
__builtin_bswap64(1);]])], AC_LINK_IFELSE([AC_LANG_SOURCE([
[
AC_DEFINE([HAVE___BUILTIN_BSWAPXX], [1],
[Define to 1 if the GNU C extensions
__builtin_bswap16/32/64 are supported.])
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
# Look for other byteswapping methods.
AC_CHECK_HEADERS([byteswap.h sys/endian.h sys/byteorder.h], [break])
# Even if we have byteswap.h we may lack the specific macros/functions.
if test x$ac_cv_header_byteswap_h = xyes ; then
m4_foreach([FUNC], [bswap_16,bswap_32,bswap_64], [
AC_MSG_CHECKING([if FUNC is available])
AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <byteswap.h> #include <byteswap.h>
int int
main(void) main(void)
@ -52,61 +36,28 @@ main(void)
FUNC[](42); FUNC[](42);
return 0; return 0;
} }
])], [ ])], [
AC_DEFINE(HAVE_[]m4_toupper(FUNC), [1], AC_DEFINE(HAVE_[]m4_toupper(FUNC), [1],
[Define to 1 if] FUNC [is available.]) [Define to 1 if] FUNC [is available.])
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
], [AC_MSG_RESULT([no])]) ], [AC_MSG_RESULT([no])])
])dnl ])dnl
fi fi
])
AC_MSG_CHECKING([if unaligned memory access should be used]) AC_MSG_CHECKING([if unaligned memory access should be used])
AC_ARG_ENABLE([unaligned-access], AS_HELP_STRING([--enable-unaligned-access], AC_ARG_ENABLE([unaligned-access], AC_HELP_STRING([--enable-unaligned-access],
[Enable if the system supports *fast* unaligned memory access [Enable if the system supports *fast* unaligned memory access
with 16-bit, 32-bit, and 64-bit integers. By default, with 16-bit and 32-bit integers. By default, this is enabled
this is enabled on x86, x86-64, only on x86, x86_64, and big endian PowerPC.]),
32/64-bit big endian PowerPC,
64-bit little endian PowerPC,
and some ARM, ARM64, and RISC-V systems.]),
[], [enable_unaligned_access=auto]) [], [enable_unaligned_access=auto])
if test "x$enable_unaligned_access" = xauto ; then if test "x$enable_unaligned_access" = xauto ; then
# NOTE: There might be other architectures on which unaligned access # TODO: There may be other architectures, on which unaligned access
# is fast. # is OK.
case $host_cpu in case $host_cpu in
i?86|x86_64|powerpc|powerpc64|powerpc64le) i?86|x86_64|powerpc|powerpc64)
enable_unaligned_access=yes enable_unaligned_access=yes
;; ;;
arm*|aarch64*|riscv*)
# On 32-bit and 64-bit ARM, GCC and Clang
# #define __ARM_FEATURE_UNALIGNED if
# unaligned access is supported.
#
# Exception: GCC at least up to 13.2.0
# defines it even when using -mstrict-align
# so in that case this autodetection goes wrong.
# Most of the time -mstrict-align isn't used so it
# shouldn't be a common problem in practice. See:
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111555
#
# RISC-V C API Specification says that if
# __riscv_misaligned_fast is defined then
# unaligned access is known to be fast.
#
# MSVC is handled as a special case: We assume that
# 32/64-bit ARM supports fast unaligned access.
# If MSVC gets RISC-V support then this will assume
# fast unaligned access on RISC-V too.
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#if !defined(__ARM_FEATURE_UNALIGNED) \
&& !defined(__riscv_misaligned_fast) \
&& !defined(_MSC_VER)
compile error
#endif
int main(void) { return 0; }
])], [enable_unaligned_access=yes], [enable_unaligned_access=no])
;;
*) *)
enable_unaligned_access=no enable_unaligned_access=no
;; ;;
@ -114,39 +65,10 @@ int main(void) { return 0; }
fi fi
if test "x$enable_unaligned_access" = xyes ; then if test "x$enable_unaligned_access" = xyes ; then
AC_DEFINE([TUKLIB_FAST_UNALIGNED_ACCESS], [1], [Define to 1 if AC_DEFINE([TUKLIB_FAST_UNALIGNED_ACCESS], [1], [Define to 1 if
the system supports fast unaligned access to 16-bit, the system supports fast unaligned access to 16-bit and
32-bit, and 64-bit integers.]) 32-bit integers.])
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
AC_MSG_CHECKING([if unsafe type punning should be used])
AC_ARG_ENABLE([unsafe-type-punning],
AS_HELP_STRING([--enable-unsafe-type-punning],
[This introduces strict aliasing violations and may result
in broken code. However, this might improve performance in
some cases, especially with old compilers (e.g.
GCC 3 and early 4.x on x86, GCC < 6 on ARMv6 and ARMv7).]),
[], [enable_unsafe_type_punning=no])
if test "x$enable_unsafe_type_punning" = xyes ; then
AC_DEFINE([TUKLIB_USE_UNSAFE_TYPE_PUNNING], [1], [Define to 1 to use
unsafe type punning, e.g. char *x = ...; *(int *)x = 123;
which violates strict aliasing rules and thus is
undefined behavior and might result in broken code.])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([if __builtin_assume_aligned is supported])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[__builtin_assume_aligned("", 1);]])],
[
AC_DEFINE([HAVE___BUILTIN_ASSUME_ALIGNED], [1],
[Define to 1 if the GNU C extension
__builtin_assume_aligned is supported.])
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
])dnl ])dnl

View File

@ -1,6 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# SYNOPSIS # SYNOPSIS
# #
@ -18,11 +15,13 @@
# functions, but each function is put into a separate .c file so # functions, but each function is put into a separate .c file so
# that it is possible to pick only what is strictly needed. # that it is possible to pick only what is strictly needed.
# #
############################################################################# # COPYING
# #
# Author: Lasse Collin # Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
# #
#############################################################################
AC_DEFUN_ONCE([TUKLIB_MBSTR], [ AC_DEFUN_ONCE([TUKLIB_MBSTR], [
AC_REQUIRE([TUKLIB_COMMON]) AC_REQUIRE([TUKLIB_COMMON])

View File

@ -1,6 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# SYNOPSIS # SYNOPSIS
# #
@ -13,8 +10,8 @@
# #
# Supported methods: # Supported methods:
# #
# - Windows (including Cygwin), OS/2, DJGPP (DOS), OpenVMS, AROS, # - Windows (including Cygwin), OS/2, DJGPP (DOS), and OpenVMS have
# and QNX have operating-system specific functions. # operating-system specific functions.
# #
# - AIX has _system_configuration.physmem. # - AIX has _system_configuration.physmem.
# #
@ -32,11 +29,13 @@
# - sysinfo() works on Linux/dietlibc and probably on other Linux # - sysinfo() works on Linux/dietlibc and probably on other Linux
# systems whose libc may lack sysconf(). # systems whose libc may lack sysconf().
# #
############################################################################# # COPYING
# #
# Author: Lasse Collin # Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
# #
#############################################################################
AC_DEFUN_ONCE([TUKLIB_PHYSMEM], [ AC_DEFUN_ONCE([TUKLIB_PHYSMEM], [
AC_REQUIRE([TUKLIB_COMMON]) AC_REQUIRE([TUKLIB_COMMON])
@ -55,7 +54,7 @@ AC_CACHE_CHECK([how to detect the amount of physical memory],
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) \ #if defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) \
|| defined(__DJGPP__) || defined(__VMS) \ || defined(__DJGPP__) || defined(__VMS) \
|| defined(AMIGA) || defined(__AROS__) || defined(__QNX__) || defined(AMIGA) || defined(__AROS__)
int main(void) { return 0; } int main(void) { return 0; }
#else #else
compile error compile error
@ -89,6 +88,7 @@ main(void)
]])], [tuklib_cv_physmem_method=sysconf], [ ]])], [tuklib_cv_physmem_method=sysconf], [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
# include <sys/param.h> # include <sys/param.h>
#endif #endif

View File

@ -1,6 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# SYNOPSIS # SYNOPSIS
# #
@ -14,16 +11,15 @@
# This .m4 file is needed allow this module to use glibc's # This .m4 file is needed allow this module to use glibc's
# program_invocation_name. # program_invocation_name.
# #
############################################################################# # COPYING
# #
# Author: Lasse Collin # Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
# #
#############################################################################
AC_DEFUN_ONCE([TUKLIB_PROGNAME], [ AC_DEFUN_ONCE([TUKLIB_PROGNAME], [
AC_REQUIRE([TUKLIB_COMMON]) AC_REQUIRE([TUKLIB_COMMON])
AC_CHECK_DECL([program_invocation_name], [AC_DEFINE( AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
[HAVE_PROGRAM_INVOCATION_NAME], [1],
[Define to 1 if 'program_invocation_name' is declared in <errno.h>.])],
[], [#include <errno.h>])
])dnl ])dnl

View File

@ -1,84 +0,0 @@
dnl SPDX-License-Identifier: FSFULLR
# visibility.m4 serial 8
dnl Copyright (C) 2005, 2008, 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl Tests whether the compiler supports the command-line option
dnl -fvisibility=hidden and the function and variable attributes
dnl __attribute__((__visibility__("hidden"))) and
dnl __attribute__((__visibility__("default"))).
dnl Does *not* test for __visibility__("protected") - which has tricky
dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
dnl Mac OS X.
dnl Does *not* test for __visibility__("internal") - which has processor
dnl dependent semantics.
dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
dnl "really only recommended for legacy code".
dnl Set the variable CFLAG_VISIBILITY.
dnl Defines and sets the variable HAVE_VISIBILITY.
AC_DEFUN([gl_VISIBILITY],
[
AC_REQUIRE([AC_PROG_CC])
CFLAG_VISIBILITY=
HAVE_VISIBILITY=0
if test -n "$GCC"; then
dnl First, check whether -Werror can be added to the command line, or
dnl whether it leads to an error because of some other option that the
dnl user has put into $CC $CFLAGS $CPPFLAGS.
AC_CACHE_CHECK([whether the -Werror option is usable],
[gl_cv_cc_vis_werror],
[gl_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]], [[]])],
[gl_cv_cc_vis_werror=yes],
[gl_cv_cc_vis_werror=no])
CFLAGS="$gl_save_CFLAGS"
])
dnl Now check whether visibility declarations are supported.
AC_CACHE_CHECK([for simple visibility declarations],
[gl_cv_cc_visibility],
[gl_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden"
dnl We use the option -Werror and a function dummyfunc, because on some
dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
dnl "visibility attribute not supported in this configuration; ignored"
dnl at the first function definition in every compilation unit, and we
dnl don't want to use the option in this case.
if test $gl_cv_cc_vis_werror = yes; then
CFLAGS="$CFLAGS -Werror"
fi
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
extern __attribute__((__visibility__("default"))) int exportedvar;
extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
extern __attribute__((__visibility__("default"))) int exportedfunc (void);
void dummyfunc (void);
int hiddenvar;
int exportedvar;
int hiddenfunc (void) { return 51; }
int exportedfunc (void) { return 1225736919; }
void dummyfunc (void) {}
]],
[[]])],
[gl_cv_cc_visibility=yes],
[gl_cv_cc_visibility=no])
CFLAGS="$gl_save_CFLAGS"
])
if test $gl_cv_cc_visibility = yes; then
CFLAG_VISIBILITY="-fvisibility=hidden"
HAVE_VISIBILITY=1
fi
fi
AC_SUBST([CFLAG_VISIBILITY])
AC_SUBST([HAVE_VISIBILITY])
AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
[Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
])

113
macosx/build.sh Executable file
View File

@ -0,0 +1,113 @@
#!/bin/sh
###############################################################################
# Author: Anders F Björklund <afb@users.sourceforge.net>
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
###############################################################################
mkdir -p Root
mkdir -p Resources
# Abort immediately if something goes wrong.
set -e
GCC="gcc-4.2"
SDK="/Developer/SDKs/MacOSX10.5.sdk"
MDT="10.5"
GTT=i686-apple-darwin9
ARCHES1="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
ARCHES2="-arch ppc -arch i386"
PKGFORMAT="10.5" # xar
# avoid "unknown required load command: 0x80000022" from linking on Snow Leopard
uname -r | grep ^1 >/dev/null && LDFLAGS="$LDFLAGS -Wl,-no_compact_linkedit"
# Clean up if it was already configured.
[ -f Makefile ] && make distclean
# Build the regular fat program
CC="$GCC" \
CFLAGS="-O2 -g $ARCHES1 -isysroot $SDK -mmacosx-version-min=$MDT" \
../configure --disable-dependency-tracking --disable-xzdec --disable-lzmadec $GTT
make
make check
make DESTDIR=`pwd`/Root install
make distclean
# Build the size-optimized program
CC="$GCC" \
CFLAGS="-Os -g $ARCHES2 -isysroot $SDK -mmacosx-version-min=$MDT" \
../configure --disable-dependency-tracking --disable-shared --disable-nls --disable-encoders --enable-small --disable-threads $GTT
make -C src/liblzma
make -C src/xzdec
make -C src/xzdec DESTDIR=`pwd`/Root install
cp -a ../extra Root/usr/local/share/doc/xz
make distclean
# Move development files to different package
test -d liblzma && rm -r liblzma
mkdir -p liblzma/usr/local
mv Root/usr/local/include liblzma/usr/local
mv Root/usr/local/lib liblzma/usr/local
mkdir -p Root/usr/local/lib
cp -p liblzma/usr/local/lib/liblzma.5.dylib Root/usr/local/lib
mkdir -p liblzma/usr/local/share/doc/xz
mv Root/usr/local/share/doc/xz/examples* liblzma/usr/local/share/doc/xz
# Strip debugging symbols and make relocatable
for bin in xz lzmainfo xzdec lzmadec; do
strip -S Root/usr/local/bin/$bin
install_name_tool -change /usr/local/lib/liblzma.5.dylib @executable_path/../lib/liblzma.5.dylib Root/usr/local/bin/$bin
done
for lib in liblzma.5.dylib; do
strip -S Root/usr/local/lib/$lib
install_name_tool -id @executable_path/../lib/liblzma.5.dylib Root/usr/local/lib/$lib
done
# Create tarball, but without the HFS+ attrib
rmdir debug lib po src/liblzma/api src/liblzma src/lzmainfo src/scripts src/xz src/xzdec src tests
( cd Root/usr/local; COPY_EXTENDED_ATTRIBUTES_DISABLE=true COPYFILE_DISABLE=true tar cvjf ../../../XZ.tbz * )
( cd liblzma; COPY_EXTENDED_ATTRIBUTES_DISABLE=true COPYFILE_DISABLE=true tar cvjf ../liblzma.tbz ./usr/local )
# Include documentation files for package
cp -p ../README Resources/ReadMe.txt
cp -p ../COPYING Resources/License.txt
# Make an Installer.app package
ID="org.tukaani.xz"
VERSION=`cd ..; sh build-aux/version.sh`
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
$PACKAGEMAKER -r Root/usr/local -l /usr/local -e Resources -i $ID -n $VERSION -t XZ -o XZ.pkg -g $PKGFORMAT --verbose
$PACKAGEMAKER -r liblzma -w -k -i $ID.liblzma -n $VERSION -o liblzma.pkg -g $PKGFORMAT --verbose
# Put the package in a disk image
if [ "$PKGFORMAT" != "10.5" ]; then
hdiutil create -fs HFS+ -format UDZO -quiet -srcfolder XZ.pkg -ov XZ.dmg
hdiutil internet-enable -yes -quiet XZ.dmg
fi
echo
echo "Build completed successfully."
echo

View File

@ -1,23 +1,5 @@
ca
cs cs
da
de de
eo
es
fi
fr fr
hr
hu
it it
ko
pl pl
pt
pt_BR
ro
sr
sv
tr
uk
vi
zh_CN
zh_TW

View File

@ -1,10 +1,4 @@
# SPDX-License-Identifier: FSFUL
# Makefile variables for PO directory in any package using GNU gettext. # Makefile variables for PO directory in any package using GNU gettext.
#
# Copyright (C) 2003-2019 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation gives
# unlimited permission to use, copy, distribute, and modify it.
# Usually the message domain is the same as the package name. # Usually the message domain is the same as the package name.
DOMAIN = $(PACKAGE) DOMAIN = $(PACKAGE)
@ -14,7 +8,7 @@ subdir = po
top_builddir = .. top_builddir = ..
# These options get passed to xgettext. # These options get passed to xgettext.
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --no-wrap --package-name='XZ Utils' XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
# This is the copyright holder that gets inserted into the header of the # This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
@ -24,14 +18,7 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --no-wrap --package-name='XZ Utils'
# or entity, or to disclaim their copyright. The empty string stands for # or entity, or to disclaim their copyright. The empty string stands for
# the public domain; in this case the translators are expected to disclaim # the public domain; in this case the translators are expected to disclaim
# their copyright. # their copyright.
COPYRIGHT_HOLDER = The XZ Utils authors and contributors COPYRIGHT_HOLDER =
# This tells whether or not to prepend "GNU " prefix to the package
# name that gets inserted into the header of the $(DOMAIN).pot file.
# Possible values are "yes", "no", or empty. If it is empty, try to
# detect it automatically by scanning the files in $(top_srcdir) for
# "GNU packagename" string.
PACKAGE_GNU = no
# This is the email address or URL to which the translators shall report # This is the email address or URL to which the translators shall report
# bugs in the untranslated strings: # bugs in the untranslated strings:
@ -53,35 +40,7 @@ MSGID_BUGS_ADDRESS =
# message catalogs shall be used. It is usually empty. # message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES = EXTRA_LOCALE_CATEGORIES =
# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' # Although you may need slightly wider terminal than 80 chars, it is
# context. Possible values are "yes" and "no". Set this to yes if the # much nicer to edit the output of --help when this is set.
# package uses functions taking also a message context, like pgettext(), or XGETTEXT_OPTIONS += --no-wrap
# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. MSGMERGE += --no-wrap
USE_MSGCTXT = no
# These options get passed to msgmerge.
# Useful options are in particular:
# --previous to keep previous msgids of translated messages,
# --quiet to reduce the verbosity.
MSGMERGE_OPTIONS = --no-wrap
# These options get passed to msginit.
# If you want to disable line wrapping when writing PO files, add
# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
# MSGINIT_OPTIONS.
#
# Although one may need slightly wider terminal than 80 chars, it is
# much nicer to edit the output of --help when --no-wrap is set.
MSGINIT_OPTIONS = --no-wrap
# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
# has changed. Possible values are "yes" and "no". Set this to no if
# the POT file is checked in the repository and the version control
# program ignores timestamps.
PO_DEPENDS_ON_POT = yes
# This tells whether or not to forcibly update $(DOMAIN).pot and
# regenerate PO files on "make dist". Possible values are "yes" and
# "no". Set this to no if the POT file and PO files are maintained
# externally.
DIST_DEPENDS_ON_UPDATE_PO = yes

View File

@ -1,5 +1,3 @@
# SPDX-License-Identifier: 0BSD
# List of source files which contain translatable strings. # List of source files which contain translatable strings.
src/xz/args.c src/xz/args.c
src/xz/coder.c src/xz/coder.c
@ -8,10 +6,8 @@ src/xz/hardware.c
src/xz/list.c src/xz/list.c
src/xz/main.c src/xz/main.c
src/xz/message.c src/xz/message.c
src/xz/mytime.c
src/xz/options.c src/xz/options.c
src/xz/signals.c src/xz/signals.c
src/xz/suffix.c src/xz/suffix.c
src/xz/util.c src/xz/util.c
src/lzmainfo/lzmainfo.c
src/common/tuklib_exit.c src/common/tuklib_exit.c

1031
po/ca.po

File diff suppressed because it is too large Load Diff

592
po/cs.po

File diff suppressed because it is too large Load Diff

896
po/da.po
View File

@ -1,896 +0,0 @@
# Danish translation xz.
# This file is put in the public domain.
# Joe Hansen <joedalton2@yahoo.dk>, 2019.
#
msgid ""
msgstr ""
"Project-Id-Version: xz 5.2.4\n"
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
"POT-Creation-Date: 2018-04-29 18:19+0300\n"
"PO-Revision-Date: 2019-03-04 23:08+0100\n"
"Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n"
"Language-Team: Danish <dansk@dansk-gruppen.dk>\n"
"Language: da\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/xz/args.c:63
#, c-format
msgid "%s: Invalid argument to --block-list"
msgstr "%s: Ugyldigt parameter til --block-list"
#: src/xz/args.c:73
#, c-format
msgid "%s: Too many arguments to --block-list"
msgstr "%s: For mange argumenter til --block-list"
#: src/xz/args.c:102
msgid "0 can only be used as the last element in --block-list"
msgstr "0 kan kun bruges som det sidste element i --block-list"
#: src/xz/args.c:406
#, c-format
msgid "%s: Unknown file format type"
msgstr "%s: Ukendt filformattype"
#: src/xz/args.c:429 src/xz/args.c:437
#, c-format
msgid "%s: Unsupported integrity check type"
msgstr "%s: Typen for integritetkontrol er ikke understøttet"
#: src/xz/args.c:473
msgid "Only one file can be specified with `--files' or `--files0'."
msgstr "Kun en fil kan angives med »--files« eller »--files0«."
#: src/xz/args.c:541
#, c-format
msgid "The environment variable %s contains too many arguments"
msgstr "Miljøvariablen %s indeholder for mange argumenter"
#: src/xz/args.c:643
msgid "Compression support was disabled at build time"
msgstr "Komprimeringsunderstøttelse blev deaktiveret på byggetidspunktet"
#: src/xz/args.c:650
msgid "Decompression support was disabled at build time"
msgstr "Dekomprimeringsunderstøttelse blev deaktiveret på byggetidspunktet"
#: src/xz/coder.c:110
msgid "Maximum number of filters is four"
msgstr "Maksimalt antal filtre er fire"
#: src/xz/coder.c:129
msgid "Memory usage limit is too low for the given filter setup."
msgstr "Begræsningen for brug af hukommelse er for lav for den givne filteropsætning."
#: src/xz/coder.c:159
msgid "Using a preset in raw mode is discouraged."
msgstr "Det frarådes at bruge en forhåndskonfiguration i rå tilstand (raw mode)."
#: src/xz/coder.c:161
msgid "The exact options of the presets may vary between software versions."
msgstr "De præcise indstillinger for forhåndskonfigurationerne kan variere mellem programversioner."
#: src/xz/coder.c:184
msgid "The .lzma format supports only the LZMA1 filter"
msgstr "Formatet .lzma understøtter kun LZMA1-filteret"
#: src/xz/coder.c:192
msgid "LZMA1 cannot be used with the .xz format"
msgstr "LZMA1 kan ikke bruges med .xz-formatet"
#: src/xz/coder.c:209
msgid "The filter chain is incompatible with --flush-timeout"
msgstr "Filterkæden er ikke kompatibel med --flush-timeout"
#: src/xz/coder.c:215
msgid "Switching to single-threaded mode due to --flush-timeout"
msgstr "Skifter til enkelt trådet tilstand på grund af --flush-timeout"
#: src/xz/coder.c:235
#, c-format
msgid "Using up to %<PRIu32> threads."
msgstr "Bruger op til %<PRIu32> tråde."
#: src/xz/coder.c:251
msgid "Unsupported filter chain or filter options"
msgstr "Filterkæde eller filterindstillinger er ikke understøttet"
#: src/xz/coder.c:263
#, c-format
msgid "Decompression will need %s MiB of memory."
msgstr "Dekomprimering vil kræve %s MiB hukommelse."
#: src/xz/coder.c:300
#, c-format
msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB"
msgstr "Justerede antallet af tråde fra %s til %s for ikke at overskride begræsningen på brug af hukommelse på %s MiB"
#: src/xz/coder.c:354
#, c-format
msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
msgstr "Justerede LZMA%c-ordbogsstørrelsen fra %s MiB til %s MiB for ikke at overskride begrænsningen på brug af hukommelse på %s MiB"
#: src/xz/file_io.c:110 src/xz/file_io.c:118
#, c-format
msgid "Error creating a pipe: %s"
msgstr "Det opstod en fejl under oprettelse af en datakanal: %s"
#: src/xz/file_io.c:173
msgid "Sandbox is disabled due to incompatible command line arguments"
msgstr "Sandkassen er deaktiveret på grund af inkompatible kommandolinjeargumenter"
#: src/xz/file_io.c:216
msgid "Sandbox was successfully enabled"
msgstr "Sandkassen blev aktiveret"
#: src/xz/file_io.c:220
msgid "Failed to enable the sandbox"
msgstr "Kunne ikke aktivere sandkassen"
#: src/xz/file_io.c:262
#, c-format
msgid "%s: poll() failed: %s"
msgstr "%s: poll() mislykkedes: %s"
#. TRANSLATORS: When compression or decompression finishes,
#. and xz is going to remove the source file, xz first checks
#. if the source file still exists, and if it does, does its
#. device and inode numbers match what xz saw when it opened
#. the source file. If these checks fail, this message is
#. shown, %s being the filename, and the file is not deleted.
#. The check for device and inode numbers is there, because
#. it is possible that the user has put a new file in place
#. of the original file, and in that case it obviously
#. shouldn't be removed.
#: src/xz/file_io.c:332
#, c-format
msgid "%s: File seems to have been moved, not removing"
msgstr "%s: Filen er vist blevet flyttet, sletter ikke"
#: src/xz/file_io.c:339 src/xz/file_io.c:878
#, c-format
msgid "%s: Cannot remove: %s"
msgstr "%s: Kan ikke fjerne: %s"
#: src/xz/file_io.c:364
#, c-format
msgid "%s: Cannot set the file owner: %s"
msgstr "%s: Kan ikke angive filejeren: %s"
#: src/xz/file_io.c:370
#, c-format
msgid "%s: Cannot set the file group: %s"
msgstr "%s: Kan ikke angive filgruppen: %s"
#: src/xz/file_io.c:389
#, c-format
msgid "%s: Cannot set the file permissions: %s"
msgstr "%s: Kan ikke angive filtilladelser: %s"
#: src/xz/file_io.c:515
#, c-format
msgid "Error getting the file status flags from standard input: %s"
msgstr "Der opstod en fejl under indhentelse af filstatusflag fra standardind: %s"
#: src/xz/file_io.c:572 src/xz/file_io.c:634
#, c-format
msgid "%s: Is a symbolic link, skipping"
msgstr "%s: Er en symbolsk henvisning, udelader"
#: src/xz/file_io.c:663
#, c-format
msgid "%s: Is a directory, skipping"
msgstr "%s: Er en mappe, udelader"
#: src/xz/file_io.c:669
#, c-format
msgid "%s: Not a regular file, skipping"
msgstr "%s: Er ikke en normal fil, udelader"
#: src/xz/file_io.c:686
#, c-format
msgid "%s: File has setuid or setgid bit set, skipping"
msgstr "%s: Filen har setuid- eller setgid-bitsæt, udelader"
#: src/xz/file_io.c:693
#, c-format
msgid "%s: File has sticky bit set, skipping"
msgstr "%s: Fil har klæbende bitsæt, udelader"
#: src/xz/file_io.c:700
#, c-format
msgid "%s: Input file has more than one hard link, skipping"
msgstr "%s: Inddatafil har mere end en hård henvisning, udelader"
#: src/xz/file_io.c:788
#, c-format
msgid "Error restoring the status flags to standard input: %s"
msgstr "Der opstod en fejl under gendannelse af statusflagene til standardind: %s"
#: src/xz/file_io.c:836
#, c-format
msgid "Error getting the file status flags from standard output: %s"
msgstr "Der opstod en fejl under indhentelse af filstatusflag fra standardud: %s"
#: src/xz/file_io.c:1014
#, c-format
msgid "Error restoring the O_APPEND flag to standard output: %s"
msgstr "Der opstod en fejl under gendannelse af flaget O_APPEND til standardud: %s"
#: src/xz/file_io.c:1026
#, c-format
msgid "%s: Closing the file failed: %s"
msgstr "%s: Lukning af filen fejlede: %s"
#: src/xz/file_io.c:1062 src/xz/file_io.c:1288
#, c-format
msgid "%s: Seeking failed when trying to create a sparse file: %s"
msgstr "%s: Søgning fejlede under forsøg på at oprette en tynd fil: %s"
#: src/xz/file_io.c:1157
#, c-format
msgid "%s: Read error: %s"
msgstr "%s: Læsefejl: %s"
#: src/xz/file_io.c:1177
#, c-format
msgid "%s: Error seeking the file: %s"
msgstr "%s: Der opstod en fejl under søgning efter filen: %s"
#: src/xz/file_io.c:1187
#, c-format
msgid "%s: Unexpected end of file"
msgstr "%s: Uventet filafslutning"
#: src/xz/file_io.c:1246
#, c-format
msgid "%s: Write error: %s"
msgstr "%s: Skrivefejl: %s"
#: src/xz/hardware.c:107
msgid "Disabled"
msgstr "Deaktiveret"
#. TRANSLATORS: Test with "xz --info-memory" to see if
#. the alignment looks nice.
#: src/xz/hardware.c:126
msgid "Total amount of physical memory (RAM): "
msgstr "Samlet mængde fysisk hukommelse (RAM): "
#: src/xz/hardware.c:128
msgid "Memory usage limit for compression: "
msgstr "Grænse for hukommelsesforbrug til komprimering: "
#: src/xz/hardware.c:130
msgid "Memory usage limit for decompression: "
msgstr "Grænse for hukommelsesforbug til dekomprimering: "
#. TRANSLATORS: Indicates that there is no integrity check.
#. This string is used in tables, so the width must not
#. exceed ten columns with a fixed-width font.
#: src/xz/list.c:65
msgid "None"
msgstr "Ingen"
#. TRANSLATORS: Indicates that integrity check name is not known,
#. but the Check ID is known (here 2). This and other "Unknown-N"
#. strings are used in tables, so the width must not exceed ten
#. columns with a fixed-width font. It's OK to omit the dash if
#. you need space for one extra letter, but don't use spaces.
#: src/xz/list.c:72
msgid "Unknown-2"
msgstr "Ukendt-2"
#: src/xz/list.c:73
msgid "Unknown-3"
msgstr "Ukendt-3"
#: src/xz/list.c:75
msgid "Unknown-5"
msgstr "Ukendt-5"
#: src/xz/list.c:76
msgid "Unknown-6"
msgstr "Ukendt-6"
#: src/xz/list.c:77
msgid "Unknown-7"
msgstr "Ukendt-7"
#: src/xz/list.c:78
msgid "Unknown-8"
msgstr "Ukendt-8"
#: src/xz/list.c:79
msgid "Unknown-9"
msgstr "Ukendt-9"
#: src/xz/list.c:81
msgid "Unknown-11"
msgstr "Ukendt-11"
#: src/xz/list.c:82
msgid "Unknown-12"
msgstr "Ukendt-12"
#: src/xz/list.c:83
msgid "Unknown-13"
msgstr "Ukendt-13"
#: src/xz/list.c:84
msgid "Unknown-14"
msgstr "Ukendt-14"
#: src/xz/list.c:85
msgid "Unknown-15"
msgstr "Ukendt-15"
#: src/xz/list.c:153
#, c-format
msgid "%s: File is empty"
msgstr "%s: Filen er tom"
#: src/xz/list.c:158
#, c-format
msgid "%s: Too small to be a valid .xz file"
msgstr "%s: For lille til at være en gyldig .xz-fil"
#. TRANSLATORS: These are column headings. From Strms (Streams)
#. to Ratio, the columns are right aligned. Check and Filename
#. are left aligned. If you need longer words, it's OK to
#. use two lines here. Test with "xz -l foo.xz".
#: src/xz/list.c:677
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
msgstr ""
#: src/xz/list.c:717
#, c-format
msgid " Streams: %s\n"
msgstr " Strømme: %s\n"
#: src/xz/list.c:719
#, c-format
msgid " Blocks: %s\n"
msgstr " Blokke: %s\n"
#: src/xz/list.c:721
#, c-format
msgid " Compressed size: %s\n"
msgstr " Komprimeret str.: %s\n"
#: src/xz/list.c:724
#, c-format
msgid " Uncompressed size: %s\n"
msgstr " Ukomprimeret str.: %s\n"
#: src/xz/list.c:727
#, c-format
msgid " Ratio: %s\n"
msgstr " Pakkeforhold: %s\n"
#: src/xz/list.c:729
#, c-format
msgid " Check: %s\n"
msgstr " Kontrol: %s\n"
#: src/xz/list.c:730
#, c-format
msgid " Stream padding: %s\n"
msgstr " Strømfyld: %s\n"
#. TRANSLATORS: The second line is column headings. All except
#. Check are right aligned; Check is left aligned. Test with
#. "xz -lv foo.xz".
#: src/xz/list.c:758
msgid ""
" Streams:\n"
" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding"
msgstr ""
" Strømme:\n"
" Strøm Blokke KompForsk. DekompForsk. KompStr. DekompStr. Forh. Kontrol Fyld"
#. TRANSLATORS: The second line is column headings. All
#. except Check are right aligned; Check is left aligned.
#: src/xz/list.c:813
#, c-format
msgid ""
" Blocks:\n"
" Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check"
msgstr ""
" Blokke:\n"
" Strøm Blok KompForsk. DekompForsk. Ialtstr. DekompStr. Forh. Kontrol"
#. TRANSLATORS: These are additional column headings
#. for the most verbose listing mode. CheckVal
#. (Check value), Flags, and Filters are left aligned.
#. Header (Block Header Size), CompSize, and MemUsage
#. are right aligned. %*s is replaced with 0-120
#. spaces to make the CheckVal column wide enough.
#. Test with "xz -lvv foo.xz".
#: src/xz/list.c:825
#, c-format
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
msgstr " KontrolVær %*sTeksth Flag Kompstr. HukForb. Filtre"
#: src/xz/list.c:903 src/xz/list.c:1078
#, c-format
msgid " Memory needed: %s MiB\n"
msgstr " Hukommelse krævet: %s MiB\n"
#: src/xz/list.c:905 src/xz/list.c:1080
#, c-format
msgid " Sizes in headers: %s\n"
msgstr " Størrelser i teksthoveder: %s\n"
#: src/xz/list.c:906 src/xz/list.c:1081
msgid "Yes"
msgstr "Ja"
#: src/xz/list.c:906 src/xz/list.c:1081
msgid "No"
msgstr "Nej"
#: src/xz/list.c:907 src/xz/list.c:1082
#, c-format
msgid " Minimum XZ Utils version: %s\n"
msgstr " Minimum for XZ Utils-version: %s\n"
#. TRANSLATORS: %s is an integer. Only the plural form of this
#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz".
#: src/xz/list.c:1057
#, c-format
msgid "%s file\n"
msgid_plural "%s files\n"
msgstr[0] "%s fil\n"
msgstr[1] "%s filer\n"
#: src/xz/list.c:1070
msgid "Totals:"
msgstr "I alt:"
#: src/xz/list.c:1071
#, c-format
msgid " Number of files: %s\n"
msgstr " Antal filer: %s\n"
#: src/xz/list.c:1146
msgid "--list works only on .xz files (--format=xz or --format=auto)"
msgstr ""
#: src/xz/list.c:1152
msgid "--list does not support reading from standard input"
msgstr "--list understøtter ikke læsning fra standardind"
#: src/xz/main.c:89
#, c-format
msgid "%s: Error reading filenames: %s"
msgstr "%s: Der opstod en fejl under forsøg på læsning af filnavne: %s"
#: src/xz/main.c:96
#, c-format
msgid "%s: Unexpected end of input when reading filenames"
msgstr "%s: Uventet afslutning på inddata under forsøg på læsning af filnavne"
#: src/xz/main.c:120
#, c-format
msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?"
msgstr ""
#: src/xz/main.c:174
msgid "Compression and decompression with --robot are not supported yet."
msgstr "Komprimering og dekomprimering med --robot er endnu ikke understøttet."
#: src/xz/main.c:252
msgid "Cannot read data from standard input when reading filenames from standard input"
msgstr ""
#. TRANSLATORS: This is the program name in the beginning
#. of the line in messages. Usually it becomes "xz: ".
#. This is a translatable string because French needs
#. a space before a colon.
#: src/xz/message.c:714
#, c-format
msgid "%s: "
msgstr "%s: "
#: src/xz/message.c:777 src/xz/message.c:827
msgid "Internal error (bug)"
msgstr "Intern fejl (fejl)"
#: src/xz/message.c:784
msgid "Cannot establish signal handlers"
msgstr "Kan ikke etbalere signalhåndteringer"
#: src/xz/message.c:793
msgid "No integrity check; not verifying file integrity"
msgstr "Ingen integritetkontrol; verificerer ikke filintegritet"
#: src/xz/message.c:796
msgid "Unsupported type of integrity check; not verifying file integrity"
msgstr ""
#: src/xz/message.c:803
msgid "Memory usage limit reached"
msgstr "Begrænsning på brug af hukommelse er nået"
#: src/xz/message.c:806
msgid "File format not recognized"
msgstr "Filformatet blev ikke genkendt"
#: src/xz/message.c:809
msgid "Unsupported options"
msgstr "Tilvalg er ikke understøttede"
#: src/xz/message.c:812
msgid "Compressed data is corrupt"
msgstr "Komprimerede data er ødelagte"
#: src/xz/message.c:815
msgid "Unexpected end of input"
msgstr "Uventet afslutning på inddata"
#: src/xz/message.c:848
#, c-format
msgid "%s MiB of memory is required. The limiter is disabled."
msgstr "%s MiB hukommelse er krævet. Begrænseren er deaktiveret."
#: src/xz/message.c:876
#, c-format
msgid "%s MiB of memory is required. The limit is %s."
msgstr "%s MiB hukommelse er krævet. Begrænsningen er %s."
#: src/xz/message.c:1043
#, c-format
msgid "%s: Filter chain: %s\n"
msgstr "%s: Filterkæde: %s\n"
#: src/xz/message.c:1053
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Prøv »%s --help« for yderligere information."
#: src/xz/message.c:1079
#, c-format
msgid ""
"Usage: %s [OPTION]... [FILE]...\n"
"Compress or decompress FILEs in the .xz format.\n"
"\n"
msgstr ""
#: src/xz/message.c:1086
msgid "Mandatory arguments to long options are mandatory for short options too.\n"
msgstr ""
"Obligatoriske argumenter til lange tilvalg er også obligatoriske for korte\n"
"tilvalg.\n"
#: src/xz/message.c:1090
msgid " Operation mode:\n"
msgstr " Operationstilstand:\n"
#: src/xz/message.c:1093
msgid ""
" -z, --compress force compression\n"
" -d, --decompress force decompression\n"
" -t, --test test compressed file integrity\n"
" -l, --list list information about .xz files"
msgstr ""
#: src/xz/message.c:1099
msgid ""
"\n"
" Operation modifiers:\n"
msgstr ""
"\n"
"Operationsændrere:\n"
#: src/xz/message.c:1102
msgid ""
" -k, --keep keep (don't delete) input files\n"
" -f, --force force overwrite of output file and (de)compress links\n"
" -c, --stdout write to standard output and don't delete input files"
msgstr ""
#: src/xz/message.c:1108
msgid ""
" --single-stream decompress only the first stream, and silently\n"
" ignore possible remaining input data"
msgstr ""
#: src/xz/message.c:1111
msgid ""
" --no-sparse do not create sparse files when decompressing\n"
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
" omitted, filenames are read from the standard input;\n"
" filenames must be terminated with the newline character\n"
" --files0[=FILE] like --files but use the null character as terminator"
msgstr ""
#: src/xz/message.c:1120
msgid ""
"\n"
" Basic file format and compression options:\n"
msgstr ""
#: src/xz/message.c:1122
msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto' (default), `xz', `lzma', and `raw'\n"
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
" `crc32', `crc64' (default), or `sha256'"
msgstr ""
#: src/xz/message.c:1127
msgid " --ignore-check don't verify the integrity check when decompressing"
msgstr ""
#: src/xz/message.c:1131
msgid ""
" -0 ... -9 compression preset; default is 6; take compressor *and*\n"
" decompressor memory usage into account before using 7-9!"
msgstr ""
#: src/xz/message.c:1135
msgid ""
" -e, --extreme try to improve compression ratio by using more CPU time;\n"
" does not affect decompressor memory requirements"
msgstr ""
#: src/xz/message.c:1139
msgid ""
" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n"
" to use as many threads as there are processor cores"
msgstr ""
#: src/xz/message.c:1144
msgid ""
" --block-size=SIZE\n"
" start a new .xz block after every SIZE bytes of input;\n"
" use this to set the block size for threaded compression"
msgstr ""
#: src/xz/message.c:1148
msgid ""
" --block-list=SIZES\n"
" start a new .xz block after the given comma-separated\n"
" intervals of uncompressed data"
msgstr ""
#: src/xz/message.c:1152
msgid ""
" --flush-timeout=TIMEOUT\n"
" when compressing, if more than TIMEOUT milliseconds has\n"
" passed since the previous flush and reading more input\n"
" would block, all pending data is flushed out"
msgstr ""
#: src/xz/message.c:1158
#, no-c-format
msgid ""
" --memlimit-compress=LIMIT\n"
" --memlimit-decompress=LIMIT\n"
" -M, --memlimit=LIMIT\n"
" set memory usage limit for compression, decompression,\n"
" or both; LIMIT is in bytes, % of RAM, or 0 for defaults"
msgstr ""
#: src/xz/message.c:1165
msgid ""
" --no-adjust if compression settings exceed the memory usage limit,\n"
" give an error instead of adjusting the settings downwards"
msgstr ""
#: src/xz/message.c:1171
msgid ""
"\n"
" Custom filter chain for compression (alternative for using presets):"
msgstr ""
#: src/xz/message.c:1180
msgid ""
"\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n"
" --lzma2[=OPTS] more of the following options (valid values; default):\n"
" preset=PRE reset options to a preset (0-9[e])\n"
" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n"
" lc=NUM number of literal context bits (0-4; 3)\n"
" lp=NUM number of literal position bits (0-4; 0)\n"
" pb=NUM number of position bits (0-4; 2)\n"
" mode=MODE compression mode (fast, normal; normal)\n"
" nice=NUM nice length of a match (2-273; 64)\n"
" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n"
" depth=NUM maximum search depth; 0=automatic (default)"
msgstr ""
#: src/xz/message.c:1195
msgid ""
"\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
" --arm[=OPTS] ARM BCJ filter (little endian only)\n"
" --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n"
" --sparc[=OPTS] SPARC BCJ filter\n"
" Valid OPTS for all BCJ filters:\n"
" start=NUM start offset for conversions (default=0)"
msgstr ""
#: src/xz/message.c:1207
msgid ""
"\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
" dist=NUM distance between bytes being subtracted\n"
" from each other (1-256; 1)"
msgstr ""
#: src/xz/message.c:1215
msgid ""
"\n"
" Other options:\n"
msgstr ""
"\n"
"Andre tilvalg:\n"
#: src/xz/message.c:1218
msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors too\n"
" -v, --verbose be verbose; specify twice for even more verbose"
msgstr ""
#: src/xz/message.c:1223
msgid " -Q, --no-warn make warnings not affect the exit status"
msgstr ""
#: src/xz/message.c:1225
msgid " --robot use machine-parsable messages (useful for scripts)"
msgstr ""
" --robot brug beskeder der kan fortolkes maskinelt (nyttigt\n"
" for skripter)"
#: src/xz/message.c:1228
msgid ""
" --info-memory display the total amount of RAM and the currently active\n"
" memory usage limits, and exit"
msgstr ""
#: src/xz/message.c:1231
msgid ""
" -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit"
msgstr ""
" -h, --help vis den korte hjælpetekst (viser kun grundlæggende\n"
" tilvalg)\n"
" -H, --long-help vis den lange hjælpetekst og afslut"
#: src/xz/message.c:1235
msgid ""
" -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)"
msgstr ""
" -h, --help vis den korte hjælpetekst og afslut\n"
" -H, --long-help vis den lange hjælpetekst (viser også de avancerede\n"
" tilvalg)"
#: src/xz/message.c:1240
msgid " -V, --version display the version number and exit"
msgstr " -V, --version vis versionsnummer og afslut"
#: src/xz/message.c:1242
msgid ""
"\n"
"With no FILE, or when FILE is -, read standard input.\n"
msgstr ""
"\n"
"Med ingen FIL, eller når FIL er -, læs standardind.\n"
#. TRANSLATORS: This message indicates the bug reporting address
#. for this package. Please add _another line_ saying
#. "Report translation bugs to <...>\n" with the email or WWW
#. address for translation bugs. Thanks.
#: src/xz/message.c:1248
#, c-format
msgid "Report bugs to <%s> (in English or Finnish).\n"
msgstr ""
"Rapporter fejl til <%s> (på engelsk eller finsk).\n"
"Rapporter oversættelsesfejl til <dansk@dansk-gruppen.dk>.\n"
#: src/xz/message.c:1250
#, c-format
msgid "%s home page: <%s>\n"
msgstr "%s hjemmeside: <%s>\n"
#: src/xz/message.c:1254
msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE."
msgstr "DETTE ER EN UDVIKLINGSVERSION - BRUG IKKE I PRODUKTION."
#: src/xz/options.c:86
#, c-format
msgid "%s: Options must be `name=value' pairs separated with commas"
msgstr "%s: Tilvalg skal være »navne=værdi«-par adskilt med kommaer"
#: src/xz/options.c:93
#, c-format
msgid "%s: Invalid option name"
msgstr "%s: Ugyldigt tilvalgsnavn"
#: src/xz/options.c:113
#, c-format
msgid "%s: Invalid option value"
msgstr "%s: Ugyldigt tilvalgsværdi"
#: src/xz/options.c:247
#, c-format
msgid "Unsupported LZMA1/LZMA2 preset: %s"
msgstr "LZMA1/LZMA2-forhåndskonfiguration er ikke understøttet: %s"
#: src/xz/options.c:355
msgid "The sum of lc and lp must not exceed 4"
msgstr "Summen af lc og lp må ikke være højere end 4"
#: src/xz/options.c:359
#, c-format
msgid "The selected match finder requires at least nice=%<PRIu32>"
msgstr "Den valgte matchfinder kræver mindst nice=%<PRIu32>"
#: src/xz/suffix.c:133 src/xz/suffix.c:258
#, c-format
msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
msgstr "%s: med --format=raw, --suffix=.SUF er krævet med mindre der skrives til standardud"
#: src/xz/suffix.c:164
#, c-format
msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s: Filnavn har ukendt endelse, udelader"
#: src/xz/suffix.c:185
#, c-format
msgid "%s: File already has `%s' suffix, skipping"
msgstr "%s: Filen har allrede endelsen »%s«, udelader."
#: src/xz/suffix.c:393
#, c-format
msgid "%s: Invalid filename suffix"
msgstr "%s: Ugyldig filnavnendelse"
#: src/xz/util.c:71
#, c-format
msgid "%s: Value is not a non-negative decimal integer"
msgstr "%s: Værdi er ikke et positivt decimalheltal"
#: src/xz/util.c:113
#, c-format
msgid "%s: Invalid multiplier suffix"
msgstr "%s: Ugyldig multiplikatorendelse"
#: src/xz/util.c:115
msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
msgstr "Gyldige endelser er »KiB« (2^10), »MiB« (2^20) og »GiB« (2^30)."
#: src/xz/util.c:132
#, c-format
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
msgstr "Værdien for tilvalget »%s« skal være i intervallet [%<PRIu64>, %<PRIu64>]"
#: src/xz/util.c:257
msgid "Empty filename, skipping"
msgstr "Tomt filnavn, udelader"
#: src/xz/util.c:271
msgid "Compressed data cannot be read from a terminal"
msgstr "Komprimerede data kan ikke læses fra en terminal"
#: src/xz/util.c:284
msgid "Compressed data cannot be written to a terminal"
msgstr "Komprimerede data kan ikke skrives til en terminal"
#: src/common/tuklib_exit.c:39
msgid "Writing to standard output failed"
msgstr "Skrivning til standardud mislykkedes"
#: src/common/tuklib_exit.c:42
msgid "Unknown error"
msgstr "Ukendt fejl"

1199
po/de.po

File diff suppressed because it is too large Load Diff

1148
po/eo.po

File diff suppressed because it is too large Load Diff

1194
po/es.po

File diff suppressed because it is too large Load Diff

1060
po/fi.po

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More