Compare commits
377 Commits
Author | SHA1 | Date |
---|---|---|
Jia Tan | 774145adfd | |
Jia Tan | dbb481270a | |
Jia Tan | 46b19ec4ae | |
Lasse Collin | 809a2fd698 | |
Jia Tan | fbecaa2eb4 | |
Jia Tan | b02e74eb73 | |
Jia Tan | 8efb6ea63b | |
Lasse Collin | 3bd906f1f3 | |
Jia Tan | 0ab5527c46 | |
Jia Tan | 275e36013d | |
Lasse Collin | a2e129a81f | |
Lasse Collin | 260683a6e2 | |
Lasse Collin | edcde3e387 | |
Lasse Collin | dcd6882cb9 | |
Jia Tan | 3e206e5c43 | |
Jia Tan | 05b0a071b6 | |
Lasse Collin | 84b8cd3ffc | |
Lasse Collin | 090ea9ddd3 | |
Lasse Collin | 01f1da25e5 | |
Lasse Collin | 2333bb5454 | |
Lasse Collin | 09363bea46 | |
Lasse Collin | d9445b5b2d | |
Lasse Collin | 3cc8ece2dc | |
Jia Tan | 050c6dbf96 | |
Jia Tan | 8daaac8e10 | |
Jia Tan | 6c9a2c2e46 | |
Jia Tan | ccbb991efa | |
Lasse Collin | 6df383be4a | |
Lasse Collin | 2ca95b7cfe | |
Lasse Collin | f900dd937f | |
Jia Tan | 3e2b345cfd | |
Lasse Collin | f2192d13b5 | |
Lasse Collin | 35167d71f8 | |
Lasse Collin | f8cae7cee0 | |
Lasse Collin | 7c337404bf | |
Lasse Collin | 4dbdbd02d2 | |
Jia Tan | 2155fef528 | |
Jia Cheong Tan | 7067c1ca65 | |
Jia Tan | f62e5aae51 | |
Lasse Collin | f7c2cc5561 | |
Lasse Collin | e4e5d5bbb1 | |
Lasse Collin | e207267c4b | |
Lasse Collin | 90f8e0828b | |
Lasse Collin | 59a17888e9 | |
Lasse Collin | 4af80d4f51 | |
Lasse Collin | 7623b22d1d | |
Lasse Collin | ef315163ef | |
Lasse Collin | 7e86a7632c | |
Lasse Collin | d8a898eb99 | |
Lasse Collin | efd4430e21 | |
Lasse Collin | 2dc1bc97a5 | |
Lasse Collin | fb13a234d9 | |
Lasse Collin | 841448e36d | |
Lasse Collin | b61da00c7f | |
Lasse Collin | 6c29793b3c | |
Lasse Collin | 872623def5 | |
Jia Tan | b0f8d9293c | |
Lasse Collin | 6997e0b5e2 | |
Lasse Collin | f94a3e3460 | |
Lasse Collin | 8309385b44 | |
Lasse Collin | 5fecba6022 | |
Lasse Collin | 1946b2b141 | |
Lasse Collin | 5476089d9c | |
Lasse Collin | f9994f395d | |
Lasse Collin | cdf14b2899 | |
Lasse Collin | 454f567e58 | |
Lasse Collin | 2f01169f5a | |
Lasse Collin | fc1358679e | |
Lasse Collin | a08be1c420 | |
Lasse Collin | 3ee411cd1c | |
Lasse Collin | aa7fa9d960 | |
Lasse Collin | ff49ff84a4 | |
Lasse Collin | 3489565b75 | |
Lasse Collin | e493771080 | |
Jia Tan | d4674dfbb7 | |
Lasse Collin | 4ed56d32a9 | |
Lasse Collin | f930638797 | |
Lasse Collin | 6930f14733 | |
Lasse Collin | 1c8cbb5be3 | |
Lasse Collin | fa9efb729b | |
Lasse Collin | b10ba4bf39 | |
Lasse Collin | 01744b280c | |
Lasse Collin | a3e4606134 | |
Lasse Collin | 0b5e8c7e07 | |
Lasse Collin | 23b7416d5b | |
Lasse Collin | 5daa40454b | |
Lasse Collin | 0af861050f | |
Lasse Collin | f0c6a66701 | |
Lasse Collin | 6bf8b1f870 | |
Lasse Collin | 9f8e9d3c81 | |
Lasse Collin | d24a57b7fc | |
Lasse Collin | d2003362dd | |
Lasse Collin | 369afb5199 | |
Jia Tan | 166431e995 | |
Jia Tan | 5e53a6c28b | |
Jia Tan | 4ed5fd54c6 | |
Lasse Collin | c4476f6952 | |
Lasse Collin | 976f897bbb | |
Lasse Collin | 2caa9580e5 | |
Lasse Collin | 51882fec5b | |
Lasse Collin | 974186f7cd | |
Lasse Collin | f94da15120 | |
Lasse Collin | ea57b9aa2c | |
Jia Tan | 72e1645a43 | |
Lasse Collin | 20d82bc907 | |
Lasse Collin | 31d80c6b26 | |
Jia Tan | e7a7ac744e | |
Lasse Collin | a273a0cb77 | |
Lasse Collin | 5875a45be0 | |
Lasse Collin | 3523b6ebb5 | |
Lasse Collin | 5af9e8759f | |
Lasse Collin | f05a69685e | |
Lasse Collin | ad5ef6d3c3 | |
Lasse Collin | 8dfed05bda | |
Lasse Collin | 09b4af4e04 | |
Lasse Collin | 692de534fa | |
Lasse Collin | 275de376a6 | |
Jia Tan | 76a5a752b8 | |
Jia Tan | 749b86c2c1 | |
Lasse Collin | 63e3cdef80 | |
Lasse Collin | 9055584be0 | |
Lasse Collin | 57e1ccbb7c | |
Lasse Collin | 6351ea1afb | |
Lasse Collin | 2c1ff2ed6b | |
Lasse Collin | 8b0be38a79 | |
Lasse Collin | 4a61867a87 | |
Lasse Collin | 0e222bf7d7 | |
Lasse Collin | 62c1d2bc2d | |
Lasse Collin | 372a0d12c9 | |
Lasse Collin | b8e3d0c45b | |
Lasse Collin | e96bdf7189 | |
Lasse Collin | 2d54fdf58e | |
Lasse Collin | ff54b557fe | |
Lasse Collin | bb795fe835 | |
Lasse Collin | dbd8b0bf45 | |
Lasse Collin | bb66a98ded | |
Lasse Collin | fa3af4e4c6 | |
Lasse Collin | f12ce0f23a | |
Lasse Collin | 4125667311 | |
Lasse Collin | 7c3ce02df0 | |
Lasse Collin | b8f667fe0c | |
Lasse Collin | 2356d53edd | |
Ed Maste | 748ef08338 | |
Lasse Collin | 068a6e3286 | |
Lasse Collin | 766df4f62c | |
Lasse Collin | 12a6d6ce2a | |
Lasse Collin | 00e6aad836 | |
jiat75 | e20ce2b122 | |
huangqinjin | feb80ace86 | |
Lasse Collin | 725f2e0522 | |
Lasse Collin | 7955669d42 | |
Ville Skyttä | 671673a7a2 | |
Lasse Collin | 45e538257e | |
Lasse Collin | ca21733d24 | |
Alexander Bluhm | 906b990b15 | |
Lasse Collin | ca83df96c4 | |
Lasse Collin | d8b294af03 | |
Lasse Collin | c2fde22bef | |
Lasse Collin | 8d0fd42fbe | |
Lasse Collin | 6e2cab8579 | |
Lasse Collin | 38b311462b | |
Ivan A. Melnikov | 95806a8a52 | |
Lasse Collin | a79bd30a6f | |
Lasse Collin | 64d9814761 | |
Lasse Collin | 9e2f9e2d08 | |
Lasse Collin | 00a4c69bbb | |
Lasse Collin | 1da2269b2e | |
Lasse Collin | 11ceecb5e2 | |
Lasse Collin | d655b8c9cb | |
Lasse Collin | 09c331b03c | |
Lasse Collin | b33a345cba | |
H.J. Lu | c01e29a933 | |
Lasse Collin | 0983682f87 | |
Lasse Collin | 880596e4b8 | |
Lasse Collin | 29050c79f1 | |
Adam Borowski | 94fd724749 | |
Lasse Collin | 13c58ac13e | |
Lasse Collin | 8f7d3345a7 | |
Lasse Collin | ca7bcdb30f | |
Lasse Collin | 3b40a0792e | |
Lasse Collin | d85699c36d | |
Lasse Collin | d996ae6617 | |
Lasse Collin | d16d0d198a | |
Lasse Collin | 3acf1adfc7 | |
Lasse Collin | adba06e649 | |
Lasse Collin | 7be1dcf858 | |
Bjarni Ingi Gislason | 3f94d2a568 | |
Bjarni Ingi Gislason | 725d9791c9 | |
Bjarni Ingi Gislason | 55c2555c5d | |
Lasse Collin | 55e3a8e0e4 | |
Lasse Collin | 4e04279cbe | |
Lasse Collin | 27f55e96b0 | |
Lasse Collin | be31be9e8f | |
Lasse Collin | 30e3ad040f | |
Lasse Collin | f2e2cce49f | |
Lasse Collin | a12fd5bad2 | |
Lasse Collin | dd713288d2 | |
Lasse Collin | 016980f269 | |
Lasse Collin | 4fe9578c3a | |
Lasse Collin | cf1ec5518e | |
Lasse Collin | 968bbfea09 | |
Lasse Collin | 2327a461e1 | |
Lasse Collin | 3be82d2f7d | |
Lasse Collin | ab3e57539c | |
Lasse Collin | 3a6f38309d | |
Lasse Collin | 9cc0901798 | |
Lasse Collin | cc16357424 | |
Lasse Collin | ca261994ed | |
Lasse Collin | 51cd5d051f | |
Lasse Collin | 69d694e5f1 | |
Lasse Collin | 2c3b1bb80a | |
Lasse Collin | 74a5af180a | |
Lasse Collin | ceba0d25e8 | |
Lasse Collin | 29e5bd7161 | |
Lasse Collin | 00a037ee9c | |
Lasse Collin | 4ec2feaefa | |
Lasse Collin | b6ed09729a | |
Lasse Collin | 7c85e8953c | |
Lasse Collin | 7da3ebc67f | |
Lasse Collin | 1acc487943 | |
Lasse Collin | 9acc6abea1 | |
Lasse Collin | c8853b3154 | |
Lasse Collin | 901eb4a8c9 | |
Lasse Collin | ac35c9585f | |
Lasse Collin | fb9cada7cf | |
Lasse Collin | 6117955af0 | |
Lasse Collin | c2cc64d78c | |
Lasse Collin | b6314aa275 | |
Lasse Collin | f772a1572f | |
Lasse Collin | 641042e63f | |
Lasse Collin | dbd55a69e5 | |
Lasse Collin | 9294909861 | |
Lasse Collin | bd09081bbd | |
Lasse Collin | 1e5e08d865 | |
Lasse Collin | 4b1447809f | |
Lasse Collin | 882fcfdcd8 | |
Lasse Collin | 134bb77658 | |
Lasse Collin | 6912472faf | |
Lasse Collin | 68c60735bb | |
Lasse Collin | e1beaa74bc | |
Lasse Collin | 8238192652 | |
Lasse Collin | 93a1f61e89 | |
Lasse Collin | d0daa21792 | |
Lasse Collin | 4433c2dc57 | |
Lasse Collin | acc0ef3ac8 | |
Lasse Collin | 4afe69d30b | |
Lasse Collin | ec26f3ace5 | |
Lasse Collin | 3891570324 | |
Lasse Collin | f6d2424534 | |
Lasse Collin | 15b55d5c63 | |
Lasse Collin | 609c706785 | |
Lasse Collin | 00517d125c | |
Lasse Collin | 52d89d8443 | |
Lasse Collin | 850620468b | |
Lasse Collin | a45badf034 | |
Lasse Collin | c9a8071e66 | |
Lasse Collin | aba140e2df | |
Lasse Collin | 710f5bd769 | |
Lasse Collin | 0e491aa8cd | |
Lasse Collin | bfc245569f | |
Lasse Collin | f18eee9d15 | |
Lasse Collin | 25f7455472 | |
Lasse Collin | 44eb961f2a | |
Lasse Collin | 267afcd995 | |
Lasse Collin | 0e3c4002f8 | |
Lasse Collin | cb708e8fa3 | |
Lasse Collin | c8cace3d6e | |
Lasse Collin | 65a42741e2 | |
Lasse Collin | 5c4fb60e8d | |
Lasse Collin | 37df03ce52 | |
Lasse Collin | 7c65ae0f5f | |
Lasse Collin | a502dd1d00 | |
Lasse Collin | a45d1a5374 | |
Lasse Collin | 4ff87ddf80 | |
Lasse Collin | ed1a9d3398 | |
Lasse Collin | 612c88dfc0 | |
Lasse Collin | 85da31d8b8 | |
Lasse Collin | 6a73a78895 | |
Lasse Collin | ce59b34ec9 | |
Lasse Collin | 94aa3fb568 | |
Lasse Collin | 412791486d | |
Lasse Collin | efbf6e5f09 | |
Lasse Collin | 29afef0348 | |
Lasse Collin | 596ed3de44 | |
Lasse Collin | b4b83555c5 | |
Lasse Collin | 8d4906262b | |
Antoine Cœur | 0d318402f8 | |
Lasse Collin | aeb3be8ac4 | |
Lasse Collin | 0c238dc3fe | |
Lasse Collin | 3ca432d9cc | |
Lasse Collin | fcc419e3c3 | |
Pavel Raiskup | 5a2fc3cd01 | |
Lasse Collin | 7143b04fe4 | |
Lasse Collin | 273c33297b | |
Lasse Collin | 65b4aba6d0 | |
Lasse Collin | 531e78e5a2 | |
Lasse Collin | 905de7e935 | |
Julien Marrec | 0ffd30e172 | |
Julien Marrec | c2ef96685f | |
Julien Marrec | 25fccaf00b | |
Lasse Collin | 1424078d63 | |
Lasse Collin | b5be61cc06 | |
Lasse Collin | c47fa6d067 | |
Lasse Collin | 7b350fe21a | |
Lasse Collin | 5801591162 | |
Ben Boeckel | c4a616f453 | |
Lasse Collin | 0b8947782f | |
Lasse Collin | 48f3b9f73f | |
Lasse Collin | a3ce3e9023 | |
Lasse Collin | 4505ca4839 | |
Lasse Collin | 1ef3cc226e | |
Lasse Collin | e775d2a818 | |
Lasse Collin | 10e02e0fbb | |
Lasse Collin | 06eebd4543 | |
Alexey Tourbin | ea4ea1dffa | |
Lasse Collin | eb2ef4c79b | |
Lasse Collin | 3ea5dbd9b0 | |
Lasse Collin | bae2467593 | |
Lasse Collin | 70f4792119 | |
Lasse Collin | 2a4b2fa75d | |
Lasse Collin | eb25743ade | |
Lasse Collin | ef36c6362f | |
Lasse Collin | 5761603265 | |
Lasse Collin | 3d566cd519 | |
Lasse Collin | 053e624fe3 | |
Lasse Collin | cae412b2b7 | |
Lasse Collin | 9ccbae4100 | |
Lasse Collin | e013a337d3 | |
Lasse Collin | 8e0f1af3dc | |
Lasse Collin | ce2542d220 | |
Lasse Collin | 3ca1d5e632 | |
Lasse Collin | 5f3a742b64 | |
Lasse Collin | d74377e62b | |
Lasse Collin | f580732216 | |
Lasse Collin | 88d7a7fd15 | |
Lasse Collin | 51baf68437 | |
Lasse Collin | 1ddc479851 | |
Lasse Collin | be647ff5ed | |
Lasse Collin | fb6d50c153 | |
Lasse Collin | 74f8dad9f9 | |
Lasse Collin | ea7f6ff04c | |
Lasse Collin | d0e018016b | |
Lasse Collin | 5daae12391 | |
Lasse Collin | 491acc406e | |
Lasse Collin | 8173ff8790 | |
Lasse Collin | 013de2b5ab | |
Lasse Collin | a322f70ad9 | |
Lasse Collin | 8ea49606cf | |
Lasse Collin | 42131a25e5 | |
Lasse Collin | e9184e87cc | |
Lasse Collin | 2296778f3c | |
Lasse Collin | 97a3109281 | |
Lasse Collin | dc6b78d7f0 | |
Lasse Collin | 46d76c9cd3 | |
Lasse Collin | 16d68f874d | |
Lasse Collin | d9311647fc | |
Lasse Collin | f59c4183f3 | |
Lasse Collin | 35f189673e | |
Lasse Collin | e10bfdb0fc | |
Lasse Collin | 06f434bd89 | |
Lasse Collin | 9815cdf698 | |
Lasse Collin | cbe0cec847 | |
Andre Noll | 49427ce7ee | |
Hauke Henningsen | 608d6f06c9 | |
Lasse Collin | c8988414e5 | |
Lasse Collin | 85a6dfed53 | |
Lasse Collin | 77f270be84 | |
Lasse Collin | 8c975446c5 | |
Lasse Collin | 119a004349 | |
Lasse Collin | d4e7c557fc | |
Lasse Collin | 98001740ca | |
Lasse Collin | 28195e4c87 | |
Lasse Collin | 960440f323 | |
Lasse Collin | 68cd35acaf | |
Lasse Collin | ff96ed6d25 | |
Lasse Collin | 00d37b64a6 | |
Lasse Collin | db190a832c |
24
.codespellrc
24
.codespellrc
|
@ -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
|
|
@ -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.
|
|
@ -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
|
|
@ -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
|
|
@ -6,8 +6,6 @@
|
|||
.deps
|
||||
.libs
|
||||
*.a
|
||||
*.gcda
|
||||
*.gcno
|
||||
*.la
|
||||
*.lo
|
||||
*.o
|
||||
|
@ -25,7 +23,6 @@ Makefile.in
|
|||
/libtool
|
||||
/stamp-h1
|
||||
|
||||
build-aux/artifacts
|
||||
build-aux/compile
|
||||
build-aux/config.guess
|
||||
build-aux/config.rpath
|
||||
|
@ -36,10 +33,7 @@ build-aux/ltmain.sh
|
|||
build-aux/missing
|
||||
build-aux/test-driver
|
||||
|
||||
coverage
|
||||
|
||||
/doc/internal
|
||||
/doc/api
|
||||
/doc/html
|
||||
|
||||
/src/liblzma/liblzma.pc
|
||||
/src/lzmainfo/lzmainfo
|
||||
|
@ -52,8 +46,6 @@ coverage
|
|||
/src/scripts/xzless
|
||||
/src/scripts/xzmore
|
||||
|
||||
/tests/*.log
|
||||
/tests/*.trs
|
||||
/tests/compress_generated_abc
|
||||
/tests/compress_generated_random
|
||||
/tests/compress_generated_text
|
||||
|
@ -62,15 +54,8 @@ coverage
|
|||
/tests/test_block_header
|
||||
/tests/test_check
|
||||
/tests/test_filter_flags
|
||||
/tests/test_filter_str
|
||||
/tests/test_hardware
|
||||
/tests/test_index
|
||||
/tests/test_index_hash
|
||||
/tests/test_lzip_decoder
|
||||
/tests/test_microlzma
|
||||
/tests/test_memlimit
|
||||
/tests/test_stream_flags
|
||||
/tests/test_vli
|
||||
/tests/xzgrep_test_1.xz
|
||||
/tests/xzgrep_test_2.xz
|
||||
/tests/xzgrep_test_output
|
||||
|
@ -108,7 +93,3 @@ coverage
|
|||
/xzcat
|
||||
/xzcat.1
|
||||
/xzdec
|
||||
|
||||
/windows/*/.vs
|
||||
/windows/*/liblzma.vcxproj.user
|
||||
/.vscode/
|
||||
|
|
46
AUTHORS
46
AUTHORS
|
@ -9,45 +9,23 @@ Authors of XZ Utils
|
|||
specifically the LZMA SDK <https://7-zip.org/sdk.html>. Without
|
||||
this code, XZ Utils wouldn't exist.
|
||||
|
||||
The SHA-256 implementation in liblzma is based on code written by
|
||||
Wei Dai in Crypto++ Library <https://www.cryptopp.com/>.
|
||||
The SHA-256 implementation in liblzma is based on the code found from
|
||||
7-Zip <https://7-zip.org/>, which has a modified version of the SHA-256
|
||||
code found from Crypto++ <https://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
|
||||
versions were written by Jean-loup Gailly, Charles Levert, and
|
||||
Paul Eggert. Andrew Dudman helped adapting the scripts and their
|
||||
man pages for XZ Utils.
|
||||
|
||||
The initial version of the threaded .xz decompressor was written
|
||||
by Sebastian Andrzej Siewior.
|
||||
|
||||
The initial version of the .lz (lzip) decoder was written
|
||||
by Michał Górny.
|
||||
|
||||
Architecture-specific CRC optimizations were contributed by
|
||||
Ilya Kurdyukov, Hans Jansen, and Chenxi Mao.
|
||||
Some scripts have been adapted from gzip. The original versions
|
||||
were written by Jean-loup Gailly, Charles Levert, and Paul Eggert.
|
||||
Andrew Dudman helped adapting the scripts and their man pages for
|
||||
XZ Utils.
|
||||
|
||||
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 GNU Autotools-based build system contains files from many authors,
|
||||
which I'm not trying to list here.
|
||||
|
||||
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.
|
||||
Several people have contributed fixes or reported bugs. Most of them
|
||||
are mentioned in the file THANKS.
|
||||
|
||||
|
|
1950
CMakeLists.txt
1950
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
105
COPYING
105
COPYING
|
@ -6,95 +6,60 @@ XZ Utils Licensing
|
|||
is a rough summary of which licenses apply to which parts of this
|
||||
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
|
||||
under 0BSD except that, on systems that don't have a usable
|
||||
getopt_long, GNU getopt_long is compiled and linked in from the
|
||||
'lib' directory. The getopt_long code is under GNU LGPLv2.1+.
|
||||
- xz, xzdec, and lzmadec command line tools are in the public
|
||||
domain unless GNU getopt_long had to be compiled and linked
|
||||
in from the lib directory. The getopt_long code is under
|
||||
GNU LGPLv2.1+.
|
||||
|
||||
- The scripts to grep, diff, and view compressed files have been
|
||||
adapted from GNU gzip. These scripts (xzgrep, xzdiff, xzless,
|
||||
and xzmore) are under GNU GPLv2+. The man pages of the scripts
|
||||
are under 0BSD; they aren't based on the man pages of GNU gzip.
|
||||
adapted from gzip. These scripts and their documentation are
|
||||
under GNU GPLv2+.
|
||||
|
||||
- Most of the XZ Utils specific documentation that is in
|
||||
plain text files (like README, INSTALL, PACKAGERS, NEWS,
|
||||
and ChangeLog) are under 0BSD unless stated otherwise in
|
||||
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.
|
||||
- All the documentation in the doc directory and most of the
|
||||
XZ Utils specific documentation files in other directories
|
||||
are in the public domain.
|
||||
|
||||
- Doxygen-generated HTML version of the liblzma API documentation:
|
||||
While Doxygen is under the GNU GPLv2, the license information
|
||||
in Doxygen includes the following exception:
|
||||
- Translated messages are in the public domain.
|
||||
|
||||
Documents produced by doxygen are derivative works
|
||||
derived from the input used in their production;
|
||||
they are not affected by this license.
|
||||
- The build system contains public domain files, and files that
|
||||
are under GNU GPLv2+ or GNU GPLv3+. None of these files end up
|
||||
in the binaries being built.
|
||||
|
||||
Note: The JavaScript files (under the MIT license) have
|
||||
been removed from the Doxygen output.
|
||||
- Test files and test code in the tests directory, and debugging
|
||||
utilities in the debug directory are in the public domain.
|
||||
|
||||
- The XZ logo (xz-logo.png) included in the Doxygen-generated
|
||||
documentation is under the Creative Commons BY-SA 4.0 license.
|
||||
- The extra directory may contain public domain files, and files
|
||||
that are under various free software licenses.
|
||||
|
||||
- Translated messages and man pages are under 0BSD except that
|
||||
some old translations are in the public domain.
|
||||
You can do whatever you want with the files that have been put into
|
||||
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
|
||||
debugging utilities in the 'debug' directory are under
|
||||
the BSD Zero Clause License (0BSD).
|
||||
As usual, this software is provided "as is", without any warranty.
|
||||
|
||||
- The GNU Autotools based build system contains files that are
|
||||
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
|
||||
If you copy significant amounts of public domain code from XZ Utils
|
||||
into your project, acknowledging this somewhere in your software is
|
||||
polite (especially if it is proprietary, non-free software), but
|
||||
it is not legally required by the license terms. Here is an example
|
||||
of a good notice to put into "about box" or into documentation:
|
||||
naturally it is not legally required. Here is an example of a good
|
||||
notice to put into "about box" or into documentation:
|
||||
|
||||
This software includes code from XZ Utils
|
||||
<https://xz.tukaani.org/xz-utils/>.
|
||||
This software includes code from XZ Utils <https://tukaani.org/xz/>.
|
||||
|
||||
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.GPLv2: GNU General Public License version 2
|
||||
- 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
|
||||
significant amount of code put into the public domain and
|
||||
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.
|
||||
If you have questions, don't hesitate to ask the author(s) for more
|
||||
information.
|
||||
|
||||
|
|
11
COPYING.0BSD
11
COPYING.0BSD
|
@ -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.
|
|
@ -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.
|
|
@ -1,6 +1,6 @@
|
|||
See the commit log in the git repository:
|
||||
|
||||
git clone https://github.com/tukaani-project/xz
|
||||
git clone https://git.tukaani.org/xz.git
|
||||
|
||||
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
|
||||
|
|
File diff suppressed because it is too large
Load Diff
349
INSTALL
349
INSTALL
|
@ -22,16 +22,13 @@ XZ Utils Installation
|
|||
3. xzgrep and other scripts
|
||||
3.1. Dependencies
|
||||
3.2. PATH
|
||||
4. Tests
|
||||
4.1 Testing in parallel
|
||||
4.2 Cross compiling
|
||||
5. Troubleshooting
|
||||
5.1. "No C99 compiler was found."
|
||||
5.2. "No POSIX conforming shell (sh) was found."
|
||||
5.3. configure works but build fails at crc32_x86.S
|
||||
5.4. Lots of warnings about symbol visibility
|
||||
5.5. "make check" fails
|
||||
5.6. liblzma.so (or similar) not found when running xz
|
||||
4. Troubleshooting
|
||||
4.1. "No C99 compiler was found."
|
||||
4.2. "No POSIX conforming shell (sh) was found."
|
||||
4.3. configure works but build fails at crc32_x86.S
|
||||
4.4. Lots of warnings about symbol visibility
|
||||
4.5. "make check" fails
|
||||
4.6. liblzma.so (or similar) not found when running xz
|
||||
|
||||
|
||||
0. Preface
|
||||
|
@ -103,7 +100,7 @@ XZ Utils Installation
|
|||
XZ Utils doesn't have code to detect the amount of physical RAM and
|
||||
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).
|
||||
|
||||
|
||||
|
@ -130,50 +127,58 @@ XZ Utils Installation
|
|||
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
|
||||
releases needed extra steps. See sections 4.5 and 3.2 for more
|
||||
information.
|
||||
|
||||
|
||||
1.2.6. Tru64
|
||||
|
||||
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).
|
||||
|
||||
|
||||
1.2.7. Windows
|
||||
|
||||
The "windows" directory contains instructions for a few types
|
||||
of builds:
|
||||
If it is enough to build liblzma (no command line tools):
|
||||
|
||||
- INSTALL-MinGW-w64_with_CMake.txt
|
||||
Simple instructions how to build XZ Utils natively on
|
||||
Windows using only CMake and a prebuilt toolchain
|
||||
(GCC + MinGW-w64 or Clang/LLVM + MinGW-w64).
|
||||
- There is experimental CMake support. As it is, it should be
|
||||
good enough to build static liblzma with Visual Studio.
|
||||
Building liblzma.dll might work too (if it doesn't, it should
|
||||
be fixed). The CMake support may work with MinGW or MinGW-w64.
|
||||
Read the comment in the beginning of CMakeLists.txt before
|
||||
running CMake!
|
||||
|
||||
- INSTALL-MinGW-w64_with_Autotools.txt
|
||||
Native build under MSYS2 or cross-compilation from
|
||||
GNU/Linux using a bash script that creates a .zip
|
||||
and .7z archives of the binaries and documentation.
|
||||
The related file README-Windows.txt is for the
|
||||
resulting binary package.
|
||||
- There are Visual Studio project files under the "windows"
|
||||
directory. See windows/INSTALL-MSVC.txt. In the future the
|
||||
project files will be removed when CMake support is good
|
||||
enough. Thus, please test the CMake version and help fix
|
||||
possible issues.
|
||||
|
||||
- INSTALL-MSVC.txt
|
||||
Building with MSVC / Visual Studio and CMake.
|
||||
To build also the command line tools:
|
||||
|
||||
- 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).
|
||||
- MinGW-w64 + MSYS (32-bit and 64-bit x86): This is used
|
||||
for building the official binary packages for Windows.
|
||||
There is windows/build.bash to ease packaging XZ Utils with
|
||||
MinGW(-w64) + MSYS into a redistributable .zip or .7z file.
|
||||
See windows/INSTALL-MinGW.txt for more information.
|
||||
|
||||
Other choices:
|
||||
- MinGW + MSYS (32-bit x86): I haven't recently tested this.
|
||||
|
||||
- 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.
|
||||
- Cygwin 1.7.35 and later: NOTE that using XZ Utils >= 5.2.0
|
||||
under Cygwin older than 1.7.35 can lead to DATA LOSS! If
|
||||
you must use an old Cygwin version, stick to XZ Utils 5.0.x
|
||||
which is safe under older Cygwin versions. You can check
|
||||
the Cygwin version with the command "cygcheck -V".
|
||||
|
||||
- MSYS2: https://www.msys2.org/
|
||||
It may be possible to build liblzma with other toolchains too, but
|
||||
that will probably require writing a separate makefile. Building
|
||||
the command line tools with non-GNU toolchains will be harder than
|
||||
building only liblzma.
|
||||
|
||||
Even if liblzma is built with MinGW(-w64), the resulting DLL can
|
||||
be used by other compilers and linkers, including MSVC. See
|
||||
windows/README-Windows.txt for details.
|
||||
|
||||
|
||||
1.2.8. DOS
|
||||
|
@ -311,18 +316,6 @@ XZ Utils Installation
|
|||
| 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-xzdec
|
||||
--disable-lzmadec
|
||||
|
@ -353,102 +346,28 @@ XZ Utils Installation
|
|||
with --docdir=DIR.
|
||||
|
||||
--disable-assembler
|
||||
This disables CRC32 and CRC64 assembly code on
|
||||
32-bit x86. This option currently does nothing
|
||||
on other architectures (not even on x86-64).
|
||||
liblzma includes some assembler optimizations. Currently
|
||||
there is only assembler code for CRC32 and CRC64 for
|
||||
32-bit x86.
|
||||
|
||||
The 32-bit x86 assembly is position-independent code
|
||||
which is suitable for use in shared libraries and
|
||||
position-independent executables. It uses only i386
|
||||
instructions but the code is optimized for i686 class
|
||||
CPUs. If you are compiling liblzma exclusively for
|
||||
All the assembler code in liblzma is position-independent
|
||||
code, which is suitable for use in shared libraries and
|
||||
position-independent executables. So far only i386
|
||||
instructions are used, but the code is optimized for i686
|
||||
class CPUs. If you are compiling liblzma exclusively for
|
||||
pre-i686 systems, you may want to disable the assembler
|
||||
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
|
||||
Allow liblzma to use unaligned memory access for 16-bit,
|
||||
32-bit, and 64-bit loads and stores. This should be
|
||||
enabled only when the hardware supports this, that is,
|
||||
when unaligned access is fast. Some operating system
|
||||
kernels emulate unaligned access, which is extremely
|
||||
slow. This option shouldn't be used on systems that
|
||||
rely on such emulation.
|
||||
Allow liblzma to use unaligned memory access for 16-bit
|
||||
and 32-bit loads and stores. This should be enabled only
|
||||
when the hardware supports this, i.e. when unaligned
|
||||
access is fast. Some operating system kernels emulate
|
||||
unaligned access, which is extremely slow. This option
|
||||
shouldn't be used on systems that rely on such emulation.
|
||||
|
||||
Unaligned access is enabled by default on these:
|
||||
- 32-bit x86
|
||||
- 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).
|
||||
Unaligned access is enabled by default on x86, x86-64,
|
||||
and big endian PowerPC.
|
||||
|
||||
--enable-small
|
||||
Reduce the size of liblzma by selecting smaller but
|
||||
|
@ -497,109 +416,49 @@ XZ Utils Installation
|
|||
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.
|
||||
Windows builds. 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').
|
||||
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
|
||||
NOTE: If combined with --enable-small, 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.
|
||||
There is limited sandboxing support in the xz tool. If
|
||||
built with sandbox support, it's used automatically when
|
||||
(de)compressing exactly one file to standard output and
|
||||
the options --files or --files0 weren'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'.
|
||||
|
||||
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
|
||||
Use Capsicum (FreeBSD >= 10) 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-symbol-versions
|
||||
Use symbol versioning for liblzma. This is enabled by
|
||||
default on GNU/Linux, other GNU-based systems, and
|
||||
FreeBSD.
|
||||
|
||||
--enable-debug
|
||||
This enables the assert() macro and possibly some other
|
||||
|
@ -658,7 +517,7 @@ XZ Utils Installation
|
|||
liblzma, pass --enable-small to configure.
|
||||
|
||||
- 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
|
||||
liblzma. You can avoid dependency on libpthread by passing
|
||||
|
@ -719,54 +578,10 @@ XZ Utils Installation
|
|||
src/scripts/xz*.in
|
||||
|
||||
|
||||
4. Tests
|
||||
--------
|
||||
|
||||
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
|
||||
4. 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
|
||||
cannot find a C99 compiler and you think you have such a compiler
|
||||
|
@ -781,7 +596,7 @@ XZ Utils Installation
|
|||
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
|
||||
to POSIX. The configure script tries to find such a shell. If
|
||||
|
@ -791,7 +606,7 @@ XZ Utils Installation
|
|||
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.
|
||||
|
||||
|
@ -808,7 +623,7 @@ XZ Utils Installation
|
|||
(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
|
||||
still accept the visibility options and attributes, which will make
|
||||
|
@ -820,7 +635,7 @@ XZ Utils Installation
|
|||
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
|
||||
is in the scripts in src/scripts. Comparing the contents of
|
||||
|
@ -846,7 +661,7 @@ XZ Utils Installation
|
|||
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
|
||||
about liblzma.so (or a similarly named file) being missing, try
|
||||
|
|
49
Makefile.am
49
Makefile.am
|
@ -1,5 +1,9 @@
|
|||
## SPDX-License-Identifier: 0BSD
|
||||
##
|
||||
## 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.
|
||||
GZIP_ENV = -9n
|
||||
|
@ -17,11 +21,11 @@ if COND_DOC
|
|||
dist_doc_DATA = \
|
||||
AUTHORS \
|
||||
COPYING \
|
||||
COPYING.0BSD \
|
||||
COPYING.GPLv2 \
|
||||
NEWS \
|
||||
README \
|
||||
THANKS \
|
||||
TODO \
|
||||
doc/faq.txt \
|
||||
doc/history.txt \
|
||||
doc/xz-file-format.txt \
|
||||
|
@ -34,42 +38,31 @@ dist_examples_DATA = \
|
|||
doc/examples/02_decompress.c \
|
||||
doc/examples/03_compress_custom.c \
|
||||
doc/examples/04_compress_easy_mt.c \
|
||||
doc/examples/11_file_info.c \
|
||||
doc/examples/Makefile
|
||||
|
||||
# Install the Doxygen generated documentation if they were built.
|
||||
install-data-local:
|
||||
if test -d "$(srcdir)/doc/api" ; then \
|
||||
$(MKDIR_P) "$(DESTDIR)$(docdir)/api" && \
|
||||
$(INSTALL_DATA) "$(srcdir)"/doc/api/* \
|
||||
"$(DESTDIR)$(docdir)/api"; \
|
||||
fi
|
||||
|
||||
# Remove the Doxygen generated documentation when uninstalling.
|
||||
uninstall-local:
|
||||
rm -rf "$(DESTDIR)$(docdir)/api"
|
||||
examplesolddir = $(docdir)/examples_old
|
||||
dist_examplesold_DATA = \
|
||||
doc/examples_old/xz_pipe_comp.c \
|
||||
doc/examples_old/xz_pipe_decomp.c
|
||||
endif
|
||||
|
||||
EXTRA_DIST = \
|
||||
cmake \
|
||||
dos \
|
||||
doxygen \
|
||||
extra \
|
||||
po4a \
|
||||
extra \
|
||||
dos \
|
||||
windows \
|
||||
macosx \
|
||||
cmake \
|
||||
CMakeLists.txt \
|
||||
COPYING.CC-BY-SA-4.0 \
|
||||
autogen.sh \
|
||||
Doxyfile.in \
|
||||
COPYING.GPLv2 \
|
||||
COPYING.GPLv3 \
|
||||
COPYING.LGPLv2.1 \
|
||||
INSTALL.generic \
|
||||
PACKAGERS \
|
||||
TODO \
|
||||
autogen.sh \
|
||||
build-aux/manconv.sh \
|
||||
build-aux/version.sh \
|
||||
doc/xz-logo.png \
|
||||
po/xz.pot-header
|
||||
build-aux/version.sh
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
|
@ -88,7 +81,7 @@ manfiles = \
|
|||
dist-hook:
|
||||
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
||||
( cd "$(srcdir)" && git log --date=iso --stat \
|
||||
b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \
|
||||
b667a3ef6338a2c1db7b7706b1f6c99ea392221c^..HEAD ) \
|
||||
> "$(distdir)/ChangeLog"; \
|
||||
fi
|
||||
if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \
|
||||
|
@ -107,11 +100,6 @@ dist-hook:
|
|||
> "$$dest/txt/$$BASE.txt"; \
|
||||
done; \
|
||||
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 also ensures that the man page translations are up to date (dist-hook
|
||||
|
@ -119,7 +107,6 @@ dist-hook:
|
|||
mydist:
|
||||
sh "$(srcdir)/src/liblzma/validate_map.sh"
|
||||
cd "$(srcdir)/po4a" && sh update-po
|
||||
cd "$(srcdir)/doxygen" && sh update-doxygen
|
||||
VERSION=$(VERSION); \
|
||||
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
||||
SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \
|
||||
|
|
35
PACKAGERS
35
PACKAGERS
|
@ -44,8 +44,6 @@ Information to packagers of XZ Utils
|
|||
lzmadec binary for compatibility with LZMA Utils
|
||||
liblzma liblzma.so.*
|
||||
liblzma-devel liblzma.so, liblzma.a, API headers
|
||||
liblzma-doc Doxygen-generated liblzma API docs (HTML),
|
||||
example programs
|
||||
|
||||
|
||||
2. Package description
|
||||
|
@ -111,28 +109,20 @@ Information to packagers of XZ Utils
|
|||
This package includes the API headers, static library, and
|
||||
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
|
||||
----------
|
||||
|
||||
If the package manager supports a license field, you probably should
|
||||
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
|
||||
important files ending up into the binary package are under GPLv2+.
|
||||
So it is simplest to just say GPLv2+ if you cannot specify
|
||||
"BSD0 and GPLv2+".
|
||||
XZ Utils are in the public domain, but some less important files
|
||||
ending up into the binary package are under GPLv2+. So it is simplest
|
||||
to just say GPLv2+ if you cannot specify "public domain and GPLv2+".
|
||||
|
||||
If you split XZ Utils into multiple packages as described earlier
|
||||
in this file, liblzma and liblzma-dev packages will contain only
|
||||
0BSD-licensed code from XZ Utils (compiler or linker may add some
|
||||
third-party code which may have other licenses).
|
||||
public domain code (from XZ Utils at least; compiler or linker may
|
||||
add some third-party code, which may be copyrighted).
|
||||
|
||||
|
||||
4. configure options
|
||||
|
@ -148,8 +138,6 @@ Information to packagers of XZ Utils
|
|||
--enable-checks
|
||||
--enable-small (*)
|
||||
--disable-threads (*)
|
||||
--disable-microlzma (*)
|
||||
--disable-lzip-decoder (*)
|
||||
|
||||
(*) These are OK when building xzdec and lzmadec as described
|
||||
in INSTALL.
|
||||
|
@ -170,13 +158,12 @@ Information to packagers of XZ Utils
|
|||
can be replaced with a symlink if your distro ships with shared
|
||||
copies of the common license texts.
|
||||
|
||||
The Doxygen-generated documentation (HTML) for the liblzma API
|
||||
headers is included in the source release and will be installed by
|
||||
"make install" to $docdir/api. All JavaScript is removed to
|
||||
simplify license compliance and to reduce the install size. If the
|
||||
liblzma API documentation is not desired, either run configure with
|
||||
--disable-doc or remove the doc/api directory before running
|
||||
"make install".
|
||||
liblzma API is currently only documented using Doxygen tags in the
|
||||
API headers. It hasn't been tested much how good results Doxygen
|
||||
is able to make from the tags (e.g. Doxyfile might need tweaking,
|
||||
the tagging may need to be improved etc.), so it might be simpler
|
||||
to just let people read docs directly from the .h files for now,
|
||||
and also save quite a bit in package size at the same time.
|
||||
|
||||
|
||||
6. Extra files
|
||||
|
|
113
README
113
README
|
@ -67,27 +67,24 @@ XZ Utils
|
|||
|
||||
1.1. Overall documentation
|
||||
|
||||
README This file
|
||||
README This file
|
||||
|
||||
INSTALL.generic Generic install instructions for those not
|
||||
familiar with packages using GNU Autotools
|
||||
INSTALL Installation instructions specific to XZ Utils
|
||||
PACKAGERS Information to packagers of XZ Utils
|
||||
INSTALL.generic Generic install instructions for those not familiar
|
||||
with packages using GNU Autotools
|
||||
INSTALL Installation instructions specific to XZ Utils
|
||||
PACKAGERS Information to packagers of XZ Utils
|
||||
|
||||
COPYING XZ Utils copyright and license information
|
||||
COPYING.0BSD BSD Zero Clause License
|
||||
COPYING.GPLv2 GNU General Public License version 2
|
||||
COPYING.GPLv3 GNU General Public License version 3
|
||||
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
|
||||
COPYING XZ Utils copyright and license information
|
||||
COPYING.GPLv2 GNU General Public License version 2
|
||||
COPYING.GPLv3 GNU General Public License version 3
|
||||
COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
|
||||
|
||||
AUTHORS The main authors of XZ Utils
|
||||
THANKS Incomplete list of people who have helped making
|
||||
this software
|
||||
NEWS User-visible changes between XZ Utils releases
|
||||
ChangeLog Detailed list of changes (commit log)
|
||||
TODO Known bugs and some sort of to-do list
|
||||
AUTHORS The main authors of XZ Utils
|
||||
THANKS Incomplete list of people who have helped making
|
||||
this software
|
||||
NEWS User-visible changes between XZ Utils releases
|
||||
ChangeLog Detailed list of changes (commit log)
|
||||
TODO Known bugs and some sort of to-do list
|
||||
|
||||
Note that only some of the above files are included in binary
|
||||
packages.
|
||||
|
@ -205,77 +202,9 @@ XZ Utils
|
|||
|
||||
https://translationproject.org/html/translators.html
|
||||
|
||||
Below are notes and testing instructions specific to xz
|
||||
translations.
|
||||
|
||||
Testing can be done by installing xz into a temporary directory:
|
||||
|
||||
./configure --disable-shared --prefix=/tmp/xz-test
|
||||
# <Edit the .po file in the po directory.>
|
||||
make -C po update-po
|
||||
make install
|
||||
bash debug/translation.bash | less
|
||||
bash debug/translation.bash | less -S # For --list outputs
|
||||
|
||||
Repeat the above as needed (no need to re-run configure though).
|
||||
|
||||
Note especially the following:
|
||||
|
||||
- The output of --help and --long-help must look nice on
|
||||
an 80-column terminal. It's OK to add extra lines if needed.
|
||||
|
||||
- In contrast, don't add extra lines to error messages and such.
|
||||
They are often preceded with e.g. a filename on the same line,
|
||||
so you have no way to predict where to put a \n. Let the terminal
|
||||
do the wrapping even if it looks ugly. Adding new lines will be
|
||||
even uglier in the generic case even if it looks nice in a few
|
||||
limited examples.
|
||||
|
||||
- Be careful with column alignment in tables and table-like output
|
||||
(--list, --list --verbose --verbose, --info-memory, --help, and
|
||||
--long-help):
|
||||
|
||||
* All descriptions of options in --help should start in the
|
||||
same column (but it doesn't need to be the same column as
|
||||
in the English messages; just be consistent if you change it).
|
||||
Check that both --help and --long-help look OK, since they
|
||||
share several strings.
|
||||
|
||||
* --list --verbose and --info-memory print lines that have
|
||||
the format "Description: %s". If you need a longer
|
||||
description, you can put extra space between the colon
|
||||
and %s. Then you may need to add extra space to other
|
||||
strings too so that the result as a whole looks good (all
|
||||
values start at the same column).
|
||||
|
||||
* The columns of the actual tables in --list --verbose --verbose
|
||||
should be aligned properly. Abbreviate if necessary. It might
|
||||
be good to keep at least 2 or 3 spaces between column headings
|
||||
and avoid spaces in the headings so that the columns stand out
|
||||
better, but this is a matter of opinion. Do what you think
|
||||
looks best.
|
||||
|
||||
- Be careful to put a period at the end of a sentence when the
|
||||
original version has it, and don't put it when the original
|
||||
doesn't have it. Similarly, be careful with \n characters
|
||||
at the beginning and end of the strings.
|
||||
|
||||
- Read the TRANSLATORS comments that have been extracted from the
|
||||
source code and included in xz.pot. Some comments suggest
|
||||
testing with a specific command which needs an .xz file. You
|
||||
may use e.g. any tests/files/good-*.xz. However, these test
|
||||
commands are included in translations.bash output, so reading
|
||||
translations.bash output carefully can be enough.
|
||||
|
||||
- If you find language problems in the original English strings,
|
||||
feel free to suggest improvements. Ask if something is unclear.
|
||||
|
||||
- The translated messages should be understandable (sometimes this
|
||||
may be a problem with the original English messages too). Don't
|
||||
make a direct word-by-word translation from English especially if
|
||||
the result doesn't sound good in your language.
|
||||
|
||||
Thanks for your help!
|
||||
Several strings will change in a future version of xz so if you
|
||||
wish to start a new translation, look at the code in the xz git
|
||||
repository instead of a 5.2.x release.
|
||||
|
||||
|
||||
5. Other implementations of the .xz format
|
||||
|
@ -290,11 +219,7 @@ XZ Utils
|
|||
XZ Embedded is a limited implementation written for use in the Linux
|
||||
kernel, but it is also suitable for other embedded use.
|
||||
|
||||
https://xz.tukaani.org/xz-embedded/
|
||||
|
||||
XZ for Java is a complete implementation written in pure Java.
|
||||
|
||||
https://xz.tukaani.org/xz-for-java/
|
||||
https://tukaani.org/xz/embedded.html
|
||||
|
||||
|
||||
6. Contact information
|
||||
|
|
21
THANKS
21
THANKS
|
@ -5,7 +5,6 @@ Thanks
|
|||
Some people have helped more, some less, but nevertheless everyone's help
|
||||
has been important. :-) In alphabetical order:
|
||||
- Mark Adler
|
||||
- Kian-Meng Ang
|
||||
- H. Peter Anvin
|
||||
- Jeff Bastian
|
||||
- Nelson H. F. Beebe
|
||||
|
@ -20,8 +19,6 @@ has been important. :-) In alphabetical order:
|
|||
- Jakub Bogusz
|
||||
- Adam Borowski
|
||||
- Maarten Bosmans
|
||||
- Lukas Braune
|
||||
- Benjamin Buch
|
||||
- Trent W. Buck
|
||||
- Kevin R. Bulgrien
|
||||
- James Buren
|
||||
|
@ -34,7 +31,6 @@ has been important. :-) In alphabetical order:
|
|||
- Vitaly Chikunov
|
||||
- Antoine Cœur
|
||||
- Gabi Davar
|
||||
- İhsan Doğan
|
||||
- Chris Donawa
|
||||
- Andrew Dudman
|
||||
- Markus Duft
|
||||
|
@ -52,11 +48,9 @@ has been important. :-) In alphabetical order:
|
|||
- Bjarni Ingi Gislason
|
||||
- John Paul Adrian Glaubitz
|
||||
- Bill Glessner
|
||||
- Matthew Good
|
||||
- Michał Górny
|
||||
- Jason Gorski
|
||||
- Juan Manuel Guerrero
|
||||
- Gabriela Gutierrez
|
||||
- Diederik de Haas
|
||||
- Joachim Henke
|
||||
- Christian Hesse
|
||||
|
@ -64,27 +58,21 @@ has been important. :-) In alphabetical order:
|
|||
- Peter Ivanov
|
||||
- Nicholas Jackson
|
||||
- Sam James
|
||||
- Hajin Jang
|
||||
- Hans Jansen
|
||||
- Jouk Jansen
|
||||
- Jun I Jin
|
||||
- Kiyoshi Kanazawa
|
||||
- Joona Kannisto
|
||||
- Per Øyvind Karlsen
|
||||
- Iouri Kharon
|
||||
- Thomas Klausner
|
||||
- Richard Koch
|
||||
- Anton Kochkov
|
||||
- Ville Koskinen
|
||||
- Sergey Kosukhin
|
||||
- Marcin Kowalczyk
|
||||
- Jan Kratochvil
|
||||
- Christian Kujau
|
||||
- Stephan Kulow
|
||||
- Ilya Kurdyukov
|
||||
- Peter Lawler
|
||||
- James M Leddy
|
||||
- Kelvin Lee
|
||||
- Vincent Lefevre
|
||||
- Hin-Tak Leung
|
||||
- Andraž 'ruskie' Levstik
|
||||
|
@ -95,7 +83,6 @@ has been important. :-) In alphabetical order:
|
|||
- Lorenzo De Liso
|
||||
- H.J. Lu
|
||||
- Bela Lubkin
|
||||
- Chenxi Mao
|
||||
- Gregory Margo
|
||||
- Julien Marrec
|
||||
- Ed Maste
|
||||
|
@ -113,7 +100,6 @@ has been important. :-) In alphabetical order:
|
|||
- Jonathan Nieder
|
||||
- Andre Noll
|
||||
- Peter O'Gorman
|
||||
- Dimitri Papadopoulos Orfanos
|
||||
- Daniel Packard
|
||||
- Filip Palian
|
||||
- Peter Pallinger
|
||||
|
@ -136,7 +122,6 @@ has been important. :-) In alphabetical order:
|
|||
- Torsten Rupp
|
||||
- Stephen Sachs
|
||||
- Jukka Salmi
|
||||
- Agostino Sarubbo
|
||||
- Alexandre Sauvé
|
||||
- Benno Schulenberg
|
||||
- Andreas Schwab
|
||||
|
@ -148,16 +133,13 @@ has been important. :-) In alphabetical order:
|
|||
- Brad Smith
|
||||
- Bruce Stark
|
||||
- Pippijn van Steenhoven
|
||||
- Martin Storsjö
|
||||
- Jonathan Stott
|
||||
- Dan Stromberg
|
||||
- Jia Tan
|
||||
- Vincent Torri
|
||||
- Alexey Tourbin
|
||||
- Paul Townsend
|
||||
- Mohammed Adnène Trojette
|
||||
- Taiki Tsunekawa
|
||||
- Maksym Vatsyk
|
||||
- Alexey Tourbin
|
||||
- Loganaden Velvindron
|
||||
- Patrick J. Volkerding
|
||||
- Martin Väth
|
||||
|
@ -172,7 +154,6 @@ has been important. :-) In alphabetical order:
|
|||
- Charles Wilson
|
||||
- Lars Wirzenius
|
||||
- Pilorz Wojciech
|
||||
- Chien Wong
|
||||
- Ryan Young
|
||||
- Andreas Zieringer
|
||||
|
||||
|
|
6
TODO
6
TODO
|
@ -24,6 +24,10 @@ Known bugs
|
|||
|
||||
tuklib_exit() doesn't block signals => EINTR is possible.
|
||||
|
||||
SIGTSTP is not handled. If xz is stopped, the estimated remaining
|
||||
time and calculated (de)compression speed won't make sense in the
|
||||
progress indicator (xz --verbose).
|
||||
|
||||
If liblzma has created threads and fork() gets called, liblzma
|
||||
code will break in the child process unless it calls exec() and
|
||||
doesn't touch liblzma.
|
||||
|
@ -55,6 +59,8 @@ Missing features
|
|||
- Implement threaded match finders.
|
||||
- Implement pigz-style threading in LZMA2.
|
||||
|
||||
Multithreaded decompression
|
||||
|
||||
Buffer-to-buffer coding could use less RAM (especially when
|
||||
decompressing LZMA1 or LZMA2).
|
||||
|
||||
|
|
39
autogen.sh
39
autogen.sh
|
@ -1,10 +1,12 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
set -e -x
|
||||
|
@ -17,38 +19,15 @@ ${AUTOCONF:-autoconf}
|
|||
${AUTOHEADER:-autoheader}
|
||||
${AUTOMAKE:-automake} -acf --foreign
|
||||
|
||||
# Generate the translated man pages and the doxygen documentation if the
|
||||
# "po4a" and "doxygen" tools are available.
|
||||
# Generate the translated man pages if the "po4a" tool is 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
|
||||
#
|
||||
# Pass --no-po4a to this script to skip this step. It can be useful when
|
||||
# you know that po4a isn't available and don't want autogen.sh to exit
|
||||
# with non-zero exit status.
|
||||
if test "x$1" != "x--no-po4a"; then
|
||||
cd po4a
|
||||
sh update-po
|
||||
cd ..
|
||||
fi
|
||||
|
||||
if test "$generate_doxygen" != "n"; then
|
||||
cd doxygen
|
||||
sh update-doxygen
|
||||
cd ..
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -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
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
# Wrapper for GNU groff to convert man pages to a few formats
|
||||
|
@ -18,6 +17,9 @@
|
|||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
FORMAT=$1
|
||||
|
@ -36,10 +38,10 @@ s/^\\.PD\$/.PD $PD/"
|
|||
|
||||
case $FORMAT in
|
||||
ascii)
|
||||
groff -t -mandoc -Tascii -P-c | col -bx
|
||||
groff -t -mandoc -Tascii | col -bx
|
||||
;;
|
||||
utf8)
|
||||
groff -t -mandoc -Tutf8 -P-c | col -bx
|
||||
groff -t -mandoc -Tutf8 | col -bx
|
||||
;;
|
||||
ps)
|
||||
sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Get the version string from version.h and print it out without
|
||||
|
@ -10,6 +9,9 @@
|
|||
#
|
||||
# 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/
|
||||
|
|
|
@ -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}")
|
|
@ -1,12 +1,11 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# tuklib_common.cmake - common functions and macros for tuklib_*.cmake files
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
#############################################################################
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
function(tuklib_add_definitions TARGET_OR_ALL DEFINITIONS)
|
||||
# DEFINITIONS may be an empty string/list but it's fine here. There is
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# tuklib_cpucores.cmake - see tuklib_cpucores.m4 for description and comments
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
#############################################################################
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
||||
include(CheckCSourceCompiles)
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# tuklib_integer.cmake - see tuklib_integer.m4 for description and comments
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
#############################################################################
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
||||
include(TestBigEndian)
|
||||
|
@ -60,67 +59,29 @@ function(tuklib_integer TARGET_OR_ALL)
|
|||
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
|
||||
# 16-bit and 32-bit unaligned access is fast on x86(-64),
|
||||
# big endian PowerPC, and usually on 32/64-bit ARM too.
|
||||
# There are others too and ARM could be a false match.
|
||||
#
|
||||
# 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).
|
||||
# Guess the default value for the option.
|
||||
# CMake's ability to give info about the target arch seems bad.
|
||||
# The the same arch can have different name depending on the OS.
|
||||
#
|
||||
# FIXME: The regex is based on guessing, not on factual information!
|
||||
#
|
||||
# NOTE: Compared to the Autoconf test, this lacks the GCC/Clang test
|
||||
# on ARM and always assumes that unaligned is fast on ARM.
|
||||
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)
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES
|
||||
"[Xx3456]86|^[Xx]64|^[Aa][Mm][Dd]64|^[Aa][Rr][Mm]|^aarch|^powerpc|^ppc")
|
||||
if(NOT WORDS_BIGENDIAN OR
|
||||
NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc|^ppc")
|
||||
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."
|
||||
with 16-bit and 32-bit integers."
|
||||
"${FAST_UNALIGNED_GUESS}")
|
||||
tuklib_add_definition_if("${TARGET_OR_ALL}" TUKLIB_FAST_UNALIGNED_ACCESS)
|
||||
|
||||
|
|
|
@ -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()
|
|
@ -1,12 +1,11 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# tuklib_mbstr.cmake - see tuklib_mbstr.m4 for description and comments
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
#############################################################################
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
||||
include(CheckSymbolExists)
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# tuklib_physmem.cmake - see tuklib_physmem.m4 for description and comments
|
||||
#
|
||||
|
@ -9,7 +6,9 @@
|
|||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
#############################################################################
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
||||
include(CheckCSourceCompiles)
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# tuklib_progname.cmake - see tuklib_progname.m4 for description and comments
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
#############################################################################
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
||||
include(CheckSymbolExists)
|
||||
|
@ -14,6 +13,7 @@ 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)
|
||||
HAVE_DECL_PROGRAM_INVOCATION_NAME)
|
||||
tuklib_add_definition_if("${TARGET_OR_ALL}"
|
||||
HAVE_DECL_PROGRAM_INVOCATION_NAME)
|
||||
endfunction()
|
||||
|
|
584
configure.ac
584
configure.ac
|
@ -1,12 +1,13 @@
|
|||
# -*- Autoconf -*-
|
||||
# SPDX-License-Identifier: 0BSD
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
# NOTE: Don't add useless checks. autoscan detects this and that, but don't
|
||||
|
@ -17,7 +18,7 @@
|
|||
AC_PREREQ([2.69])
|
||||
|
||||
AC_INIT([XZ Utils], m4_esyscmd([/bin/sh build-aux/version.sh]),
|
||||
[xz@tukaani.org], [xz], [https://xz.tukaani.org/xz-utils/])
|
||||
[xz@tukaani.org], [xz], [https://tukaani.org/xz/])
|
||||
AC_CONFIG_SRCDIR([src/liblzma/common/common.h])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
@ -78,8 +79,8 @@ fi
|
|||
# Filters #
|
||||
###########
|
||||
|
||||
m4_define([SUPPORTED_FILTERS], [lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,arm64,sparc,riscv])dnl
|
||||
m4_define([SIMPLE_FILTERS], [x86,powerpc,ia64,arm,armthumb,arm64,sparc,riscv])
|
||||
m4_define([SUPPORTED_FILTERS], [lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,sparc])dnl
|
||||
m4_define([SIMPLE_FILTERS], [x86,powerpc,ia64,arm,armthumb,sparc])
|
||||
m4_define([LZ_FILTERS], [lzma1,lzma2])
|
||||
|
||||
m4_foreach([NAME], [SUPPORTED_FILTERS],
|
||||
|
@ -293,49 +294,6 @@ else
|
|||
fi
|
||||
|
||||
|
||||
#############
|
||||
# MicroLZMA #
|
||||
#############
|
||||
|
||||
AC_MSG_CHECKING([if MicroLZMA support should be built])
|
||||
AC_ARG_ENABLE([microlzma], AS_HELP_STRING([--disable-microlzma],
|
||||
[Do not build MicroLZMA encoder and decoder.
|
||||
It is needed by specific applications only,
|
||||
for example, erofs-utils.]),
|
||||
[], [enable_microlzma=yes])
|
||||
case $enable_microlzma in
|
||||
yes | no)
|
||||
AC_MSG_RESULT([$enable_microlzma])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-microlzma accepts only 'yes' or 'no'.])
|
||||
;;
|
||||
esac
|
||||
AM_CONDITIONAL(COND_MICROLZMA, test "x$enable_microlzma" = xyes)
|
||||
|
||||
|
||||
#############################
|
||||
# .lz (lzip) format support #
|
||||
#############################
|
||||
|
||||
AC_MSG_CHECKING([if .lz (lzip) decompression support should be built])
|
||||
AC_ARG_ENABLE([lzip-decoder], AS_HELP_STRING([--disable-lzip-decoder],
|
||||
[Disable decompression support for .lz (lzip) files.]),
|
||||
[], [enable_lzip_decoder=yes])
|
||||
if test "x$enable_decoder_lzma1" != xyes; then
|
||||
enable_lzip_decoder=no
|
||||
AC_MSG_RESULT([no because LZMA1 decoder is disabled])
|
||||
elif test "x$enable_lzip_decoder" = xyes; then
|
||||
AC_DEFINE([HAVE_LZIP_DECODER], [1],
|
||||
[Define to 1 if .lz (lzip) decompression support is enabled.])
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
AM_CONDITIONAL(COND_LZIP_DECODER, test "x$enable_lzip_decoder" = xyes)
|
||||
|
||||
|
||||
###########################
|
||||
# Assembler optimizations #
|
||||
###########################
|
||||
|
@ -353,40 +311,22 @@ if test "x$enable_assembler" = xyes; then
|
|||
linux* | *bsd* | mingw* | cygwin | msys | *djgpp*)
|
||||
case $host_cpu in
|
||||
i?86) enable_assembler=x86 ;;
|
||||
x86_64) enable_assembler=x86_64 ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $enable_assembler in
|
||||
x86 | no)
|
||||
x86 | x86_64 | no)
|
||||
AC_MSG_RESULT([$enable_assembler])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-assembler accepts only 'yes', 'no', or 'x86' (32-bit).])
|
||||
AC_MSG_ERROR([--enable-assembler accepts only `yes', `no', `x86', or `x86_64'.])
|
||||
;;
|
||||
esac
|
||||
AM_CONDITIONAL(COND_ASM_X86, test "x$enable_assembler" = xx86)
|
||||
|
||||
|
||||
#############
|
||||
# CLMUL CRC #
|
||||
#############
|
||||
|
||||
AC_ARG_ENABLE([clmul-crc], AS_HELP_STRING([--disable-clmul-crc],
|
||||
[Do not use carryless multiplication for CRC calculation
|
||||
even if support for it is detected.]),
|
||||
[], [enable_clmul_crc=yes])
|
||||
|
||||
|
||||
############################
|
||||
# ARM64 CRC32 Instructions #
|
||||
############################
|
||||
|
||||
AC_ARG_ENABLE([arm64-crc32], AS_HELP_STRING([--disable-arm64-crc32],
|
||||
[Do not use ARM64 CRC32 instructions even if support for it
|
||||
is detected.]),
|
||||
[], [enable_arm64_crc32=yes])
|
||||
AM_CONDITIONAL(COND_ASM_X86_64, test "x$enable_assembler" = xx86_64)
|
||||
|
||||
|
||||
#####################
|
||||
|
@ -402,7 +342,7 @@ if test "x$enable_small" = xyes; then
|
|||
AC_DEFINE([HAVE_SMALL], [1], [Define to 1 if optimizing for size.])
|
||||
elif test "x$enable_small" != xno; then
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-small accepts only 'yes' or 'no'])
|
||||
AC_MSG_ERROR([--enable-small accepts only `yes' or `no'])
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_small])
|
||||
AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
|
||||
|
@ -414,8 +354,8 @@ AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
|
|||
|
||||
AC_MSG_CHECKING([if threading support is wanted])
|
||||
AC_ARG_ENABLE([threads], AS_HELP_STRING([--enable-threads=METHOD],
|
||||
[Supported METHODS are 'yes', 'no', 'posix', 'win95', and
|
||||
'vista'. The default is 'yes'. Using 'no' together with
|
||||
[Supported METHODS are `yes', `no', `posix', `win95', and
|
||||
`vista'. The default is `yes'. Using `no' together with
|
||||
--enable-small makes liblzma thread unsafe.]),
|
||||
[], [enable_threads=yes])
|
||||
|
||||
|
@ -442,10 +382,18 @@ case $enable_threads in
|
|||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-threads only accepts 'yes', 'no', 'posix', 'win95', or 'vista'])
|
||||
AC_MSG_ERROR([--enable-threads only accepts `yes', `no', `posix', `win95', or `vista'])
|
||||
;;
|
||||
esac
|
||||
|
||||
# The Win95 threading lacks thread-safe one-time initialization function.
|
||||
# It's better to disallow it instead of allowing threaded but thread-unsafe
|
||||
# build.
|
||||
if test "x$enable_small$enable_threads" = xyeswin95; then
|
||||
AC_MSG_ERROR([--enable-threads=win95 and --enable-small cannot be
|
||||
used at the same time])
|
||||
fi
|
||||
|
||||
# We use the actual result a little later.
|
||||
|
||||
|
||||
|
@ -527,25 +475,20 @@ AM_CONDITIONAL([COND_DOC], [test x$enable_doc != xno])
|
|||
|
||||
AC_MSG_CHECKING([if sandboxing should be used])
|
||||
AC_ARG_ENABLE([sandbox], [AS_HELP_STRING([--enable-sandbox=METHOD],
|
||||
[Sandboxing METHOD can be
|
||||
'auto', 'no', 'capsicum', 'pledge', or 'landlock'.
|
||||
The default is 'auto' which enables sandboxing if
|
||||
[Sandboxing METHOD can be `auto', `no', or `capsicum'.
|
||||
The default is `auto' which enables sandboxing if
|
||||
a supported sandboxing method is found.])],
|
||||
[], [enable_sandbox=auto])
|
||||
case $enable_xzdec-$enable_xz-$enable_sandbox in
|
||||
no-no-*)
|
||||
enable_sandbox=no
|
||||
AC_MSG_RESULT([no, --disable-xz and --disable-xzdec was used])
|
||||
;;
|
||||
*-*-auto)
|
||||
case $enable_sandbox in
|
||||
auto)
|
||||
AC_MSG_RESULT([maybe (autodetect)])
|
||||
;;
|
||||
*-*-no | *-*-capsicum | *-*-pledge | *-*-landlock)
|
||||
no | capsicum)
|
||||
AC_MSG_RESULT([$enable_sandbox])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-sandbox only accepts 'auto', 'no', 'capsicum', 'pledge', or 'landlock'.])
|
||||
AC_MSG_ERROR([--enable-sandbox only accepts `auto', `no', or `capsicum'.])
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -604,7 +547,7 @@ echo "Initializing Automake:"
|
|||
# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=17354
|
||||
# The -Wno-unsupported is used to silence warnings about missing
|
||||
# "subdir-objects".
|
||||
AM_INIT_AUTOMAKE([1.12 foreign tar-v7 filename-length-max=99 -Wno-unsupported])
|
||||
AM_INIT_AUTOMAKE([1.12 foreign tar-v7 filename-length-max=99 serial-tests -Wno-unsupported])
|
||||
AC_PROG_LN_S
|
||||
|
||||
dnl # Autoconf >= 2.70 warns that AC_PROG_CC_C99 is obsolete. However,
|
||||
|
@ -635,10 +578,18 @@ AS_CASE([$enable_threads],
|
|||
AC_DEFINE([MYTHREAD_POSIX], [1],
|
||||
[Define to 1 when using POSIX threads (pthreads).])
|
||||
|
||||
# This is nice to have but not mandatory.
|
||||
# These are nice to have but not mandatory.
|
||||
#
|
||||
# FIXME: xz uses clock_gettime if it is available and can do
|
||||
# it even when threading is disabled. Moving this outside
|
||||
# of pthread detection may be undesirable because then
|
||||
# liblzma may get linked against librt even when librt isn't
|
||||
# needed by liblzma.
|
||||
OLD_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
AC_CHECK_FUNCS([pthread_condattr_setclock])
|
||||
AC_SEARCH_LIBS([clock_gettime], [rt])
|
||||
AC_CHECK_FUNCS([clock_gettime pthread_condattr_setclock])
|
||||
AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include <time.h>]])
|
||||
CFLAGS=$OLD_CFLAGS
|
||||
],
|
||||
[win95], [
|
||||
|
@ -705,84 +656,65 @@ fi
|
|||
# used when creating a static library.
|
||||
#
|
||||
# Libtool always uses -DPIC when building shared libraries by default and
|
||||
# doesn't use it for static libs by default. This can be overridden with
|
||||
# doesn't use it for static libs by default. This can be overriden with
|
||||
# --with-pic and --without-pic though. As long as neither --with-pic nor
|
||||
# --without-pic is used then we can use #ifdef PIC to detect if the file is
|
||||
# being built for a shared library.
|
||||
AS_IF([test "x$enable_symbol_versions" = xno], [
|
||||
if test "x$enable_symbol_versions" = xno ; then
|
||||
enable_symbol_versions=no
|
||||
AC_MSG_RESULT([no])
|
||||
], [test "x$enable_shared" = xno], [
|
||||
elif test "x$enable_shared" = xno ; then
|
||||
enable_symbol_versions=no
|
||||
AC_MSG_RESULT([no (not building a shared library)])
|
||||
], [
|
||||
# "yes" means that symbol version are to be used but we need to
|
||||
# autodetect which variant to use.
|
||||
if test "x$enable_symbol_versions" = xyes ; then
|
||||
case "$host_cpu-$host_os" in
|
||||
microblaze*)
|
||||
# GCC 12 on MicroBlaze doesn't support
|
||||
# __symver__ attribute. It's simplest and
|
||||
# safest to use the generic version on that
|
||||
# platform since then only the linker script
|
||||
# is needed. The RHEL/CentOS 7 compatibility
|
||||
# symbols don't matter on MicroBlaze.
|
||||
enable_symbol_versions=generic
|
||||
;;
|
||||
*-linux*)
|
||||
# NVIDIA HPC Compiler doesn't support symbol
|
||||
# versioning but the linker script can still
|
||||
# be used.
|
||||
AC_EGREP_CPP([use_generic_symbol_versioning],
|
||||
[#ifdef __NVCOMPILER
|
||||
use_generic_symbol_versioning
|
||||
#endif],
|
||||
[enable_symbol_versions=generic],
|
||||
[enable_symbol_versions=linux])
|
||||
;;
|
||||
*)
|
||||
enable_symbol_versions=generic
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "x$enable_symbol_versions" = xlinux ; then
|
||||
case "$pic_mode-$enable_static" in
|
||||
default-*)
|
||||
# Use symvers if PIC is defined.
|
||||
have_symbol_versions_linux=2
|
||||
;;
|
||||
*-no)
|
||||
# Not building static library.
|
||||
# Use symvers unconditionally.
|
||||
have_symbol_versions_linux=1
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([
|
||||
else
|
||||
case "$host_cpu-$host_os" in
|
||||
microblaze*)
|
||||
# GCC 12 on MicroBlaze doesn't support __symver__
|
||||
# attribute. It's simplest and safest to use the
|
||||
# generic version on that platform since then only
|
||||
# the linker script is needed. The RHEL/CentOS 7
|
||||
# compatibility symbols don't matter on MicroBlaze.
|
||||
enable_symbol_versions=generic
|
||||
;;
|
||||
*-linux*)
|
||||
case "$pic_mode-$enable_static" in
|
||||
default-*)
|
||||
# Use symvers if PIC is defined.
|
||||
have_symbol_versions_linux=2
|
||||
;;
|
||||
*-no)
|
||||
# Not building static library.
|
||||
# Use symvers unconditionally.
|
||||
have_symbol_versions_linux=1
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([
|
||||
On GNU/Linux, building both shared and static library at the same time
|
||||
is not supported if --with-pic or --without-pic is used.
|
||||
Use either --disable-shared or --disable-static to build one type
|
||||
of library at a time. If both types are needed, build one at a time,
|
||||
possibly picking only src/liblzma/.libs/liblzma.a from the static build.])
|
||||
;;
|
||||
esac
|
||||
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
|
||||
[$have_symbol_versions_linux],
|
||||
[Define to 1 to if GNU/Linux-specific details
|
||||
are unconditionally wanted for symbol
|
||||
versioning. Define to 2 to if these are wanted
|
||||
only if also PIC is defined (allows building
|
||||
both shared and static liblzma at the same
|
||||
time with Libtool if neither --with-pic nor
|
||||
--without-pic is used). This define must be
|
||||
used together with liblzma_linux.map.])
|
||||
elif test "x$enable_symbol_versions" != xgeneric ; then
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([unknown symbol versioning variant '$enable_symbol_versions'])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
enable_symbol_versions=linux
|
||||
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
|
||||
[$have_symbol_versions_linux],
|
||||
[Define to 1 to if GNU/Linux-specific details
|
||||
are unconditionally wanted for symbol
|
||||
versioning. Define to 2 to if these are wanted
|
||||
only if also PIC is defined (allows building
|
||||
both shared and static liblzma at the same
|
||||
time with Libtool if neither --with-pic nor
|
||||
--without-pic is used). This define must be
|
||||
used together with liblzma_linux.map.])
|
||||
;;
|
||||
*)
|
||||
enable_symbol_versions=generic
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([yes ($enable_symbol_versions)])
|
||||
])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([COND_SYMVERS_LINUX],
|
||||
[test "x$enable_symbol_versions" = xlinux])
|
||||
|
@ -817,9 +749,8 @@ AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h],
|
|||
[],
|
||||
[AC_MSG_ERROR([Required header file(s) are missing.])])
|
||||
|
||||
# immintrin.h allows the use of the intrinsic functions if they are available.
|
||||
# cpuid.h may be used for detecting x86 processor features at runtime.
|
||||
AC_CHECK_HEADERS([immintrin.h cpuid.h])
|
||||
# This allows the use of the intrinsic functions if they are available.
|
||||
AC_CHECK_HEADERS([immintrin.h])
|
||||
|
||||
|
||||
###############################################################################
|
||||
|
@ -851,127 +782,6 @@ AC_CHECK_MEMBERS([
|
|||
AC_SYS_LARGEFILE
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
# __attribute__((__constructor__)) can be used for one-time initializations.
|
||||
# Use -Werror because some compilers accept unknown attributes and just
|
||||
# give a warning.
|
||||
#
|
||||
# FIXME? Unfortunately -Werror can cause trouble if CFLAGS contains options
|
||||
# that produce warnings for unrelated reasons. For example, GCC and Clang
|
||||
# support -Wunused-macros which will warn about "#define _GNU_SOURCE 1"
|
||||
# which will be among the #defines that Autoconf inserts to the beginning of
|
||||
# the test program. There seems to be no nice way to prevent Autoconf from
|
||||
# inserting the any defines to the test program.
|
||||
AC_MSG_CHECKING([if __attribute__((__constructor__)) can be used])
|
||||
have_func_attribute_constructor=no
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
__attribute__((__constructor__))
|
||||
static void my_constructor_func(void) { return; }
|
||||
]])], [
|
||||
AC_DEFINE([HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR], [1],
|
||||
[Define to 1 if __attribute__((__constructor__))
|
||||
is supported for functions.])
|
||||
have_func_attribute_constructor=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
CFLAGS="$OLD_CFLAGS"
|
||||
|
||||
# The Win95 threading lacks a thread-safe one-time initialization function.
|
||||
# The one-time initialization is needed for crc32_small.c and crc64_small.c
|
||||
# create the CRC tables. So if small mode is enabled, the threading mode is
|
||||
# win95, and the compiler does not support attribute constructor, then we
|
||||
# would end up with a multithreaded build that is thread-unsafe. As a
|
||||
# result this configuration is not allowed.
|
||||
if test "x$enable_small$enable_threads$have_func_attribute_constructor" \
|
||||
= xyeswin95no; then
|
||||
AC_MSG_ERROR([
|
||||
--enable-threads=win95 and --enable-small cannot be used
|
||||
at the same time with a compiler that doesn't support
|
||||
__attribute__((__constructor__))])
|
||||
fi
|
||||
|
||||
# __attribute__((__ifunc__())) can be used to choose between different
|
||||
# implementations of the same function at runtime. This is slightly more
|
||||
# efficient than using __attribute__((__constructor__)) and setting
|
||||
# a function pointer.
|
||||
AC_ARG_ENABLE([ifunc], [AS_HELP_STRING([--enable-ifunc],
|
||||
[Use __attribute__((__ifunc__())). Enabled by default on
|
||||
GNU/Linux (glibc) and FreeBSD.])],
|
||||
[], [enable_ifunc=auto])
|
||||
|
||||
# When enable_ifunc is 'auto', allow the use of __attribute__((__ifunc__()))
|
||||
# if compiler support is detected and we are building for GNU/Linux (glibc)
|
||||
# or FreeBSD. uClibc and musl don't support ifunc in their dynamic linkers
|
||||
# but some compilers still accept the attribute when compiling for these
|
||||
# C libraries, which results in broken binaries. That's why we need to
|
||||
# check which libc is being used.
|
||||
if test "x$enable_ifunc" = xauto ; then
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror"
|
||||
AC_MSG_CHECKING([if __attribute__((__ifunc__())) can be used])
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
/*
|
||||
* Force a compilation error when not using glibc on Linux
|
||||
* or if we are not using FreeBSD. uClibc will define
|
||||
* __GLIBC__ but does not support ifunc, so we must have
|
||||
* an extra check to disable with uClibc.
|
||||
*/
|
||||
#if defined(__linux__)
|
||||
# include <features.h>
|
||||
# if !defined(__GLIBC__) || defined(__UCLIBC__)
|
||||
compile error
|
||||
# endif
|
||||
#elif !defined(__FreeBSD__)
|
||||
compile error
|
||||
#endif
|
||||
|
||||
static void func(void) { return; }
|
||||
|
||||
/*
|
||||
* The attribute __no_profile_instrument_function__ is
|
||||
* needed with GCC to prevent improper instrumentation in
|
||||
* the ifunc resolver.
|
||||
*/
|
||||
__attribute__((__no_profile_instrument_function__))
|
||||
static void (*resolve_func (void)) (void) { return func; }
|
||||
void func_ifunc (void)
|
||||
__attribute__((__ifunc__("resolve_func")));
|
||||
/*
|
||||
* 'clang -Wall' incorrectly warns that resolve_func is
|
||||
* unused (-Wunused-function). Correct assembly output is
|
||||
* still produced. This problem exists at least in Clang
|
||||
* versions 4 to 17. The following silences the bogus warning:
|
||||
*/
|
||||
void make_clang_quiet(void);
|
||||
void make_clang_quiet(void) { resolve_func()(); }
|
||||
]])], [
|
||||
enable_ifunc=yes
|
||||
], [
|
||||
enable_ifunc=no
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$enable_ifunc])
|
||||
|
||||
CFLAGS="$OLD_CFLAGS"
|
||||
fi
|
||||
|
||||
if test "x$enable_ifunc" = xyes ; then
|
||||
AC_DEFINE([HAVE_FUNC_ATTRIBUTE_IFUNC], [1],
|
||||
[Define to 1 if __attribute__((__ifunc__()))
|
||||
is supported for functions.])
|
||||
|
||||
# ifunc explicitly does not work with -fsanitize=address.
|
||||
# If configured, it will result in a liblzma build that will fail
|
||||
# when liblzma is loaded at runtime (when the ifunc resolver
|
||||
# executes).
|
||||
AS_CASE([$CFLAGS], [*-fsanitize=*], [AC_MSG_ERROR([
|
||||
CFLAGS contains '-fsanitize=' which is incompatible with ifunc.
|
||||
Use --disable-ifunc when using '-fsanitize'.])])
|
||||
fi
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Checks for library functions.
|
||||
|
@ -980,22 +790,6 @@ fi
|
|||
# Gnulib replacements as needed
|
||||
gl_GETOPT
|
||||
|
||||
# If clock_gettime() is available, liblzma with pthreads may use it, and
|
||||
# xz may use it even when threading support is disabled. In XZ Utils 5.4.x
|
||||
# and older, configure checked for clock_gettime() only when using pthreads.
|
||||
# This way non-threaded builds of liblzma didn't get a useless dependency on
|
||||
# librt which further had a dependency on libpthread. Avoiding these was
|
||||
# useful when a small build was needed, for example, for initramfs use.
|
||||
#
|
||||
# The above reasoning is thoroughly obsolete: On GNU/Linux, librt hasn't
|
||||
# been needed for clock_gettime() since glibc 2.17 (2012-12-25).
|
||||
# Solaris 10 needs librt but Solaris 11 doesn't anymore.
|
||||
AC_SEARCH_LIBS([clock_gettime], [rt])
|
||||
AC_CHECK_FUNCS([clock_gettime])
|
||||
AC_CHECK_DECL([CLOCK_MONOTONIC], [AC_DEFINE([HAVE_CLOCK_MONOTONIC], [1],
|
||||
[Define to 1 if 'CLOCK_MONOTONIC' is declared in <time.h>.])], [],
|
||||
[[#include <time.h>]])
|
||||
|
||||
# Find the best function to set timestamps.
|
||||
AC_CHECK_FUNCS([futimens futimes futimesat utimes _futime utime], [break])
|
||||
|
||||
|
@ -1073,163 +867,10 @@ AC_CHECK_DECL([_mm_movemask_epi8],
|
|||
#include <immintrin.h>
|
||||
#endif])
|
||||
|
||||
# For faster CRC on 32/64-bit x86 and E2K (see also crc64_fast.c):
|
||||
#
|
||||
# - Check for the CLMUL intrinsic _mm_clmulepi64_si128 in <immintrin.h>.
|
||||
# Check also for _mm_set_epi64x for consistency with CMake build
|
||||
# where it's needed to disable CLMUL with VS2013.
|
||||
#
|
||||
# - Check that __attribute__((__target__("ssse3,sse4.1,pclmul"))) works
|
||||
# together with _mm_clmulepi64_si128 from <immintrin.h>. The attribute
|
||||
# was added in GCC 4.4 but some GCC 4.x versions don't allow intrinsics
|
||||
# with it. Exception: it must be not be used with EDG-based compilers
|
||||
# like ICC and the compiler on E2K.
|
||||
#
|
||||
# If everything above is supported, runtime detection will be used to keep the
|
||||
# binaries working on systems that don't support the required extensions.
|
||||
AC_MSG_CHECKING([if _mm_clmulepi64_si128 is usable])
|
||||
AS_IF([test "x$enable_clmul_crc" = xno], [
|
||||
AC_MSG_RESULT([no, --disable-clmul-crc was used])
|
||||
], [
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <immintrin.h>
|
||||
|
||||
// CLMUL works on older E2K instruction set but it is slow due to emulation.
|
||||
#if defined(__e2k__) && __iset__ < 6
|
||||
# error
|
||||
#endif
|
||||
|
||||
// Intel's old compiler (ICC) can define __GNUC__ but the attribute must not
|
||||
// be used with it. The new Clang-based ICX needs the attribute.
|
||||
// Checking for !defined(__EDG__) catches ICC and other EDG-based compilers.
|
||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
|
||||
__attribute__((__target__("ssse3,sse4.1,pclmul")))
|
||||
#endif
|
||||
__m128i my_clmul(__m128i a)
|
||||
{
|
||||
const __m128i b = _mm_set_epi64x(1, 2);
|
||||
return _mm_clmulepi64_si128(a, b, 0);
|
||||
}
|
||||
]])], [
|
||||
AC_DEFINE([HAVE_USABLE_CLMUL], [1],
|
||||
[Define to 1 if _mm_set_epi64x and
|
||||
_mm_clmulepi64_si128 are usable.
|
||||
See configure.ac for details.])
|
||||
enable_clmul_crc=yes
|
||||
], [
|
||||
enable_clmul_crc=no
|
||||
])
|
||||
AC_MSG_RESULT([$enable_clmul_crc])
|
||||
])
|
||||
|
||||
# ARM64 C Language Extensions define CRC32 functions in arm_acle.h.
|
||||
# These are supported by at least GCC and Clang which both need
|
||||
# __attribute__((__target__("+crc"))), unless the needed compiler flags
|
||||
# are used to support the CRC instruction.
|
||||
AC_MSG_CHECKING([if ARM64 CRC32 instruction is usable])
|
||||
AS_IF([test "x$enable_arm64_crc32" = xno], [
|
||||
AC_MSG_RESULT([no, --disable-arm64-crc32 was used])
|
||||
], [
|
||||
# Set -Werror here because some versions of Clang (14 and older)
|
||||
# do not report the unsupported __attribute__((__target__("+crc")))
|
||||
# or __crc32d() as an error, only as a warning. This does not need
|
||||
# to be done with CMake because tests will attempt to link and the
|
||||
# error will be reported then.
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror"
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <arm_acle.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
|
||||
__attribute__((__target__("+crc")))
|
||||
#endif
|
||||
uint32_t my_crc(uint32_t a, uint64_t b)
|
||||
{
|
||||
return __crc32d(a, b);
|
||||
}
|
||||
]])], [
|
||||
AC_DEFINE([HAVE_ARM64_CRC32], [1],
|
||||
[Define to 1 if ARM64 CRC32 instruction is supported.
|
||||
See configure.ac for details.])
|
||||
enable_arm64_crc32=yes
|
||||
], [
|
||||
enable_arm64_crc32=no
|
||||
])
|
||||
AC_MSG_RESULT([$enable_arm64_crc32])
|
||||
|
||||
CFLAGS="$OLD_CFLAGS"
|
||||
])
|
||||
|
||||
# Check for ARM64 CRC32 instruction runtime detection.
|
||||
# getauxval() is supported on Linux, elf_aux_info() on FreeBSD, and
|
||||
# sysctlbyname("hw.optional.armv8_crc32", ...) is supported on Darwin
|
||||
# (macOS, iOS, etc.). Note that sysctlbyname() is supported on FreeBSD,
|
||||
# NetBSD, and possibly others too but the string is specific to Apple OSes.
|
||||
# The C code is responsible for checking defined(__APPLE__) before using
|
||||
# sysctlbyname("hw.optional.armv8_crc32", ...).
|
||||
AS_IF([test "x$enable_arm64_crc32" = xyes], [
|
||||
AC_CHECK_FUNCS([getauxval elf_aux_info sysctlbyname])
|
||||
])
|
||||
|
||||
|
||||
# Check for sandbox support. If one is found, set enable_sandbox=found.
|
||||
#
|
||||
# About -fsanitize: Of our three sandbox methods, only Landlock is
|
||||
# incompatible with -fsanitize. FreeBSD 13.2 with Capsicum was tested with
|
||||
# -fsanitize=address,undefined and had no issues. OpenBSD (as of version
|
||||
# 7.4) has minimal support for process instrumentation. OpenBSD does not
|
||||
# distribute the additional libraries needed (libasan, libubsan, etc.) with
|
||||
# GCC or Clang needed for runtime sanitization support and instead only
|
||||
# support -fsanitize-minimal-runtime for minimal undefined behavior
|
||||
# sanitization. This minimal support is compatible with our use of the
|
||||
# Pledge sandbox. So only Landlock will result in a build that cannot
|
||||
# compress or decompress a single file to standard out.
|
||||
AS_CASE([$enable_sandbox],
|
||||
[auto | capsicum], [
|
||||
AC_CHECK_FUNCS([cap_rights_limit], [enable_sandbox=found])
|
||||
]
|
||||
)
|
||||
AS_CASE([$enable_sandbox],
|
||||
[auto | pledge], [
|
||||
AC_CHECK_FUNCS([pledge], [enable_sandbox=found])
|
||||
]
|
||||
)
|
||||
AS_CASE([$enable_sandbox],
|
||||
[auto | landlock], [
|
||||
AC_MSG_CHECKING([if Linux Landlock is usable])
|
||||
|
||||
# A compile check is done here because some systems have
|
||||
# linux/landlock.h, but do not have the syscalls defined
|
||||
# in order to actually use Linux Landlock.
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <linux/landlock.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/prctl.h>
|
||||
|
||||
void my_sandbox(void)
|
||||
{
|
||||
(void)prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
|
||||
(void)SYS_landlock_create_ruleset;
|
||||
(void)SYS_landlock_restrict_self;
|
||||
(void)LANDLOCK_CREATE_RULESET_VERSION;
|
||||
return;
|
||||
}
|
||||
]])], [
|
||||
enable_sandbox=found
|
||||
|
||||
AS_CASE([$CFLAGS], [*-fsanitize=*], [AC_MSG_ERROR([
|
||||
CFLAGS contains '-fsanitize=' which is incompatible with the Landlock
|
||||
sandboxing. Use --disable-sandbox when using '-fsanitize'.])])
|
||||
|
||||
AC_DEFINE([HAVE_LINUX_LANDLOCK], [1],
|
||||
[Define to 1 if Linux Landlock is supported.
|
||||
See configure.ac for details.])
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
AX_CHECK_CAPSICUM([enable_sandbox=found], [:])
|
||||
]
|
||||
)
|
||||
|
||||
|
@ -1267,14 +908,12 @@ AS_IF([test "$GCC" = yes], [
|
|||
# backed up with "return LZMA_PROG_ERROR".
|
||||
# * -Wcast-qual would break various things where we need a non-const
|
||||
# pointer although we don't modify anything through it.
|
||||
# * -Wcast-align breaks optimized CRC32 and CRC64 implementation
|
||||
# on some architectures (not on x86), where this warning is bogus,
|
||||
# because we take care of correct alignment.
|
||||
# * -Winline, -Wdisabled-optimization, -Wunsafe-loop-optimizations
|
||||
# don't seem so useful here; at least the last one gives some
|
||||
# warnings which are not bugs.
|
||||
# * -Wconversion still shows too many warnings.
|
||||
#
|
||||
# The flags before the empty line are for GCC and many of them
|
||||
# are supported by Clang too. The flags after the empty line are
|
||||
# for Clang.
|
||||
for NEW_FLAG in \
|
||||
-Wall \
|
||||
-Wextra \
|
||||
|
@ -1282,49 +921,27 @@ AS_IF([test "$GCC" = yes], [
|
|||
-Wformat=2 \
|
||||
-Winit-self \
|
||||
-Wmissing-include-dirs \
|
||||
-Wshift-overflow=2 \
|
||||
-Wstrict-overflow=3 \
|
||||
-Walloc-zero \
|
||||
-Wduplicated-cond \
|
||||
-Wstrict-aliasing \
|
||||
-Wfloat-equal \
|
||||
-Wundef \
|
||||
-Wshadow \
|
||||
-Wpointer-arith \
|
||||
-Wbad-function-cast \
|
||||
-Wwrite-strings \
|
||||
-Wdate-time \
|
||||
-Wsign-conversion \
|
||||
-Wfloat-conversion \
|
||||
-Wlogical-op \
|
||||
-Waggregate-return \
|
||||
-Wstrict-prototypes \
|
||||
-Wold-style-definition \
|
||||
-Wmissing-prototypes \
|
||||
-Wmissing-declarations \
|
||||
-Wredundant-decls \
|
||||
\
|
||||
-Wc99-compat \
|
||||
-Wc11-extensions \
|
||||
-Wc2x-compat \
|
||||
-Wc2x-extensions \
|
||||
-Wpre-c2x-compat \
|
||||
-Warray-bounds-pointer-arithmetic \
|
||||
-Wassign-enum \
|
||||
-Wconditional-uninitialized \
|
||||
-Wdocumentation \
|
||||
-Wduplicate-enum \
|
||||
-Wempty-translation-unit \
|
||||
-Wflexible-array-extensions \
|
||||
-Wmissing-variable-declarations \
|
||||
-Wnewline-eof \
|
||||
-Wshift-sign-overflow \
|
||||
-Wstring-conversion
|
||||
-Wmissing-noreturn \
|
||||
-Wredundant-decls
|
||||
do
|
||||
AC_MSG_CHECKING([if $CC accepts $NEW_FLAG])
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $NEW_FLAG -Werror"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
|
||||
[[void foo(void); void foo(void) { }]])], [
|
||||
[void foo(void); void foo(void) { }])], [
|
||||
AM_CFLAGS="$AM_CFLAGS $NEW_FLAG"
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
|
@ -1361,6 +978,7 @@ xz=`echo xz | sed "$program_transform_name"`
|
|||
AC_SUBST([xz])
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Doxyfile
|
||||
Makefile
|
||||
po/Makefile.in
|
||||
lib/Makefile
|
||||
|
@ -1396,11 +1014,9 @@ if test x$tuklib_cv_cpucores_method = xunknown; then
|
|||
echo "No supported method to detect the number of CPU cores."
|
||||
fi
|
||||
|
||||
if test "x$enable_threads$enable_small$have_func_attribute_constructor" \
|
||||
= xnoyesno; then
|
||||
if test "x$enable_threads$enable_small" = xnoyes; then
|
||||
echo
|
||||
echo "NOTE:"
|
||||
echo "liblzma will be thread-unsafe due to the combination"
|
||||
echo "of --disable-threads --enable-small when using a compiler"
|
||||
echo "that doesn't support __attribute__((__constructor__))."
|
||||
echo "liblzma will be thread unsafe due the combination"
|
||||
echo "of --disable-threads --enable-small."
|
||||
fi
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
## SPDX-License-Identifier: 0BSD
|
||||
##
|
||||
## Author: Lasse Collin
|
||||
##
|
||||
## This file has been put into the public domain.
|
||||
## You can do whatever you want with this file.
|
||||
##
|
||||
|
||||
EXTRA_DIST = \
|
||||
translation.bash
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// SPDX-License-Identifier: 0BSD
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file crc32.c
|
||||
|
@ -7,6 +5,9 @@
|
|||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// SPDX-License-Identifier: 0BSD
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file full_flush.c
|
||||
|
@ -7,6 +5,9 @@
|
|||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// SPDX-License-Identifier: 0BSD
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file hex2bin.c
|
||||
|
@ -7,6 +5,9 @@
|
|||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// SPDX-License-Identifier: 0BSD
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file known_sizes.c
|
||||
|
@ -11,6 +9,9 @@
|
|||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// SPDX-License-Identifier: 0BSD
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file memusage.c
|
||||
|
@ -7,6 +5,9 @@
|
|||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// SPDX-License-Identifier: 0BSD
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file repeat.c
|
||||
|
@ -11,6 +9,9 @@
|
|||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// SPDX-License-Identifier: 0BSD
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file sync_flush.c
|
||||
|
@ -7,6 +5,9 @@
|
|||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#!/bin/bash
|
||||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
|
@ -21,6 +20,9 @@
|
|||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
set -e
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// SPDX-License-Identifier: 0BSD
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file 01_compress_easy.c
|
||||
|
@ -11,6 +9,9 @@
|
|||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdbool.h>
|
||||
|
@ -26,7 +27,7 @@ show_usage_and_exit(const char *argv0)
|
|||
{
|
||||
fprintf(stderr, "Usage: %s PRESET < INFILE > OUTFILE\n"
|
||||
"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);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// SPDX-License-Identifier: 0BSD
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file 02_decompress.c
|
||||
|
@ -11,6 +9,9 @@
|
|||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdbool.h>
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// SPDX-License-Identifier: 0BSD
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file 03_compress_custom.c
|
||||
|
@ -11,6 +9,9 @@
|
|||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdbool.h>
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// SPDX-License-Identifier: 0BSD
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file 04_compress_easy_mt.c
|
||||
|
@ -11,6 +9,9 @@
|
|||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdbool.h>
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -1,5 +1,9 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
CC = c99
|
||||
CFLAGS = -g
|
||||
|
@ -9,8 +13,7 @@ PROGS = \
|
|||
01_compress_easy \
|
||||
02_decompress \
|
||||
03_compress_custom \
|
||||
04_compress_easy_mt \
|
||||
11_file_info
|
||||
04_compress_easy_mt
|
||||
|
||||
all: $(PROGS)
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -240,5 +240,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
|
||||
a separate project, which provides a limited but significantly
|
||||
smaller XZ decoder implementation than XZ Utils. You can find it
|
||||
at <https://xz.tukaani.org/xz-embedded/>.
|
||||
at <https://tukaani.org/xz/embedded.html>.
|
||||
|
||||
|
|
|
@ -40,11 +40,11 @@ The .lzma File Format
|
|||
|
||||
0.2. Changes
|
||||
|
||||
Last modified: 2024-01-16 18:00+0800
|
||||
Last modified: 2022-07-13 21:00+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.
|
||||
Compared to the previous version (2011-04-12 11:55+0300)
|
||||
the section 1.1.3 was modified to allow End of Payload Marker
|
||||
with a known Uncompressed Size.
|
||||
|
||||
|
||||
1. File Format
|
||||
|
@ -157,17 +157,17 @@ The .lzma File Format
|
|||
2. References
|
||||
|
||||
LZMA SDK - The original LZMA implementation
|
||||
https://7-zip.org/sdk.html
|
||||
http://7-zip.org/sdk.html
|
||||
|
||||
7-Zip
|
||||
https://7-zip.org/
|
||||
http://7-zip.org/
|
||||
|
||||
LZMA Utils - LZMA adapted to POSIX-like systems
|
||||
https://tukaani.org/lzma/
|
||||
http://tukaani.org/lzma/
|
||||
|
||||
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
|
||||
https://xz.tukaani.org/format/xz-file-format.txt
|
||||
http://tukaani.org/xz/xz-file-format.txt
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The .xz File Format
|
||||
===================
|
||||
|
||||
Version 1.2.0 (2024-01-19)
|
||||
Version 1.0.4 (2009-08-27)
|
||||
|
||||
|
||||
0. Preface
|
||||
|
@ -81,26 +81,18 @@ Version 1.2.0 (2024-01-19)
|
|||
0.2. Getting the Latest Version
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
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,
|
||||
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)
|
||||
0x05 4 bytes PowerPC (big endian) filter
|
||||
0x06 16 bytes IA64 filter
|
||||
0x07 4 bytes ARM filter [1]
|
||||
0x08 2 bytes ARM Thumb filter [1]
|
||||
0x07 4 bytes ARM (little endian) filter
|
||||
0x08 2 bytes ARM Thumb (little endian) 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
|
||||
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
|
||||
|
||||
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
|
||||
him to allocate a range of IDs for the developer.
|
||||
|
||||
The second choice is to generate a 40-bit random integer
|
||||
which the developer can use as a personal Developer ID.
|
||||
The second choice is to generate a 40-bit random integer,
|
||||
which the developer can use as his personal Developer ID.
|
||||
To minimize the risk of collisions, Developer ID has to be
|
||||
a randomly generated integer, not manually selected "hex word".
|
||||
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
|
||||
|
||||
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.
|
||||
|
||||
Bits Mask Description
|
||||
|
@ -1141,30 +1121,30 @@ Version 1.2.0 (2024-01-19)
|
|||
7. References
|
||||
|
||||
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
|
||||
https://tukaani.org/lzma/
|
||||
http://tukaani.org/lzma/
|
||||
|
||||
XZ Utils - The next generation of LZMA Utils
|
||||
https://xz.tukaani.org/xz-utils/
|
||||
http://tukaani.org/xz/
|
||||
|
||||
[RFC-1952]
|
||||
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"
|
||||
|
||||
[RFC-2119]
|
||||
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 1.35 manual
|
||||
https://www.gnu.org/software/tar/manual/html_node/Blocking-Factor.html
|
||||
GNU tar 1.21 manual
|
||||
http://www.gnu.org/software/tar/manual/html_node/Blocking-Factor.html
|
||||
- Node 9.4.2 "Blocking Factor", paragraph that begins
|
||||
"gzip will complain about trailing garbage"
|
||||
- Note that this URL points to the latest version of the
|
||||
manual, and may some day not contain the note which is in
|
||||
1.35. For the exact version of the manual, download GNU
|
||||
tar 1.35: ftp://ftp.gnu.org/pub/gnu/tar/tar-1.35.tar.gz
|
||||
1.21. For the exact version of the manual, download GNU
|
||||
tar 1.21: ftp://ftp.gnu.org/pub/gnu/tar/tar-1.21.tar.gz
|
||||
|
||||
|
|
BIN
doc/xz-logo.png
BIN
doc/xz-logo.png
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB |
|
@ -1,11 +1,12 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Makefile to build XZ Utils using DJGPP
|
||||
#
|
||||
# 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
|
||||
|
@ -61,7 +62,6 @@ SRCS_C = \
|
|||
../src/liblzma/common/block_header_encoder.c \
|
||||
../src/liblzma/common/block_util.c \
|
||||
../src/liblzma/common/common.c \
|
||||
../src/liblzma/common/file_info.c \
|
||||
../src/liblzma/common/filter_common.c \
|
||||
../src/liblzma/common/filter_decoder.c \
|
||||
../src/liblzma/common/filter_encoder.c \
|
||||
|
@ -72,13 +72,11 @@ SRCS_C = \
|
|||
../src/liblzma/common/index_decoder.c \
|
||||
../src/liblzma/common/index_encoder.c \
|
||||
../src/liblzma/common/index_hash.c \
|
||||
../src/liblzma/common/lzip_decoder.c \
|
||||
../src/liblzma/common/stream_decoder.c \
|
||||
../src/liblzma/common/stream_encoder.c \
|
||||
../src/liblzma/common/stream_flags_common.c \
|
||||
../src/liblzma/common/stream_flags_decoder.c \
|
||||
../src/liblzma/common/stream_flags_encoder.c \
|
||||
../src/liblzma/common/string_conversion.c \
|
||||
../src/liblzma/common/vli_decoder.c \
|
||||
../src/liblzma/common/vli_encoder.c \
|
||||
../src/liblzma/common/vli_size.c \
|
||||
|
@ -98,7 +96,6 @@ SRCS_C = \
|
|||
../src/liblzma/lzma/lzma_encoder_presets.c \
|
||||
../src/liblzma/rangecoder/price_table.c \
|
||||
../src/liblzma/simple/arm.c \
|
||||
../src/liblzma/simple/arm64.c \
|
||||
../src/liblzma/simple/armthumb.c \
|
||||
../src/liblzma/simple/ia64.c \
|
||||
../src/liblzma/simple/powerpc.c \
|
||||
|
|
19
dos/config.h
19
dos/config.h
|
@ -1,5 +1,3 @@
|
|||
/* SPDX-License-Identifier: 0BSD */
|
||||
|
||||
/* How many MiB of RAM to assume if the real amount cannot be determined. */
|
||||
#define ASSUME_RAM 32
|
||||
|
||||
|
@ -18,9 +16,6 @@
|
|||
/* Define to 1 if arm decoder is enabled. */
|
||||
#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 HAVE_DECODER_ARMTHUMB 1
|
||||
|
||||
|
@ -51,9 +46,6 @@
|
|||
/* Define to 1 if arm encoder is enabled. */
|
||||
#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 HAVE_ENCODER_ARMTHUMB 1
|
||||
|
||||
|
@ -84,9 +76,6 @@
|
|||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#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 HAVE_MF_BT2 1
|
||||
|
||||
|
@ -117,14 +106,14 @@
|
|||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#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 to 1 or 0, depending whether the compiler supports simple visibility
|
||||
declarations. */
|
||||
#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 to 1 if the GNU C extension __builtin_assume_aligned is supported.
|
||||
|
@ -145,9 +134,9 @@
|
|||
#define PACKAGE_NAME "XZ Utils"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL "https://xz.tukaani.org/xz-utils/"
|
||||
#define PACKAGE_URL "https://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 to 1 if the system supports fast unaligned access to 16-bit and
|
||||
|
|
2687
doxygen/Doxyfile
2687
doxygen/Doxyfile
File diff suppressed because it is too large
Load Diff
|
@ -1,13 +0,0 @@
|
|||
<hr class="footer"/>
|
||||
|
||||
<p style="text-align: right;padding-right: 12px;">
|
||||
XZ logo © 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>
|
|
@ -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
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/bash
|
||||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# 7z2lzma.bash is very primitive .7z to .lzma converter. The input file must
|
||||
|
@ -18,6 +17,9 @@
|
|||
#
|
||||
# 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.
|
||||
|
|
|
@ -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.
|
||||
Copyright (C) 2006 Timo Lindfors
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
## SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
##
|
||||
## Copyright (C) 2004-2007 Free Software Foundation, Inc.
|
||||
##
|
||||
|
@ -23,17 +21,7 @@ libgnu_a_SOURCES =
|
|||
libgnu_a_DEPENDENCIES = $(LIBOBJS)
|
||||
libgnu_a_LIBADD = $(LIBOBJS)
|
||||
|
||||
EXTRA_DIST = \
|
||||
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
|
||||
|
||||
EXTRA_DIST = getopt.in.h getopt.c getopt1.c getopt_int.h
|
||||
BUILT_SOURCES = $(GETOPT_H)
|
||||
MOSTLYCLEANFILES = getopt.h getopt.h-t
|
||||
|
||||
|
|
|
@ -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 */
|
|
@ -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 */
|
|
@ -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 */
|
|
@ -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 */
|
|
@ -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 */
|
1146
lib/getopt.c
1146
lib/getopt.c
File diff suppressed because it is too large
Load Diff
230
lib/getopt.in.h
230
lib/getopt.in.h
|
@ -1,28 +1,27 @@
|
|||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
/* Declarations for getopt.
|
||||
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, which supplies a different version of
|
||||
this file.
|
||||
Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005,2006,2007
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of 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 program 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, or (at your option)
|
||||
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
|
||||
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/>. */
|
||||
You should have received a copy of the GNU Lesser General Public License along
|
||||
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
|
||||
|
||||
#define _GETOPT_H 1
|
||||
#ifndef __need_getopt
|
||||
# define _GETOPT_H 1
|
||||
#endif
|
||||
|
||||
/* Standalone applications should #define __GETOPT_PREFIX to an
|
||||
identifier that prefixes the external functions and variables
|
||||
|
@ -32,29 +31,196 @@
|
|||
identifiers so that they do not collide with the system functions
|
||||
and variables. Renaming avoids problems with some compilers and
|
||||
linkers. */
|
||||
#if defined __GETOPT_PREFIX
|
||||
#if defined __GETOPT_PREFIX && !defined __need_getopt
|
||||
# include <stdlib.h>
|
||||
# include <stdio.h>
|
||||
|
||||
# ifndef _MSC_VER
|
||||
# include <unistd.h>
|
||||
# endif
|
||||
# include <unistd.h>
|
||||
# undef __need_getopt
|
||||
# undef getopt
|
||||
# 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
|
||||
|
||||
/* From Gnulib's lib/arg-nonnull.h: */
|
||||
/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
|
||||
that the values passed as arguments n, ..., m must be non-NULL pointers.
|
||||
n = 1 stands for the first argument, n = 2 for the second argument etc. */
|
||||
#ifndef _GL_ARG_NONNULL
|
||||
# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
|
||||
# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
|
||||
/* Standalone applications get correct prototypes for getopt_long and
|
||||
getopt_long_only; they declare "char **argv". libc uses prototypes
|
||||
with "char *const *argv" that are incorrect because getopt_long and
|
||||
getopt_long_only can permute argv; this is required for backward
|
||||
compatibility (e.g., for LSB 2.0.1).
|
||||
|
||||
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
|
||||
# define _GL_ARG_NONNULL(params)
|
||||
# define __getopt_argv_const const
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <getopt-cdefs.h>
|
||||
#include <getopt-pfx-core.h>
|
||||
#include <getopt-pfx-ext.h>
|
||||
/* If __GNU_LIBRARY__ is not already defined, either we are being used
|
||||
standalone, or this is the first header included in the source file.
|
||||
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 */
|
||||
|
|
|
@ -1,32 +1,41 @@
|
|||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||
Copyright (C) 1987-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.
|
||||
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
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.
|
||||
This program 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, or (at your option)
|
||||
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
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
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/>. */
|
||||
You should have received a copy of the GNU Lesser General Public License along
|
||||
with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _LIBC
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
# endif
|
||||
#ifdef _LIBC
|
||||
# include <getopt.h>
|
||||
#else
|
||||
# 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
|
||||
|
||||
#include "getopt.h"
|
||||
#include "getopt_int.h"
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
int
|
||||
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)
|
||||
{
|
||||
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.
|
||||
|
@ -65,14 +74,13 @@ _getopt_long_only_r (int argc, char **argv, const char *options,
|
|||
struct _getopt_data *d)
|
||||
{
|
||||
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
|
||||
1, d, 0);
|
||||
1, 0, d);
|
||||
}
|
||||
|
||||
|
||||
#ifdef TEST
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
|
@ -84,7 +92,7 @@ main (int argc, char **argv)
|
|||
{
|
||||
int this_option_optind = optind ? optind : 1;
|
||||
int option_index = 0;
|
||||
static const struct option long_options[] =
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{"add", 1, 0, 0},
|
||||
{"append", 0, 0, 0},
|
||||
|
@ -134,11 +142,11 @@ main (int argc, char **argv)
|
|||
break;
|
||||
|
||||
case 'c':
|
||||
printf ("option c with value '%s'\n", optarg);
|
||||
printf ("option c with value `%s'\n", optarg);
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
printf ("option d with value '%s'\n", optarg);
|
||||
printf ("option d with value `%s'\n", optarg);
|
||||
break;
|
||||
|
||||
case '?':
|
||||
|
|
111
lib/getopt_int.h
111
lib/getopt_int.h
|
@ -1,64 +1,34 @@
|
|||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
/* Internal declarations for getopt.
|
||||
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.
|
||||
Copyright (C) 1989-1994,1996-1999,2001,2003,2004
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
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.
|
||||
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 Free Software Foundation; either version 2, or (at your option)
|
||||
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
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU 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/>. */
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _GETOPT_INT_H
|
||||
#define _GETOPT_INT_H 1
|
||||
|
||||
#include <getopt.h>
|
||||
|
||||
extern int _getopt_internal (int ___argc, char **___argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind,
|
||||
const struct option *__longopts, int *__longind,
|
||||
int __long_only, int __posixly_correct);
|
||||
|
||||
|
||||
/* Reentrant versions which can handle parsing multiple argument
|
||||
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. */
|
||||
struct _getopt_data
|
||||
{
|
||||
|
@ -83,17 +53,58 @@ struct _getopt_data
|
|||
by advancing to the next ARGV-element. */
|
||||
char *__nextchar;
|
||||
|
||||
/* See __ord above. */
|
||||
enum __ord __ordering;
|
||||
/* Describe how to deal with options that follow non-option ARGV-elements.
|
||||
|
||||
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. */
|
||||
|
||||
/* Describe the part of ARGV that contains non-options that have
|
||||
been skipped. 'first_nonopt' is the index in ARGV of the first
|
||||
of them; 'last_nonopt' is the index after the last of them. */
|
||||
been skipped. `first_nonopt' is the index in ARGV of the first
|
||||
of them; `last_nonopt' is the index after the last of them. */
|
||||
|
||||
int __first_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
|
||||
|
@ -103,8 +114,8 @@ struct _getopt_data
|
|||
extern int _getopt_internal_r (int ___argc, char **___argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind,
|
||||
int __long_only, struct _getopt_data *__data,
|
||||
int __posixly_correct);
|
||||
int __long_only, int __posixly_correct,
|
||||
struct _getopt_data *__data);
|
||||
|
||||
extern int _getopt_long_r (int ___argc, char **___argv,
|
||||
const char *__shortopts,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
build-to-host.m4
|
||||
codeset.m4
|
||||
extern-inline.m4
|
||||
fcntl-o.m4
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
# -*- Autoconf -*-
|
||||
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CHECK_CAPSICUM([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro searches for an installed Capsicum header and library,
|
||||
# and if found:
|
||||
# - AC_DEFINE([HAVE_CAPSICUM]) is called.
|
||||
# - AC_DEFINE([HAVE_SYS_CAPSICUM_H]) is called if <sys/capsicum.h>
|
||||
# is present (otherwise <sys/capability.h> must be used).
|
||||
# - CAPSICUM_LIB is set to the -l option needed to link Capsicum support,
|
||||
# and AC_SUBST([CAPSICUM_LIB]) is called.
|
||||
# - The shell commands in ACTION-IF-FOUND are run. The default
|
||||
# ACTION-IF-FOUND prepends ${CAPSICUM_LIB} into LIBS. If you don't
|
||||
# want to modify LIBS and don't need to run any other commands either,
|
||||
# use a colon as ACTION-IF-FOUND.
|
||||
#
|
||||
# If Capsicum support isn't found:
|
||||
# - The shell commands in ACTION-IF-NOT-FOUND are run. The default
|
||||
# ACTION-IF-NOT-FOUND calls AC_MSG_WARN to print a warning that
|
||||
# Capsicum support wasn't found.
|
||||
#
|
||||
# You should use autoheader to include a definition for the symbols above
|
||||
# in a config.h file.
|
||||
#
|
||||
# Sample usage in a C/C++ source is as follows:
|
||||
#
|
||||
# #ifdef HAVE_CAPSICUM
|
||||
# # ifdef HAVE_SYS_CAPSICUM_H
|
||||
# # include <sys/capsicum.h>
|
||||
# # else
|
||||
# # include <sys/capability.h>
|
||||
# # endif
|
||||
# #endif /* HAVE_CAPSICUM */
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2014 Google Inc.
|
||||
# Copyright (c) 2015 Lasse Collin <lasse.collin@tukaani.org>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification,
|
||||
# are permitted in any medium without royalty provided the copyright
|
||||
# notice and this notice are preserved. This file is offered as-is,
|
||||
# without any warranty.
|
||||
|
||||
#serial 2
|
||||
|
||||
AC_DEFUN([AX_CHECK_CAPSICUM], [
|
||||
# On FreeBSD >= 11.x and Linux, Capsicum is uses <sys/capsicum.h>.
|
||||
# If this header is found, it is assumed to be the right one.
|
||||
capsicum_header_found=no
|
||||
AC_CHECK_HEADERS([sys/capsicum.h], [capsicum_header_found=yes])
|
||||
if test "$capsicum_header_found" = no ; then
|
||||
# On FreeBSD 10.x Capsicum uses <sys/capability.h>. Such a header exists
|
||||
# on Linux too but it describes POSIX.1e capabilities. Look for the
|
||||
# declaration of cap_rights_limit to check if <sys/capability.h> is
|
||||
# a Capsicum header.
|
||||
AC_CHECK_DECL([cap_rights_limit], [capsicum_header_found=yes], [],
|
||||
[#include <sys/capability.h>])
|
||||
fi
|
||||
|
||||
capsicum_lib_found=no
|
||||
CAPSICUM_LIB=
|
||||
if test "$capsicum_header_found" = yes ; then
|
||||
AC_LANG_PUSH([C])
|
||||
# FreeBSD >= 10.x has Capsicum functions in libc.
|
||||
AC_LINK_IFELSE([AC_LANG_CALL([], [cap_rights_limit])],
|
||||
[capsicum_lib_found=yes], [])
|
||||
# Linux has Capsicum functions in libcaprights.
|
||||
AC_CHECK_LIB([caprights], [cap_rights_limit],
|
||||
[CAPSICUM_LIB=-lcaprights
|
||||
capsicum_lib_found=yes], [])
|
||||
AC_LANG_POP([C])
|
||||
fi
|
||||
AC_SUBST([CAPSICUM_LIB])
|
||||
|
||||
if test "$capsicum_lib_found" = yes ; then
|
||||
AC_DEFINE([HAVE_CAPSICUM], [1], [Define to 1 if Capsicum is available.])
|
||||
m4_default([$1], [LIBS="${CAPSICUM_LIB} $LIBS"])
|
||||
else
|
||||
m4_default([$2], [AC_MSG_WARN([Capsicum support not found])])
|
||||
fi])
|
|
@ -1,5 +1,3 @@
|
|||
dnl SPDX-License-Identifier: GPL-3.0-or-later WITH Autoconf-exception-macro
|
||||
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
|
||||
# ===========================================================================
|
||||
|
|
81
m4/getopt.m4
81
m4/getopt.m4
|
@ -1,72 +1,71 @@
|
|||
dnl SPDX-License-Identifier: FSFULLR
|
||||
|
||||
# getopt.m4 serial 49 (modified version)
|
||||
dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc.
|
||||
# getopt.m4 serial 14 (modified version)
|
||||
dnl Copyright (C) 2002-2006, 2008 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.
|
||||
|
||||
# This version has been modified to reduce complexity since we only need
|
||||
# GNU getopt_long and do not care about replacing getopt.
|
||||
# The getopt module assume you want GNU getopt, with getopt_long etc,
|
||||
# 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
|
||||
# options with optional arguments) and the functions getopt_long,
|
||||
# getopt_long_only.
|
||||
AC_DEFUN([gl_FUNC_GETOPT_GNU],
|
||||
AC_DEFUN([gl_GETOPT_SUBSTITUTE],
|
||||
[
|
||||
AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
|
||||
AC_LIBOBJ([getopt])
|
||||
AC_LIBOBJ([getopt1])
|
||||
gl_GETOPT_SUBSTITUTE_HEADER
|
||||
])
|
||||
|
||||
if test -n "$gl_replace_getopt"; then
|
||||
gl_GETOPT_SUBSTITUTE
|
||||
fi
|
||||
AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
|
||||
[
|
||||
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],
|
||||
[
|
||||
gl_replace_getopt=
|
||||
|
||||
if test -z "$gl_replace_getopt"; then
|
||||
AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes])
|
||||
if test -z "$GETOPT_H"; then
|
||||
AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
|
||||
fi
|
||||
|
||||
if test -z "$gl_replace_getopt"; then
|
||||
AC_CHECK_FUNCS([getopt_long], [], [gl_replace_getopt=yes])
|
||||
if test -z "$GETOPT_H"; then
|
||||
AC_CHECK_FUNCS([getopt_long], [], [GETOPT_H=getopt.h])
|
||||
fi
|
||||
|
||||
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 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.
|
||||
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_DEFINE([HAVE_OPTRESET], 1,
|
||||
[Define to 1 if getopt.h declares extern int optreset.])],
|
||||
[], [#include <getopt.h>])
|
||||
fi
|
||||
|
||||
dnl POSIX 2008 does not specify leading '+' behavior, but see
|
||||
dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
|
||||
dnl the next version of POSIX. We don't use that feature, so this
|
||||
dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
|
||||
dnl option string (as of 2005-05-05). We don't use that feature, so this
|
||||
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_LIBOBJ([getopt1])
|
||||
|
||||
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_REQUIRE([gl_GETOPT_CHECK_HEADERS])
|
||||
AS_IF([test -n "$GETOPT_H"], [$1], [$2])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_GETOPT], [gl_FUNC_GETOPT_GNU])
|
||||
AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])])
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
dnl SPDX-License-Identifier: FSFULLR
|
||||
|
||||
# Find a POSIX-conforming shell.
|
||||
|
||||
# Copyright (C) 2007-2008 Free Software Foundation, Inc.
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
|
@ -10,11 +7,13 @@
|
|||
#
|
||||
# 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_REQUIRE([AC_CANONICAL_HOST])
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
|
@ -20,11 +17,13 @@
|
|||
# GetSystemInfo() is used on Cygwin)
|
||||
# - 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_REQUIRE([TUKLIB_COMMON])
|
||||
|
@ -96,6 +95,7 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
|||
#ifdef __QNX__
|
||||
compile error
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
|
@ -11,14 +8,16 @@
|
|||
# Checks for tuklib_integer.h:
|
||||
# - Endianness
|
||||
# - Does the compiler or the operating system provide byte swapping macros
|
||||
# - Does the hardware support fast unaligned access to 16-bit, 32-bit,
|
||||
# and 64-bit integers
|
||||
# - Does the hardware support fast unaligned access to 16-bit
|
||||
# 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_REQUIRE([TUKLIB_COMMON])
|
||||
|
@ -65,48 +64,16 @@ main(void)
|
|||
AC_MSG_CHECKING([if unaligned memory access should be used])
|
||||
AC_ARG_ENABLE([unaligned-access], AS_HELP_STRING([--enable-unaligned-access],
|
||||
[Enable if the system supports *fast* unaligned memory access
|
||||
with 16-bit, 32-bit, and 64-bit integers. By default,
|
||||
this is enabled on x86, x86-64,
|
||||
32/64-bit big endian PowerPC,
|
||||
64-bit little endian PowerPC,
|
||||
and some ARM, ARM64, and RISC-V systems.]),
|
||||
with 16-bit and 32-bit integers. By default, this is enabled
|
||||
only on x86, x86_64, and big endian PowerPC.]),
|
||||
[], [enable_unaligned_access=auto])
|
||||
if test "x$enable_unaligned_access" = xauto ; then
|
||||
# NOTE: There might be other architectures on which unaligned access
|
||||
# is fast.
|
||||
# TODO: There may be other architectures, on which unaligned access
|
||||
# is OK.
|
||||
case $host_cpu in
|
||||
i?86|x86_64|powerpc|powerpc64|powerpc64le)
|
||||
i?86|x86_64|powerpc|powerpc64)
|
||||
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
|
||||
;;
|
||||
|
@ -114,8 +81,8 @@ int main(void) { return 0; }
|
|||
fi
|
||||
if test "x$enable_unaligned_access" = xyes ; then
|
||||
AC_DEFINE([TUKLIB_FAST_UNALIGNED_ACCESS], [1], [Define to 1 if
|
||||
the system supports fast unaligned access to 16-bit,
|
||||
32-bit, and 64-bit integers.])
|
||||
the system supports fast unaligned access to 16-bit and
|
||||
32-bit integers.])
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
|
@ -18,11 +15,13 @@
|
|||
# functions, but each function is put into a separate .c file so
|
||||
# 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_REQUIRE([TUKLIB_COMMON])
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
|
@ -32,11 +29,13 @@
|
|||
# - sysinfo() works on Linux/dietlibc and probably on other Linux
|
||||
# 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_REQUIRE([TUKLIB_COMMON])
|
||||
|
@ -89,6 +88,7 @@ main(void)
|
|||
]])], [tuklib_cv_physmem_method=sysconf], [
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
|
@ -14,16 +11,15 @@
|
|||
# This .m4 file is needed allow this module to use glibc's
|
||||
# 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_REQUIRE([TUKLIB_COMMON])
|
||||
AC_CHECK_DECL([program_invocation_name], [AC_DEFINE(
|
||||
[HAVE_PROGRAM_INVOCATION_NAME], [1],
|
||||
[Define to 1 if 'program_invocation_name' is declared in <errno.h>.])],
|
||||
[], [#include <errno.h>])
|
||||
AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
|
||||
])dnl
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
dnl SPDX-License-Identifier: FSFULLR
|
||||
|
||||
# visibility.m4 serial 8
|
||||
dnl Copyright (C) 2005, 2008, 2010-2023 Free Software Foundation, Inc.
|
||||
# visibility.m4 serial 6
|
||||
dnl Copyright (C) 2005, 2008, 2010-2020 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.
|
||||
|
@ -60,11 +58,6 @@ AC_DEFUN([gl_VISIBILITY],
|
|||
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) {}
|
||||
]],
|
||||
[[]])],
|
||||
|
|
|
@ -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
|
53
po/Makevars
53
po/Makevars
|
@ -1,10 +1,4 @@
|
|||
# SPDX-License-Identifier: FSFUL
|
||||
|
||||
# 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.
|
||||
DOMAIN = $(PACKAGE)
|
||||
|
@ -14,7 +8,7 @@ subdir = po
|
|||
top_builddir = ..
|
||||
|
||||
# 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
|
||||
# $(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
|
||||
# the public domain; in this case the translators are expected to disclaim
|
||||
# their copyright.
|
||||
COPYRIGHT_HOLDER = The XZ Utils authors and contributors
|
||||
|
||||
# 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
|
||||
COPYRIGHT_HOLDER =
|
||||
|
||||
# This is the email address or URL to which the translators shall report
|
||||
# bugs in the untranslated strings:
|
||||
|
@ -53,35 +40,7 @@ MSGID_BUGS_ADDRESS =
|
|||
# message catalogs shall be used. It is usually empty.
|
||||
EXTRA_LOCALE_CATEGORIES =
|
||||
|
||||
# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
|
||||
# context. Possible values are "yes" and "no". Set this to yes if the
|
||||
# package uses functions taking also a message context, like pgettext(), or
|
||||
# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
|
||||
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
|
||||
# Although you may need slightly wider terminal than 80 chars, it is
|
||||
# much nicer to edit the output of --help when this is set.
|
||||
XGETTEXT_OPTIONS += --no-wrap
|
||||
MSGMERGE += --no-wrap
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
# List of source files which contain translatable strings.
|
||||
src/xz/args.c
|
||||
src/xz/coder.c
|
||||
|
@ -8,10 +6,8 @@ src/xz/hardware.c
|
|||
src/xz/list.c
|
||||
src/xz/main.c
|
||||
src/xz/message.c
|
||||
src/xz/mytime.c
|
||||
src/xz/options.c
|
||||
src/xz/signals.c
|
||||
src/xz/suffix.c
|
||||
src/xz/util.c
|
||||
src/lzmainfo/lzmainfo.c
|
||||
src/common/tuklib_exit.c
|
||||
|
|
603
po/pt_BR.po
603
po/pt_BR.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
Loading…
Reference in New Issue