mirror of
https://git.tukaani.org/xz.git
synced 2025-12-25 06:48:43 +00:00
Compare commits
285 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49053c0a64 | ||
|
|
84c0cfc556 | ||
|
|
d90ed84db9 | ||
|
|
9b1268538b | ||
|
|
068ee436f4 | ||
|
|
6cdf0a7b79 | ||
|
|
33daad3961 | ||
|
|
6961a5ac7d | ||
|
|
5b9e167649 | ||
|
|
36fabdbe67 | ||
|
|
989c8c354c | ||
|
|
983f3b458d | ||
|
|
4083c8e950 | ||
|
|
661549ecb7 | ||
|
|
0e546eb4da | ||
|
|
da4d04e4d6 | ||
|
|
007558a358 | ||
|
|
7d01de67ee | ||
|
|
f8edcf3da6 | ||
|
|
1695021e4a | ||
|
|
5056bc5107 | ||
|
|
9e14743ee5 | ||
|
|
4cc91ceb39 | ||
|
|
1824a6007c | ||
|
|
8fdc71a27d | ||
|
|
38171492de | ||
|
|
1bce6fe483 | ||
|
|
dce95a593e | ||
|
|
f3c32762ae | ||
|
|
7dd57f2f2c | ||
|
|
edec253e41 | ||
|
|
46cb133ce7 | ||
|
|
4ae13cfe0d | ||
|
|
660c8c29e5 | ||
|
|
b7ce6e8078 | ||
|
|
1595f454d5 | ||
|
|
5be6275f19 | ||
|
|
e515643d75 | ||
|
|
e3478ae4f3 | ||
|
|
b71b8922ef | ||
|
|
359e5c6cb1 | ||
|
|
589b4cba22 | ||
|
|
43728ed226 | ||
|
|
caf00e0988 | ||
|
|
a70e96d2da | ||
|
|
d5275d83bd | ||
|
|
1f6e7c68fb | ||
|
|
ef71f83973 | ||
|
|
cf8ba7c3a8 | ||
|
|
4a4180ce74 | ||
|
|
4b23b84b89 | ||
|
|
773f1e8622 | ||
|
|
68bda971bb | ||
|
|
b41bb79c60 | ||
|
|
6614e6d4bf | ||
|
|
bfb623ad96 | ||
|
|
e919ebb29a | ||
|
|
c0c0cd4a48 | ||
|
|
d93fbefcc4 | ||
|
|
65981d8e45 | ||
|
|
a108ed5891 | ||
|
|
03c51c5c08 | ||
|
|
d7fa3f1b58 | ||
|
|
6a1093c000 | ||
|
|
f6f9f5651a | ||
|
|
0dd83ba876 | ||
|
|
4170a80785 | ||
|
|
0db6fbe0be | ||
|
|
84a3a1f4e4 | ||
|
|
962b3d41e0 | ||
|
|
19899340cf | ||
|
|
ef7fbe8393 | ||
|
|
e49815ba7a | ||
|
|
db5b57b827 | ||
|
|
e6ba501408 | ||
|
|
82657a1f10 | ||
|
|
fab35907d1 | ||
|
|
f530fe1964 | ||
|
|
10b3500cc2 | ||
|
|
3d14e8a34d | ||
|
|
bdcc180a2d | ||
|
|
844240350d | ||
|
|
bdc7952bcf | ||
|
|
143396e070 | ||
|
|
1b8146d64e | ||
|
|
f947ce09d7 | ||
|
|
f681301a36 | ||
|
|
8bc3146c6b | ||
|
|
c2905540ef | ||
|
|
2600d33524 | ||
|
|
98fc14541e | ||
|
|
1ac79b4cba | ||
|
|
97851be2c6 | ||
|
|
b406828a6d | ||
|
|
ef4a07ad94 | ||
|
|
64ee0caaea | ||
|
|
ba17705764 | ||
|
|
0745b900fa | ||
|
|
c972d44103 | ||
|
|
6e21f1b4e2 | ||
|
|
26c37d290c | ||
|
|
2ec65181e2 | ||
|
|
c44c7e7590 | ||
|
|
b9499c94fc | ||
|
|
1155471651 | ||
|
|
62dd1c9bf0 | ||
|
|
d04eb78ab3 | ||
|
|
12ea1fb297 | ||
|
|
a4d45c07c1 | ||
|
|
f51b7bcea6 | ||
|
|
d5b81c19a7 | ||
|
|
36860a3e30 | ||
|
|
f05641ef0d | ||
|
|
b852f6f11d | ||
|
|
fdcb78fb6f | ||
|
|
9e39cebe3c | ||
|
|
7a578d1d82 | ||
|
|
362320fea5 | ||
|
|
29c5a870be | ||
|
|
5ee5757277 | ||
|
|
dfc257bdb2 | ||
|
|
f6df4c4ab7 | ||
|
|
25da22e052 | ||
|
|
4f57a9c991 | ||
|
|
238b4e5458 | ||
|
|
0cee63c3c6 | ||
|
|
01f937ea9a | ||
|
|
e9b9ea9531 | ||
|
|
be6e39a862 | ||
|
|
9e343a46cf | ||
|
|
12321a9390 | ||
|
|
d1f0e01c39 | ||
|
|
8204c5d130 | ||
|
|
32980d1562 | ||
|
|
023907faa9 | ||
|
|
ba176d77cb | ||
|
|
c99d697df8 | ||
|
|
54a2fd8c85 | ||
|
|
622d0fdc02 | ||
|
|
3e2dc523c5 | ||
|
|
0c053f9733 | ||
|
|
915d4f6058 | ||
|
|
b848c03958 | ||
|
|
c775ba1602 | ||
|
|
0673c9ec98 | ||
|
|
6ca8046ecb | ||
|
|
ce4f246600 | ||
|
|
3634fe3307 | ||
|
|
97679d25ce | ||
|
|
01a67e89a5 | ||
|
|
5dca3f5cba | ||
|
|
ae252862b3 | ||
|
|
147d282cc3 | ||
|
|
4523a5ee29 | ||
|
|
82aacb4036 | ||
|
|
5d022c2492 | ||
|
|
8962951173 | ||
|
|
94097157fa | ||
|
|
da16d0b73b | ||
|
|
e57c74f9ef | ||
|
|
7e2fa48bb7 | ||
|
|
d42977c7ac | ||
|
|
8fc712fcf4 | ||
|
|
77d2c025d1 | ||
|
|
9af8f6f947 | ||
|
|
1c558a2692 | ||
|
|
7479a69a45 | ||
|
|
fd56d53533 | ||
|
|
d1bdaaebc6 | ||
|
|
5d351c69c1 | ||
|
|
b82d4831e3 | ||
|
|
2caba3efe3 | ||
|
|
594f904673 | ||
|
|
88101143cb | ||
|
|
4042dbf03a | ||
|
|
3971f5c502 | ||
|
|
5e61b39432 | ||
|
|
8a53533869 | ||
|
|
6d05b08b17 | ||
|
|
dfc9a54082 | ||
|
|
f6dce49cb6 | ||
|
|
173d240bb4 | ||
|
|
17797bacde | ||
|
|
37da0e7271 | ||
|
|
b8331077c6 | ||
|
|
b9a3511bb6 | ||
|
|
cd82ef2fb4 | ||
|
|
076e911ba2 | ||
|
|
bc34e5ac99 | ||
|
|
d31fbd28be | ||
|
|
701e9be6be | ||
|
|
762c4d0b62 | ||
|
|
0ce1db0223 | ||
|
|
d83da006b3 | ||
|
|
2796bb4736 | ||
|
|
ebebaa8d93 | ||
|
|
765fa2865a | ||
|
|
918e208af5 | ||
|
|
1f157d214b | ||
|
|
28757fa46d | ||
|
|
135d5a1a65 | ||
|
|
2287d56683 | ||
|
|
7124b8a16a | ||
|
|
59c7bb8931 | ||
|
|
e970c28ac3 | ||
|
|
85e01266a9 | ||
|
|
3fa0f3ba12 | ||
|
|
32dbe045d7 | ||
|
|
ccf12acbfa | ||
|
|
6a0b168dd9 | ||
|
|
84ce36f90e | ||
|
|
d662077468 | ||
|
|
880adb5aa2 | ||
|
|
b5b1b1f061 | ||
|
|
e904e778b8 | ||
|
|
e9c47e79c9 | ||
|
|
99575947a5 | ||
|
|
76dec92fcc | ||
|
|
bd213d06eb | ||
|
|
257dbff0ba | ||
|
|
720ad4a442 | ||
|
|
88dc191634 | ||
|
|
039e0ab13e | ||
|
|
718f7a60e7 | ||
|
|
3ccedb0972 | ||
|
|
09fbd2f052 | ||
|
|
683d3f178e | ||
|
|
2b8062ef94 | ||
|
|
b16b9c0d22 | ||
|
|
c47ecd6d39 | ||
|
|
34e13ce015 | ||
|
|
6671d0fe46 | ||
|
|
d3e833ca1d | ||
|
|
977dd2e26b | ||
|
|
c55157ed74 | ||
|
|
18b845e697 | ||
|
|
4080bbb844 | ||
|
|
674c89fdb8 | ||
|
|
2a6b938084 | ||
|
|
aea639e81b | ||
|
|
e3b42bfcb0 | ||
|
|
21625b7e11 | ||
|
|
c337983e92 | ||
|
|
b7fb438ea0 | ||
|
|
68e9ef036d | ||
|
|
a387707cd8 | ||
|
|
52902ad695 | ||
|
|
e81b9fc48c | ||
|
|
6e89ab58b0 | ||
|
|
65c59ad429 | ||
|
|
43521e77ac | ||
|
|
6b44cead95 | ||
|
|
1bbefa9659 | ||
|
|
ce3a3fbc7c | ||
|
|
99fcd57f2e | ||
|
|
c0c13d9d82 | ||
|
|
3d45987451 | ||
|
|
706bce5018 | ||
|
|
e96dee55df | ||
|
|
52bc1ee34d | ||
|
|
bad44cfe19 | ||
|
|
692ccdf551 | ||
|
|
2ac7bafc8f | ||
|
|
db714d30e0 | ||
|
|
39d2585dcd | ||
|
|
3f0130aa28 | ||
|
|
f204d1050a | ||
|
|
34a9c2d650 | ||
|
|
761c208d58 | ||
|
|
8a7cbc0745 | ||
|
|
ca2af49bb8 | ||
|
|
bfba3394ae | ||
|
|
507648ad11 | ||
|
|
ab5229d32a | ||
|
|
8791826f31 | ||
|
|
c410d812ea | ||
|
|
501c6013d4 | ||
|
|
9e3cb514b5 | ||
|
|
6fc3e54679 | ||
|
|
e84f2ab7f8 | ||
|
|
b14b8dbba9 | ||
|
|
09a114805e | ||
|
|
d3e6fe4419 | ||
|
|
b55a27b46f | ||
|
|
2fd28d2b7c |
30
.codespellrc
30
.codespellrc
@ -1,30 +0,0 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
[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.
|
|
||||||
# THANKS contains names, some do trigger codespell.
|
|
||||||
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,THANKS
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# Ignore a URL with debbugs.
|
|
||||||
ignore-regex = \bhttps://debbugs\.gnu\.org\b
|
|
||||||
8
.gitattributes
vendored
8
.gitattributes
vendored
@ -1,8 +0,0 @@
|
|||||||
.gitattributes export-ignore
|
|
||||||
.gitignore export-ignore
|
|
||||||
|
|
||||||
/.codespellrc export-ignore
|
|
||||||
/.github export-ignore
|
|
||||||
|
|
||||||
/build-aux/ci_build.bash export-ignore
|
|
||||||
/doc/SHA256SUMS export-ignore
|
|
||||||
171
.github/workflows/ci.yml
vendored
171
.github/workflows/ci.yml
vendored
@ -1,171 +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:
|
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
POSIX:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
|
|
||||||
build_system: [autotools, cmake]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
timeout-minutes: 20
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
########################
|
|
||||||
# Install Dependencies #
|
|
||||||
########################
|
|
||||||
|
|
||||||
# Install Autotools on Linux
|
|
||||||
- name: Install Dependencies
|
|
||||||
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.build_system == 'autotools' }}
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y autoconf automake build-essential po4a autopoint doxygen musl-tools valgrind
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
|
||||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y gcc-multilib
|
|
||||||
|
|
||||||
# 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: ${{ startsWith(matrix.os, 'ubuntu') && matrix.build_system == 'cmake' }}
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y build-essential cmake gettext doxygen musl-tools
|
|
||||||
|
|
||||||
# Install CMake on Mac
|
|
||||||
- name: Install Dependencies
|
|
||||||
if: ${{ matrix.os == 'macos-latest' && matrix.build_system == 'cmake' }}
|
|
||||||
run: brew install cmake gettext doxygen
|
|
||||||
|
|
||||||
##################
|
|
||||||
# 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.bash -b autotools -p build -m "gcc -m32"
|
|
||||||
- name: Test 32-bit
|
|
||||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
|
||||||
run: |
|
|
||||||
./build-aux/ci_build.bash -b autotools -p test -m "gcc -m32" -n 32_bit
|
|
||||||
cd ../xz_build && make distclean
|
|
||||||
|
|
||||||
# The sandbox must 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: ${{ startsWith(matrix.os, 'ubuntu') && matrix.build_system == 'autotools' }}
|
|
||||||
run: ./build-aux/ci_build.bash -b autotools -p build -f "-fsanitize=address,undefined" -d sandbox
|
|
||||||
- name: Test with -fsanitize=address,undefined
|
|
||||||
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.build_system == 'autotools' }}
|
|
||||||
run: |
|
|
||||||
export UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1
|
|
||||||
./build-aux/ci_build.bash -b autotools -p test -f "-fsanitize=address,undefined" -d sandbox
|
|
||||||
cd ../xz_build && make distclean
|
|
||||||
|
|
||||||
- name: Build with Valgrind
|
|
||||||
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.build_system == 'autotools' }}
|
|
||||||
run: ./build-aux/ci_build.bash -b autotools -p build -d shared,sandbox
|
|
||||||
- name: Test with Valgrind
|
|
||||||
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.build_system == 'autotools' }}
|
|
||||||
run: |
|
|
||||||
./build-aux/ci_build.bash -b autotools -p test -d sandbox -w "valgrind --quiet --trace-children=yes --trace-children-skip=*/cmp,*/cp,*/diff,*/grep,*/rm,*/sed --exit-on-first-error=yes --error-exitcode=1"
|
|
||||||
cd ../xz_build && make distclean
|
|
||||||
|
|
||||||
- name: Build with musl libc
|
|
||||||
if: ${{ startsWith(matrix.os, 'ubuntu') }}
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p build -m "/usr/bin/musl-gcc"
|
|
||||||
- name: Test with musl libc
|
|
||||||
if: ${{ startsWith(matrix.os, 'ubuntu') }}
|
|
||||||
run: |
|
|
||||||
./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p test -m "/usr/bin/musl-gcc"
|
|
||||||
- name: Clean up musl libc run
|
|
||||||
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.build_system == 'autotools' }}
|
|
||||||
run: cd ../xz_build && make distclean
|
|
||||||
|
|
||||||
- name: Build with full features
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p build
|
|
||||||
- name: Test with full features
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p test -n full_features
|
|
||||||
|
|
||||||
- name: Build without encoders
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d encoders,shared -p build
|
|
||||||
- name: Test without encoders
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d encoders,shared -p test -n no_encoders
|
|
||||||
|
|
||||||
- name: Build without decoders
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d decoders,shared -p build
|
|
||||||
- name: Test without decoders
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d decoders,shared -p test -n no_decoders
|
|
||||||
|
|
||||||
- name: Build without threads
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d threads,shared -p build
|
|
||||||
- name: Test without threads
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d threads,shared -p test -n no_threads
|
|
||||||
|
|
||||||
- name: Build without BCJ filters
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d bcj,shared,nls -p build
|
|
||||||
- name: Test without BCJ filters
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d bcj,shared,nls -p test -n no_bcj
|
|
||||||
|
|
||||||
- name: Build without Delta filters
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d delta,shared,nls -p build
|
|
||||||
- name: Test without Delta filters
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d delta,shared,nls -p test -n no_delta
|
|
||||||
|
|
||||||
- name: Build without sha256 check
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -c crc32,crc64 -d shared,nls -p build
|
|
||||||
- name: Test without sha256 check
|
|
||||||
run: ./build-aux/ci_build.bash -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.bash -b ${{ matrix.build_system }} -c crc32,sha256 -d shared,nls -p build
|
|
||||||
- name: Test without crc64 check
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -c crc32,sha256 -d shared,nls -p test -n no_crc64
|
|
||||||
|
|
||||||
- name: Build small
|
|
||||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d small -p build
|
|
||||||
- name: Test small
|
|
||||||
run: ./build-aux/ci_build.bash -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@v4
|
|
||||||
if: ${{ failure() }}
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.os }} ${{ matrix.build_system }} Test Logs
|
|
||||||
path: build-aux/artifacts
|
|
||||||
55
.github/workflows/cifuzz.yml
vendored
55
.github/workflows/cifuzz.yml
vendored
@ -1,55 +0,0 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
# Authors: Sam James
|
|
||||||
# Lasse Collin
|
|
||||||
#
|
|
||||||
# This was written based on the OSS-Fuzz docs:
|
|
||||||
# https://google.github.io/oss-fuzz/getting-started/continuous-integration/
|
|
||||||
|
|
||||||
name: CIFuzz
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
CIFuzz:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 30
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
sanitizer: [ address, undefined, memory ]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Build Fuzzers (${{ matrix.sanitizer }})
|
|
||||||
id: build
|
|
||||||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
|
||||||
with:
|
|
||||||
oss-fuzz-project-name: 'xz'
|
|
||||||
# The language must match the one in project.yaml in OSS-Fuzz:
|
|
||||||
# https://github.com/google/oss-fuzz/blob/master/projects/xz/project.yaml
|
|
||||||
# Thus, use C++ even though there are no C++ files in XZ Utils.
|
|
||||||
language: c++
|
|
||||||
sanitizer: ${{ matrix.sanitizer }}
|
|
||||||
|
|
||||||
- name: Run Fuzzers (${{ matrix.sanitizer }})
|
|
||||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
|
||||||
with:
|
|
||||||
oss-fuzz-project-name: 'xz'
|
|
||||||
language: c++
|
|
||||||
sanitizer: ${{ matrix.sanitizer }}
|
|
||||||
fuzz-seconds: 600
|
|
||||||
report-timeouts: true
|
|
||||||
report-ooms: true
|
|
||||||
|
|
||||||
- name: Upload Crash
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
if: failure() && steps.build.outcome == 'success'
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.sanitizer }}-artifacts
|
|
||||||
path: ./out/artifacts
|
|
||||||
38
.github/workflows/coverity.yml
vendored
38
.github/workflows/coverity.yml
vendored
@ -1,38 +0,0 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
name: Coverity Scan
|
|
||||||
|
|
||||||
# We only want to test a special branch, per
|
|
||||||
# https://docs.travis-ci.com/user/coverity-scan/#build-submission-frequency
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [coverity_scan]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
coverity:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt-get update -q
|
|
||||||
sudo apt-get install -qy autoconf automake build-essential autopoint gcc-multilib
|
|
||||||
|
|
||||||
- name: Run autogen.sh
|
|
||||||
run: ./autogen.sh --no-po4a
|
|
||||||
|
|
||||||
- name: Run configure
|
|
||||||
run: ./configure --enable-debug --disable-silent-rules
|
|
||||||
|
|
||||||
# Coverity doesn't understand what the inline asm does,
|
|
||||||
# which results in false positives.
|
|
||||||
- name: Disable complex inline assembly code
|
|
||||||
run: echo '#define LZMA_RANGE_DECODER_CONFIG 0' >> config.h
|
|
||||||
|
|
||||||
- name: Coverity Scan
|
|
||||||
uses: vapier/coverity-scan-action@2068473c7bdf8c2fb984a6a40ae76ee7facd7a85 # v1.8.0
|
|
||||||
with:
|
|
||||||
command: make -Oline -j$(nproc)
|
|
||||||
email: ${{ secrets.COVERITY_SCAN_EMAIL }}
|
|
||||||
token: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
|
||||||
40
.github/workflows/dragonflybsd.yml
vendored
40
.github/workflows/dragonflybsd.yml
vendored
@ -1,40 +0,0 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
name: DragonFly BSD
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
DragonflyBSD:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
name: DragonFly BSD
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Test in DragonFly BSD
|
|
||||||
id: test
|
|
||||||
uses: vmactions/dragonflybsd-vm@4ffb90652b45abc8156f89ede453c85f7ea257bb #v1.1.4
|
|
||||||
with:
|
|
||||||
usesh: true
|
|
||||||
prepare: >
|
|
||||||
pkg install -y
|
|
||||||
autoconf
|
|
||||||
automake
|
|
||||||
gettext-tools
|
|
||||||
libtool
|
|
||||||
m4
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
uname -a
|
|
||||||
./autogen.sh --no-po4a
|
|
||||||
# Innocent putc() triggers strict-overflow warnings.
|
|
||||||
./configure --disable-static --enable-debug --enable-werror CFLAGS='-g -O2 -pipe -Wno-error=strict-overflow'
|
|
||||||
make -j4 check
|
|
||||||
58
.github/workflows/freebsd.yml
vendored
58
.github/workflows/freebsd.yml
vendored
@ -1,58 +0,0 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
name: FreeBSD
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
FreeBSD:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- host: ubuntu-latest
|
|
||||||
version: 12.4
|
|
||||||
arch: x86_64
|
|
||||||
- host: ubuntu-latest
|
|
||||||
version: 15.0
|
|
||||||
arch: x86_64
|
|
||||||
# NOTE: Comment in the repo says that aarch64 VM is faster
|
|
||||||
# on x86_64 host compared to ubuntu-24.04-arm.
|
|
||||||
# - host: ubuntu-24.04-arm
|
|
||||||
# version: 15.0
|
|
||||||
# arch: aarch64
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.host }}
|
|
||||||
timeout-minutes: 10
|
|
||||||
|
|
||||||
name: FreeBSD
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Test in FreeBSD
|
|
||||||
uses: vmactions/freebsd-vm@670398e4236735b8b65805c3da44b7a511fb8b27 #v1.3.0
|
|
||||||
with:
|
|
||||||
release: ${{ matrix.release }}
|
|
||||||
arch: ${{ matrix.arch }}
|
|
||||||
usesh: true
|
|
||||||
prepare: >
|
|
||||||
pkg install -y
|
|
||||||
autoconf
|
|
||||||
automake
|
|
||||||
gettext-tools
|
|
||||||
libtool
|
|
||||||
m4
|
|
||||||
po4a
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
uname -a
|
|
||||||
./autogen.sh
|
|
||||||
./configure --disable-static --enable-debug --enable-werror
|
|
||||||
make -j4 check
|
|
||||||
138
.github/workflows/msvc.yml
vendored
138
.github/workflows/msvc.yml
vendored
@ -1,138 +0,0 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
# Author: Lasse Collin
|
|
||||||
|
|
||||||
name: Windows-MSVC
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
MSVC:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ windows-latest ]
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
timeout-minutes: 10
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Configure Win32
|
|
||||||
run: >
|
|
||||||
cmake
|
|
||||||
-A Win32
|
|
||||||
-B build-msvc-win32
|
|
||||||
|
|
||||||
- name: Build Win32 Debug
|
|
||||||
run: >
|
|
||||||
cmake
|
|
||||||
--build build-msvc-win32
|
|
||||||
--config Debug
|
|
||||||
|
|
||||||
- name: Test Win32 Debug
|
|
||||||
run: >
|
|
||||||
ctest
|
|
||||||
--test-dir build-msvc-win32
|
|
||||||
--build-config Debug
|
|
||||||
--output-on-failure
|
|
||||||
|
|
||||||
- name: Build Win32 Release
|
|
||||||
run: >
|
|
||||||
cmake
|
|
||||||
--build build-msvc-win32
|
|
||||||
--config Release
|
|
||||||
|
|
||||||
# This fails with VS 2019 without b5a5d9e3f702.
|
|
||||||
- name: Test Win32 Release
|
|
||||||
run: >
|
|
||||||
ctest
|
|
||||||
--test-dir build-msvc-win32
|
|
||||||
--build-config Release
|
|
||||||
--output-on-failure
|
|
||||||
|
|
||||||
- name: Configure x64
|
|
||||||
run: >
|
|
||||||
cmake
|
|
||||||
-A x64
|
|
||||||
-B build-msvc-x64
|
|
||||||
|
|
||||||
- name: Build x64 Debug
|
|
||||||
run: >
|
|
||||||
cmake
|
|
||||||
--build build-msvc-x64
|
|
||||||
--config Debug
|
|
||||||
|
|
||||||
- name: Test x64 Debug
|
|
||||||
run: >
|
|
||||||
ctest
|
|
||||||
--test-dir build-msvc-x64
|
|
||||||
--build-config Debug
|
|
||||||
--output-on-failure
|
|
||||||
|
|
||||||
- name: Build x64 Release
|
|
||||||
run: >
|
|
||||||
cmake
|
|
||||||
--build build-msvc-x64
|
|
||||||
--config Release
|
|
||||||
|
|
||||||
- name: Test x64 Release
|
|
||||||
run: >
|
|
||||||
ctest
|
|
||||||
--test-dir build-msvc-x64
|
|
||||||
--build-config Release
|
|
||||||
--output-on-failure
|
|
||||||
|
|
||||||
- name: Configure ClangCL x64
|
|
||||||
run: >
|
|
||||||
cmake
|
|
||||||
-T ClangCL
|
|
||||||
-A x64
|
|
||||||
-B build-clangcl-x64
|
|
||||||
-DCMAKE_C_FLAGS="
|
|
||||||
-Wno-cast-align
|
|
||||||
-Wno-cast-qual
|
|
||||||
-Wno-covered-switch-default
|
|
||||||
-Wno-declaration-after-statement
|
|
||||||
-Wno-deprecated-declarations
|
|
||||||
-Wno-disabled-macro-expansion
|
|
||||||
-Wno-nonportable-system-include-path
|
|
||||||
-Wno-overlength-strings
|
|
||||||
-Wno-pre-c11-compat
|
|
||||||
-Wno-reserved-identifier
|
|
||||||
-Wno-unsafe-buffer-usage
|
|
||||||
-Wno-used-but-marked-unused"
|
|
||||||
|
|
||||||
- name: Build ClangCL x64 Debug
|
|
||||||
run: >
|
|
||||||
cmake
|
|
||||||
--build build-clangcl-x64
|
|
||||||
--config Debug
|
|
||||||
|
|
||||||
- name: Test ClangCL x64 Debug
|
|
||||||
run: >
|
|
||||||
ctest
|
|
||||||
--test-dir build-clangcl-x64
|
|
||||||
--build-config Debug
|
|
||||||
--output-on-failure
|
|
||||||
|
|
||||||
- name: Build ClangCL x64 Release
|
|
||||||
run: >
|
|
||||||
cmake
|
|
||||||
--build build-clangcl-x64
|
|
||||||
--config Release
|
|
||||||
|
|
||||||
- name: Test ClangCL x64 Release
|
|
||||||
run: >
|
|
||||||
ctest
|
|
||||||
--test-dir build-clangcl-x64
|
|
||||||
--build-config Release
|
|
||||||
--output-on-failure
|
|
||||||
148
.github/workflows/msys2.yml
vendored
148
.github/workflows/msys2.yml
vendored
@ -1,148 +0,0 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Authors: Jia Tan
|
|
||||||
# Lasse Collin
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
|
|
||||||
name: Windows-MSYS2
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
MSYS2:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
runner: [ windows-latest ]
|
|
||||||
sys: [ mingw32, ucrt64, clang64, msys ]
|
|
||||||
include:
|
|
||||||
- runner: windows-11-arm
|
|
||||||
sys: clangarm64
|
|
||||||
|
|
||||||
# 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: ${{ matrix.runner }}
|
|
||||||
timeout-minutes: 20
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Setup MSYS2
|
|
||||||
if: ${{ matrix.sys == 'msys' }}
|
|
||||||
uses: msys2/setup-msys2@fb197b72ce45fb24f17bf3f807a388985654d1f2 # v2.29.0
|
|
||||||
with:
|
|
||||||
msystem: ${{ matrix.sys }}
|
|
||||||
update: true
|
|
||||||
install: >
|
|
||||||
make
|
|
||||||
ninja
|
|
||||||
autotools
|
|
||||||
cmake
|
|
||||||
base-devel
|
|
||||||
gettext-devel
|
|
||||||
gcc
|
|
||||||
|
|
||||||
- name: Setup MSYS2
|
|
||||||
if: ${{ matrix.sys != 'msys' }}
|
|
||||||
uses: msys2/setup-msys2@fb197b72ce45fb24f17bf3f807a388985654d1f2 # v2.29.0
|
|
||||||
with:
|
|
||||||
msystem: ${{ matrix.sys }}
|
|
||||||
update: true
|
|
||||||
pacboy: >
|
|
||||||
make:p
|
|
||||||
ninja:p
|
|
||||||
autotools:p
|
|
||||||
cmake:p
|
|
||||||
toolchain:p
|
|
||||||
gettext:p
|
|
||||||
|
|
||||||
- name: Git configuration
|
|
||||||
# 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@v4
|
|
||||||
|
|
||||||
- name: CMake (full, shared)
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
cmake -G Ninja -B b-cmake-full \
|
|
||||||
-DBUILD_SHARED_LIBS=ON \
|
|
||||||
-DCMAKE_C_FLAGS='-UNDEBUG -g -O2 -pipe' \
|
|
||||||
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
|
|
||||||
${{ startsWith(matrix.sys, 'mingw') && '-DXZ_NLS=OFF' || '' }}
|
|
||||||
ninja -C b-cmake-full
|
|
||||||
ctest --test-dir b-cmake-full --output-on-failure
|
|
||||||
|
|
||||||
- name: CMake (small, static)
|
|
||||||
if: ${{ matrix.runner == 'windows-latest' }}
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
cmake -G Ninja -B b-cmake-small \
|
|
||||||
-DBUILD_SHARED_LIBS=OFF \
|
|
||||||
-DCMAKE_C_FLAGS='-UNDEBUG -g -Os -pipe' \
|
|
||||||
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
|
|
||||||
-DXZ_SMALL=ON \
|
|
||||||
-DXZ_THREADS=no \
|
|
||||||
-DXZ_NLS=OFF
|
|
||||||
ninja -C b-cmake-small
|
|
||||||
ctest --test-dir b-cmake-small --output-on-failure
|
|
||||||
|
|
||||||
- name: autogen.sh
|
|
||||||
run: ./autogen.sh --no-po4a
|
|
||||||
|
|
||||||
- name: Autotools (full, shared)
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
mkdir b-autotools-full
|
|
||||||
cd b-autotools-full
|
|
||||||
../configure \
|
|
||||||
--enable-debug \
|
|
||||||
--enable-werror \
|
|
||||||
--disable-static \
|
|
||||||
${{ startsWith(matrix.sys, 'mingw') && '--disable-nls' || '' }}
|
|
||||||
make -j"$(nproc)" check
|
|
||||||
|
|
||||||
- name: Autotools (small, static)
|
|
||||||
if: ${{ matrix.runner == 'windows-latest' }}
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
mkdir b-autotools-small
|
|
||||||
cd b-autotools-small
|
|
||||||
../configure \
|
|
||||||
--enable-debug \
|
|
||||||
--enable-werror \
|
|
||||||
--disable-shared \
|
|
||||||
--enable-small \
|
|
||||||
--disable-threads \
|
|
||||||
--disable-nls \
|
|
||||||
CFLAGS='-g -Os'
|
|
||||||
make -j"$(nproc)" check
|
|
||||||
|
|
||||||
# Upload the test logs as artifacts if any step has failed.
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
name: test-logs-${{ matrix.sys }}
|
|
||||||
path: |
|
|
||||||
b-cmake-*/Testing/Temporary/
|
|
||||||
b-cmake-*/test_*/
|
|
||||||
b-autotools-*/tests/*.log
|
|
||||||
b-autotools-*/tests/*output
|
|
||||||
40
.github/workflows/netbsd.yml
vendored
40
.github/workflows/netbsd.yml
vendored
@ -1,40 +0,0 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
name: NetBSD
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
NetBSD:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
name: NetBSD
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Test in NetBSD
|
|
||||||
id: test
|
|
||||||
uses: vmactions/netbsd-vm@b24ed5f7a605362ab1226e73df291c8b01990c85 #v1.2.3
|
|
||||||
with:
|
|
||||||
usesh: true
|
|
||||||
prepare: >
|
|
||||||
/usr/sbin/pkg_add -v
|
|
||||||
cmake
|
|
||||||
gettext-tools
|
|
||||||
ninja-build
|
|
||||||
po4a
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
uname -a
|
|
||||||
./po4a/update-po
|
|
||||||
# Innocent putc() triggers strict-overflow warnings.
|
|
||||||
cmake -G Ninja -B build -DBUILD_SHARED_LIBS=ON -DCMAKE_C_FLAGS='-UNDEBUG -g -O2 -pipe -Wno-error=strict-overflow' -DCMAKE_COMPILE_WARNING_AS_ERROR=ON
|
|
||||||
ninja -C build
|
|
||||||
ctest --test-dir build --output-on-failure
|
|
||||||
40
.github/workflows/openbsd.yml
vendored
40
.github/workflows/openbsd.yml
vendored
@ -1,40 +0,0 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
name: OpenBSD
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
OpenBSD:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
name: OpenBSD
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Test in OpenBSD
|
|
||||||
uses: vmactions/openbsd-vm@2e29de1eb150dfe1c9c97b84ff2b7896f14ca690 #v1.2.5
|
|
||||||
with:
|
|
||||||
usesh: true
|
|
||||||
prepare: >
|
|
||||||
/usr/sbin/pkg_add -I -v
|
|
||||||
autoconf-2.72p0
|
|
||||||
automake-1.17
|
|
||||||
gettext-tools
|
|
||||||
libtool
|
|
||||||
m4
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
export AUTOCONF_VERSION=2.72
|
|
||||||
export AUTOMAKE_VERSION=1.17
|
|
||||||
uname -a
|
|
||||||
./autogen.sh --no-po4a
|
|
||||||
./configure --disable-static --enable-debug --enable-werror --disable-nls --enable-external-sha256
|
|
||||||
make -j4 check
|
|
||||||
34
.github/workflows/solaris.yml
vendored
34
.github/workflows/solaris.yml
vendored
@ -1,34 +0,0 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
name: Solaris
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
Solaris:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
name: Solaris
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Test in Solaris
|
|
||||||
uses: vmactions/solaris-vm@47bea106d03acaf91084e52548ee460556011602 #v1.1.8
|
|
||||||
with:
|
|
||||||
release: 11.4-gcc
|
|
||||||
usesh: true
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
uname -a
|
|
||||||
# /usr/xpg4/bin isn't in PATH by default.
|
|
||||||
echo "Environment variable PATH: $PATH"
|
|
||||||
./autogen.sh --no-po4a
|
|
||||||
./configure --disable-static --enable-debug --enable-werror
|
|
||||||
make check
|
|
||||||
27
.gitignore
vendored
27
.gitignore
vendored
@ -15,6 +15,7 @@ Makefile.in
|
|||||||
|
|
||||||
/ABOUT-NLS
|
/ABOUT-NLS
|
||||||
/autom4te.cache
|
/autom4te.cache
|
||||||
|
/Doxyfile
|
||||||
/aclocal.m4
|
/aclocal.m4
|
||||||
/config.h
|
/config.h
|
||||||
/config.h.in
|
/config.h.in
|
||||||
@ -24,7 +25,6 @@ Makefile.in
|
|||||||
/libtool
|
/libtool
|
||||||
/stamp-h1
|
/stamp-h1
|
||||||
|
|
||||||
build-aux/artifacts
|
|
||||||
build-aux/compile
|
build-aux/compile
|
||||||
build-aux/config.guess
|
build-aux/config.guess
|
||||||
build-aux/config.rpath
|
build-aux/config.rpath
|
||||||
@ -40,10 +40,6 @@ coverage
|
|||||||
/doc/internal
|
/doc/internal
|
||||||
/doc/api
|
/doc/api
|
||||||
|
|
||||||
/po4a/man
|
|
||||||
/po4a/xz-man.pot
|
|
||||||
/po4a/*.po.authors
|
|
||||||
|
|
||||||
/src/liblzma/liblzma.pc
|
/src/liblzma/liblzma.pc
|
||||||
/src/lzmainfo/lzmainfo
|
/src/lzmainfo/lzmainfo
|
||||||
/src/xz/xz
|
/src/xz/xz
|
||||||
@ -70,7 +66,6 @@ coverage
|
|||||||
/tests/test_index
|
/tests/test_index
|
||||||
/tests/test_index_hash
|
/tests/test_index_hash
|
||||||
/tests/test_lzip_decoder
|
/tests/test_lzip_decoder
|
||||||
/tests/test_microlzma
|
|
||||||
/tests/test_memlimit
|
/tests/test_memlimit
|
||||||
/tests/test_stream_flags
|
/tests/test_stream_flags
|
||||||
/tests/test_vli
|
/tests/test_vli
|
||||||
@ -97,17 +92,21 @@ coverage
|
|||||||
/DartConfiguration.tcl
|
/DartConfiguration.tcl
|
||||||
/liblzma-config-version.cmake
|
/liblzma-config-version.cmake
|
||||||
/liblzma-config.cmake
|
/liblzma-config.cmake
|
||||||
|
/lzcat
|
||||||
|
/lzcat.1
|
||||||
|
/lzma
|
||||||
|
/lzma.1
|
||||||
/Testing
|
/Testing
|
||||||
/tests_bin/
|
/tests_bin/
|
||||||
|
/unlzma
|
||||||
|
/unlzma.1
|
||||||
|
/unxz
|
||||||
|
/unxz.1
|
||||||
/xz
|
/xz
|
||||||
|
/xzcat
|
||||||
|
/xzcat.1
|
||||||
/xzdec
|
/xzdec
|
||||||
/lzmadec
|
|
||||||
/lzmainfo
|
|
||||||
/xzdiff
|
|
||||||
/xzgrep
|
|
||||||
/xzless
|
|
||||||
/xzmore
|
|
||||||
/liblzma.pc
|
|
||||||
/*.gmo
|
|
||||||
|
|
||||||
|
/windows/*/.vs
|
||||||
|
/windows/*/liblzma.vcxproj.user
|
||||||
/.vscode/
|
/.vscode/
|
||||||
|
|||||||
49
AUTHORS
49
AUTHORS
@ -2,20 +2,22 @@
|
|||||||
Authors of XZ Utils
|
Authors of XZ Utils
|
||||||
===================
|
===================
|
||||||
|
|
||||||
XZ Utils is developed and maintained by
|
XZ Utils is developed and maintained by Lasse Collin
|
||||||
Lasse Collin <lasse.collin@tukaani.org>.
|
<lasse.collin@tukaani.org> and Jia Tan <jiat0218@gmail.com>.
|
||||||
|
|
||||||
Major parts of liblzma are based on code written by Igor Pavlov,
|
Major parts of liblzma are based on code written by Igor Pavlov,
|
||||||
specifically the LZMA SDK <https://7-zip.org/sdk.html>. Without
|
specifically the LZMA SDK <https://7-zip.org/sdk.html>. Without
|
||||||
this code, XZ Utils wouldn't exist.
|
this code, XZ Utils wouldn't exist.
|
||||||
|
|
||||||
The SHA-256 implementation in liblzma is based on code written by
|
The SHA-256 implementation in liblzma is based on the code found from
|
||||||
Wei Dai in Crypto++ Library <https://www.cryptopp.com/>.
|
7-Zip <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
|
Some scripts have been adapted from gzip. The original versions
|
||||||
versions were written by Jean-loup Gailly, Charles Levert, and
|
were written by Jean-loup Gailly, Charles Levert, and Paul Eggert.
|
||||||
Paul Eggert. Andrew Dudman helped adapting the scripts and their
|
Andrew Dudman helped adapting the scripts and their man pages for
|
||||||
man pages for XZ Utils.
|
XZ Utils.
|
||||||
|
|
||||||
The initial version of the threaded .xz decompressor was written
|
The initial version of the threaded .xz decompressor was written
|
||||||
by Sebastian Andrzej Siewior.
|
by Sebastian Andrzej Siewior.
|
||||||
@ -23,36 +25,15 @@ Authors of XZ Utils
|
|||||||
The initial version of the .lz (lzip) decoder was written
|
The initial version of the .lz (lzip) decoder was written
|
||||||
by Michał Górny.
|
by Michał Górny.
|
||||||
|
|
||||||
Architecture-specific CRC optimizations were contributed by
|
CLMUL-accelerated CRC code was contributed by Ilya Kurdyukov.
|
||||||
Ilya Kurdyukov, Chenxi Mao, and Xi Ruoyao.
|
|
||||||
|
|
||||||
Other authors:
|
Other authors:
|
||||||
- Jonathan Nieder
|
- Jonathan Nieder
|
||||||
- Joachim Henke
|
- Joachim Henke
|
||||||
|
|
||||||
Special author: Jia Tan was a co-maintainer in 2022-2024. He and
|
The GNU Autotools-based build system contains files from many authors,
|
||||||
the team behind him inserted a backdoor (CVE-2024-3094) into
|
which I'm not trying to list here.
|
||||||
XZ Utils 5.6.0 and 5.6.1 releases. He suddenly disappeared when
|
|
||||||
this was discovered.
|
|
||||||
|
|
||||||
Many people have contributed improvements or reported bugs.
|
Several people have contributed fixes or reported bugs. Most of them
|
||||||
Most of these people are mentioned in the file THANKS.
|
are mentioned in the file THANKS.
|
||||||
|
|
||||||
The translations of the command line tools and man pages have been
|
|
||||||
contributed by many people via the Translation Project:
|
|
||||||
|
|
||||||
- https://translationproject.org/domain/xz.html
|
|
||||||
- https://translationproject.org/domain/xz-man.html
|
|
||||||
|
|
||||||
The authors of the translated man pages are in the header comments
|
|
||||||
of the man page files. In the source package, the authors of the
|
|
||||||
translations are in po/*.po and po4a/*.po files.
|
|
||||||
|
|
||||||
Third-party code whose authors aren't listed here:
|
|
||||||
|
|
||||||
- GNU getopt_long() in the 'lib' directory is included for
|
|
||||||
platforms that don't have a usable getopt_long().
|
|
||||||
|
|
||||||
- The build system files from GNU Autoconf, GNU Automake,
|
|
||||||
GNU Libtool, GNU Gettext, Autoconf Archive, and related files.
|
|
||||||
|
|
||||||
|
|||||||
1917
CMakeLists.txt
1917
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
86
COPYING
86
COPYING
@ -3,68 +3,74 @@ XZ Utils Licensing
|
|||||||
==================
|
==================
|
||||||
|
|
||||||
Different licenses apply to different files in this package. Here
|
Different licenses apply to different files in this package. Here
|
||||||
is a summary of which licenses apply to which parts of this package:
|
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
|
- xz, xzdec, and lzmadec command line tools are in the public
|
||||||
under 0BSD except that, on systems that don't have a usable
|
domain unless GNU getopt_long had to be compiled and linked
|
||||||
getopt_long, GNU getopt_long is compiled and linked in from the
|
in from the lib directory. The getopt_long code is under
|
||||||
'lib' directory. The getopt_long code is under GNU LGPLv2.1+.
|
GNU LGPLv2.1+.
|
||||||
|
|
||||||
- The scripts to grep, diff, and view compressed files have been
|
- The scripts to grep, diff, and view compressed files have been
|
||||||
adapted from GNU gzip. These scripts (xzgrep, xzdiff, xzless,
|
adapted from gzip. These scripts and their documentation are
|
||||||
and xzmore) are under GNU GPLv2+. The man pages of the scripts
|
under GNU GPLv2+.
|
||||||
are under 0BSD; they aren't based on the man pages of GNU gzip.
|
|
||||||
|
|
||||||
- Most of the XZ Utils specific documentation that is in
|
- All the documentation in the doc directory and most of the
|
||||||
plain text files (like README, INSTALL, PACKAGERS, NEWS,
|
XZ Utils specific documentation files in other directories
|
||||||
and ChangeLog) are under 0BSD unless stated otherwise in
|
are in the public domain.
|
||||||
the file itself. The files xz-file-format.txt and
|
|
||||||
lzma-file-format.xt are in the public domain but may
|
|
||||||
be distributed under the terms of 0BSD too.
|
|
||||||
|
|
||||||
- Translated messages and man pages are under 0BSD except that
|
Note: The JavaScript files (under the MIT license) have
|
||||||
some old translations are in the public domain.
|
been removed from the Doxygen-generated HTML version of the
|
||||||
|
liblzma API documentation. Doxygen itself is under the GNU GPL
|
||||||
|
but the remaining files generated by Doxygen are not affected
|
||||||
|
by the licenses used in Doxygen because Doxygen licensing has
|
||||||
|
the following exception:
|
||||||
|
|
||||||
- Test files and test code in the 'tests' directory, and
|
"Documents produced by doxygen are derivative works
|
||||||
debugging utilities in the 'debug' directory are under
|
derived from the input used in their production;
|
||||||
the BSD Zero Clause License (0BSD).
|
they are not affected by this license."
|
||||||
|
|
||||||
- The GNU Autotools based build system contains files that are
|
- Translated messages are in the public domain.
|
||||||
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 contains files that are under various
|
- The build system contains public domain files, and files that
|
||||||
free software licenses. These aren't built or installed as
|
are under GNU GPLv2+ or GNU GPLv3+. None of these files end up
|
||||||
part of XZ Utils.
|
in the binaries being built.
|
||||||
|
|
||||||
The following command may be helpful in finding per-file license
|
- Test files and test code in the tests directory, and debugging
|
||||||
information. It works on xz.git and on a clean file tree extracted
|
utilities in the debug directory are in the public domain.
|
||||||
from a release tarball.
|
|
||||||
|
|
||||||
sh build-aux/license-check.sh -v
|
- The extra directory may contain public domain files, and files
|
||||||
|
that are under various free software licenses.
|
||||||
|
|
||||||
For the files under the BSD Zero Clause License (0BSD), if
|
You can do whatever you want with the files that have been put into
|
||||||
a copyright notice is needed, the following is sufficient:
|
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.
|
||||||
|
|
||||||
Copyright (C) The XZ Utils authors and contributors
|
As usual, this software is provided "as is", without any warranty.
|
||||||
|
|
||||||
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
|
into your project, acknowledging this somewhere in your software is
|
||||||
polite (especially if it is proprietary, non-free software), but
|
polite (especially if it is proprietary, non-free software), but
|
||||||
it is not legally required by the license terms. Here is an example
|
naturally it is not legally required. Here is an example of a good
|
||||||
of a good notice to put into "about box" or into documentation:
|
notice to put into "about box" or into documentation:
|
||||||
|
|
||||||
This software includes code from XZ Utils <https://tukaani.org/xz/>.
|
This software includes code from XZ Utils <https://tukaani.org/xz/>.
|
||||||
|
|
||||||
The following license texts are included in the following files:
|
The following license texts are included in the following files:
|
||||||
- COPYING.0BSD: BSD Zero Clause License
|
|
||||||
- COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1
|
- COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1
|
||||||
- COPYING.GPLv2: GNU General Public License version 2
|
- COPYING.GPLv2: GNU General Public License version 2
|
||||||
- COPYING.GPLv3: GNU General Public License version 3
|
- COPYING.GPLv3: GNU General Public License version 3
|
||||||
|
|
||||||
If you have questions, don't hesitate to ask for more information.
|
Note that the toolchain (compiler, linker etc.) may add some code
|
||||||
The contact information is in the README file.
|
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.
|
||||||
|
|
||||||
|
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.
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||||
<https://fsf.org/>
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
@ -304,7 +304,8 @@ the "copyright" line and a pointer to where the full notice is found.
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along
|
You should have received a copy of the GNU General Public License along
|
||||||
with this program; if not, see <https://www.gnu.org/licenses/>.
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
@ -328,8 +329,8 @@ necessary. Here is a sample; alter the names:
|
|||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||||
|
|
||||||
<signature of Moe Ghoul>, 1 April 1989
|
<signature of Ty Coon>, 1 April 1989
|
||||||
Moe Ghoul, President of Vice
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
This General Public License does not permit incorporating your program into
|
This General Public License does not permit incorporating your program into
|
||||||
proprietary programs. If your program is a subroutine library, you may
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
Version 2.1, February 1999
|
Version 2.1, February 1999
|
||||||
|
|
||||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||||
<https://fsf.org/>
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
@ -484,7 +484,8 @@ convey the exclusion of warranty; and each file should have at least the
|
|||||||
Lesser General Public License for more details.
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, see <https://www.gnu.org/licenses/>.
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
@ -495,7 +496,7 @@ necessary. Here is a sample; alter the names:
|
|||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||||
|
|
||||||
<signature of Moe Ghoul>, 1 April 1990
|
<signature of Ty Coon>, 1 April 1990
|
||||||
Moe Ghoul, President of Vice
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
That's all there is to it!
|
That's all there is to it!
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
See the commit log in the git repository:
|
See the commit log in the git repository:
|
||||||
|
|
||||||
git clone https://github.com/tukaani-project/xz
|
git clone https://git.tukaani.org/xz.git
|
||||||
|
|
||||||
Note that "make dist" doesn't put this tiny file into the package.
|
Note that "make dist" doesn't put this tiny file into the package.
|
||||||
Instead, the git commit log is used as ChangeLog. See dist-hook in
|
Instead, the git commit log is used as ChangeLog. See dist-hook in
|
||||||
|
|||||||
367
INSTALL
367
INSTALL
@ -16,7 +16,7 @@ XZ Utils Installation
|
|||||||
1.2.8. DOS
|
1.2.8. DOS
|
||||||
1.2.9. z/OS
|
1.2.9. z/OS
|
||||||
1.3. Adding support for new platforms
|
1.3. Adding support for new platforms
|
||||||
2. configure and CMake options
|
2. configure options
|
||||||
2.1. Static vs. dynamic linking of liblzma
|
2.1. Static vs. dynamic linking of liblzma
|
||||||
2.2. Optimizing xzdec and lzmadec
|
2.2. Optimizing xzdec and lzmadec
|
||||||
3. xzgrep and other scripts
|
3. xzgrep and other scripts
|
||||||
@ -76,11 +76,6 @@ XZ Utils Installation
|
|||||||
you use CC=xlc instead, you must disable threading support
|
you use CC=xlc instead, you must disable threading support
|
||||||
with --disable-threads (usually not recommended).
|
with --disable-threads (usually not recommended).
|
||||||
|
|
||||||
If building a 32-bit executable, the address space available to xz
|
|
||||||
might be limited to 256 MiB by default. To increase the address
|
|
||||||
space to 2 GiB, pass LDFLAGS=-Wl,-bmaxdata:0x80000000 as an argument
|
|
||||||
to configure.
|
|
||||||
|
|
||||||
|
|
||||||
1.2.2. IRIX
|
1.2.2. IRIX
|
||||||
|
|
||||||
@ -95,15 +90,21 @@ XZ Utils Installation
|
|||||||
|
|
||||||
1.2.3. MINIX 3
|
1.2.3. MINIX 3
|
||||||
|
|
||||||
Version 3.3.0 and later are supported.
|
The default install of MINIX 3 includes Amsterdam Compiler Kit (ACK),
|
||||||
|
which doesn't support C99. Install GCC to compile XZ Utils.
|
||||||
|
|
||||||
Multithreading isn't supported because MINIX 3 doesn't have
|
MINIX 3.1.8 and older have bugs in /usr/include/stdint.h, which has
|
||||||
pthreads. The option --disable-threads must be passed to configure
|
to be patched before XZ Utils can be compiled correctly. See
|
||||||
as this isn't autodetected.
|
<http://gforge.cs.vu.nl/gf/project/minix/tracker/?action=TrackerItemEdit&tracker_item_id=537>.
|
||||||
|
|
||||||
Note that disabling threads causes "make check" to show a few tests
|
MINIX 3.2.0 and later use a different libc and aren't affected by
|
||||||
as skipped ("SKIP"). It's only due to a few threading-dependent
|
the above bug.
|
||||||
subtests are skipped. See the matching tests/test_*.log files.
|
|
||||||
|
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
|
||||||
|
may want to pass gl_cv_cc_visibility=no to configure).
|
||||||
|
|
||||||
|
|
||||||
1.2.4. OpenVMS
|
1.2.4. OpenVMS
|
||||||
@ -142,37 +143,43 @@ XZ Utils Installation
|
|||||||
|
|
||||||
1.2.7. Windows
|
1.2.7. Windows
|
||||||
|
|
||||||
The "windows" directory contains instructions for a few types
|
If it is enough to build liblzma (no command line tools):
|
||||||
of builds:
|
|
||||||
|
|
||||||
- INSTALL-MinGW-w64_with_CMake.txt
|
- There is CMake support. It should be good enough to build
|
||||||
Simple instructions how to build XZ Utils natively on
|
static liblzma or liblzma.dll with Visual Studio. The CMake
|
||||||
Windows using only CMake and a prebuilt toolchain
|
support may work with MinGW or MinGW-w64. Read the comment
|
||||||
(GCC + MinGW-w64 or Clang/LLVM + MinGW-w64).
|
in the beginning of CMakeLists.txt before running CMake!
|
||||||
|
|
||||||
- INSTALL-MinGW-w64_with_Autotools.txt
|
- There are Visual Studio project files under the "windows"
|
||||||
Native build under MSYS2 or cross-compilation from
|
directory. See windows/INSTALL-MSVC.txt. In the future the
|
||||||
GNU/Linux using a bash script that creates a .zip
|
project files will be removed when CMake support is good
|
||||||
and .7z archives of the binaries and documentation.
|
enough. Thus, please test the CMake version and help fix
|
||||||
The related file README-Windows.txt is for the
|
possible issues.
|
||||||
resulting binary package.
|
|
||||||
|
|
||||||
- INSTALL-MSVC.txt
|
To build also the command line tools:
|
||||||
Building with MSVC / Visual Studio and CMake.
|
|
||||||
|
|
||||||
- liblzma-crt-mixing.txt
|
- MinGW-w64 + MSYS (32-bit and 64-bit x86): This is used
|
||||||
Documentation what to take into account as a programmer
|
for building the official binary packages for Windows.
|
||||||
if liblzma.dll and the application don't use the same
|
There is windows/build.bash to ease packaging XZ Utils with
|
||||||
CRT (MSVCRT or UCRT).
|
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/
|
- Cygwin 1.7.35 and later: NOTE that using XZ Utils >= 5.2.0
|
||||||
Building on Cygwin can be done like on many POSIX operating
|
under Cygwin older than 1.7.35 can lead to DATA LOSS! If
|
||||||
systems. XZ Utils >= 5.2.0 isn't compatible with Cygwin older
|
you must use an old Cygwin version, stick to XZ Utils 5.0.x
|
||||||
than 1.7.35 (data loss!). 1.7.35 was released on 2015-03-04.
|
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
|
1.2.8. DOS
|
||||||
@ -218,53 +225,19 @@ XZ Utils Installation
|
|||||||
in C89 or C++.
|
in C89 or C++.
|
||||||
|
|
||||||
|
|
||||||
2. configure and CMake options
|
2. configure options
|
||||||
------------------------------
|
--------------------
|
||||||
|
|
||||||
In most cases, the defaults are what you want. Many of the options
|
In most cases, the defaults are what you want. Many of the options
|
||||||
below are useful only when building a size-optimized version of
|
below are useful only when building a size-optimized version of
|
||||||
liblzma or command line tools.
|
liblzma or command line tools.
|
||||||
|
|
||||||
configure options are those that begin with two dashes "--"
|
|
||||||
or "gl_".
|
|
||||||
|
|
||||||
CMake options begin with "XZ_", "TUKLIB_", or "CMAKE_". To use
|
|
||||||
them on the command line, prefix them with "-D", for example,
|
|
||||||
"cmake -DCMAKE_COMPILE_WARNING_AS_ERROR=ON".
|
|
||||||
|
|
||||||
CMAKE_BUILD_TYPE=TYPE
|
|
||||||
CMake only:
|
|
||||||
|
|
||||||
For release builds, CMAKE_BUILD_TYPE=Release is fine.
|
|
||||||
On targets where CMake defaults to -O3, the default
|
|
||||||
value is overridden to -O2.
|
|
||||||
|
|
||||||
Empty value (CMAKE_BUILD_TYPE=) is fine if using custom
|
|
||||||
optimization options. *In this package* the empty build
|
|
||||||
type also disables debugging code just like "Release"
|
|
||||||
does. To enable debugging code with empty build type,
|
|
||||||
use -UNDEBUG in the CFLAGS environment variable or in
|
|
||||||
the CMAKE_C_FLAGS CMake variable to override -DNDEBUG.
|
|
||||||
|
|
||||||
Non-standard build types like "None" do NOT disable
|
|
||||||
debugging code! Such non-standard build types should
|
|
||||||
be avoided for production builds!
|
|
||||||
|
|
||||||
--enable-encoders=LIST
|
--enable-encoders=LIST
|
||||||
--disable-encoders
|
--disable-encoders
|
||||||
XZ_ENCODERS=LIST
|
Specify a comma-separated LIST of filter encoders to
|
||||||
Specify a LIST of filter encoders to build. In the
|
build. See "./configure --help" for exact list of
|
||||||
configure option the list is comma separated.
|
available filter encoders. The default is to build all
|
||||||
CMake lists are semicolon separated.
|
supported encoders.
|
||||||
|
|
||||||
To see the exact list of available filter encoders:
|
|
||||||
|
|
||||||
- Autotools: ./configure --help
|
|
||||||
|
|
||||||
- CMake: Configure the tree normally first, then use
|
|
||||||
"cmake -LH ." to list the cache variables.
|
|
||||||
|
|
||||||
The default is to build all supported encoders.
|
|
||||||
|
|
||||||
If LIST is empty or --disable-encoders is used, no filter
|
If LIST is empty or --disable-encoders is used, no filter
|
||||||
encoders will be built and also the code shared between
|
encoders will be built and also the code shared between
|
||||||
@ -276,12 +249,10 @@ XZ Utils Installation
|
|||||||
|
|
||||||
--enable-decoders=LIST
|
--enable-decoders=LIST
|
||||||
--disable-decoders
|
--disable-decoders
|
||||||
XZ_DECODERS=LIST
|
|
||||||
This is like --enable-encoders but for decoders. The
|
This is like --enable-encoders but for decoders. The
|
||||||
default is to build all supported decoders.
|
default is to build all supported decoders.
|
||||||
|
|
||||||
--enable-match-finders=LIST
|
--enable-match-finders=LIST
|
||||||
XZ_MATCH_FINDERS=LIST
|
|
||||||
liblzma includes two categories of match finders:
|
liblzma includes two categories of match finders:
|
||||||
hash chains and binary trees. Hash chains (hc3 and hc4)
|
hash chains and binary trees. Hash chains (hc3 and hc4)
|
||||||
are quite fast but they don't provide the best compression
|
are quite fast but they don't provide the best compression
|
||||||
@ -298,11 +269,9 @@ XZ Utils Installation
|
|||||||
or LZMA2 filter encoders are being built.
|
or LZMA2 filter encoders are being built.
|
||||||
|
|
||||||
--enable-checks=LIST
|
--enable-checks=LIST
|
||||||
XZ_CHECKS=LIST
|
|
||||||
liblzma support multiple integrity checks. CRC32 is
|
liblzma support multiple integrity checks. CRC32 is
|
||||||
mandatory, and cannot be omitted. Supported check
|
mandatory, and cannot be omitted. See "./configure --help"
|
||||||
types are "crc32", "crc64", and "sha256". By default
|
for exact list of available integrity check types.
|
||||||
all supported check types are enabled.
|
|
||||||
|
|
||||||
liblzma and the command line tools can decompress files
|
liblzma and the command line tools can decompress files
|
||||||
which use unsupported integrity check type, but naturally
|
which use unsupported integrity check type, but naturally
|
||||||
@ -313,7 +282,6 @@ XZ Utils Installation
|
|||||||
it is known to not cause problems.
|
it is known to not cause problems.
|
||||||
|
|
||||||
--enable-external-sha256
|
--enable-external-sha256
|
||||||
XZ_EXTERNAL_SHA256=ON
|
|
||||||
Try to use SHA-256 code from the operating system libc
|
Try to use SHA-256 code from the operating system libc
|
||||||
or similar base system libraries. This doesn't try to
|
or similar base system libraries. This doesn't try to
|
||||||
use OpenSSL or libgcrypt or such libraries.
|
use OpenSSL or libgcrypt or such libraries.
|
||||||
@ -350,8 +318,6 @@ XZ Utils Installation
|
|||||||
time xz --test foo.xz
|
time xz --test foo.xz
|
||||||
|
|
||||||
--disable-microlzma
|
--disable-microlzma
|
||||||
XZ_MICROLZMA_ENCODER=OFF
|
|
||||||
XZ_MICROLZMA_DECODER=OFF
|
|
||||||
Don't build MicroLZMA encoder and decoder. This omits
|
Don't build MicroLZMA encoder and decoder. This omits
|
||||||
lzma_microlzma_encoder() and lzma_microlzma_decoder()
|
lzma_microlzma_encoder() and lzma_microlzma_decoder()
|
||||||
API functions from liblzma. These functions are needed
|
API functions from liblzma. These functions are needed
|
||||||
@ -359,7 +325,6 @@ XZ Utils Installation
|
|||||||
erofs-utils but they may be used by others too.
|
erofs-utils but they may be used by others too.
|
||||||
|
|
||||||
--disable-lzip-decoder
|
--disable-lzip-decoder
|
||||||
XZ_LZIP_DECODER=OFF
|
|
||||||
Disable decompression support for .lz (lzip) files.
|
Disable decompression support for .lz (lzip) files.
|
||||||
This omits the API function lzma_lzip_decoder() from
|
This omits the API function lzma_lzip_decoder() from
|
||||||
liblzma and .lz support from the xz tool.
|
liblzma and .lz support from the xz tool.
|
||||||
@ -368,10 +333,6 @@ XZ Utils Installation
|
|||||||
--disable-xzdec
|
--disable-xzdec
|
||||||
--disable-lzmadec
|
--disable-lzmadec
|
||||||
--disable-lzmainfo
|
--disable-lzmainfo
|
||||||
XZ_TOOL_XZ=OFF
|
|
||||||
XZ_TOOL_XZDEC=OFF
|
|
||||||
XZ_TOOL_LZMADEC=OFF
|
|
||||||
XZ_TOOL_LZMAINFO=OFF
|
|
||||||
Don't build and install the command line tool mentioned
|
Don't build and install the command line tool mentioned
|
||||||
in the option name.
|
in the option name.
|
||||||
|
|
||||||
@ -381,63 +342,37 @@ XZ Utils Installation
|
|||||||
a dangling man page symlink lzmadec.1 -> xzdec.1 is
|
a dangling man page symlink lzmadec.1 -> xzdec.1 is
|
||||||
created.
|
created.
|
||||||
|
|
||||||
XZ_TOOL_SYMLINKS=OFF
|
|
||||||
Don't create the unxz and xzcat symlinks. (There is
|
|
||||||
no "configure" option to disable these symlinks.)
|
|
||||||
|
|
||||||
--disable-lzma-links
|
--disable-lzma-links
|
||||||
XZ_TOOL_SYMLINKS_LZMA=OFF
|
|
||||||
Don't create symlinks for LZMA Utils compatibility.
|
Don't create symlinks for LZMA Utils compatibility.
|
||||||
This includes lzma, unlzma, and lzcat. If scripts are
|
This includes lzma, unlzma, and lzcat. If scripts are
|
||||||
installed, also lzdiff, lzcmp, lzgrep, lzegrep, lzfgrep,
|
installed, also lzdiff, lzcmp, lzgrep, lzegrep, lzfgrep,
|
||||||
lzmore, and lzless will be omitted if this option is used.
|
lzmore, and lzless will be omitted if this option is used.
|
||||||
|
|
||||||
--disable-scripts
|
--disable-scripts
|
||||||
XZ_TOOL_SCRIPTS=OFF
|
|
||||||
Don't install the scripts xzdiff, xzgrep, xzmore, xzless,
|
Don't install the scripts xzdiff, xzgrep, xzmore, xzless,
|
||||||
and their symlinks.
|
and their symlinks.
|
||||||
|
|
||||||
--disable-doc
|
--disable-doc
|
||||||
XZ_DOC=OFF
|
|
||||||
Don't install the documentation files to $docdir
|
Don't install the documentation files to $docdir
|
||||||
(often /usr/doc/xz or /usr/local/doc/xz). Man pages
|
(often /usr/doc/xz or /usr/local/doc/xz). Man pages
|
||||||
will still be installed. The $docdir can be changed
|
will still be installed. The $docdir can be changed
|
||||||
with --docdir=DIR.
|
with --docdir=DIR.
|
||||||
|
|
||||||
--enable-doxygen
|
|
||||||
XZ_DOXYGEN=ON
|
|
||||||
Enable generation of the HTML version of the liblzma API
|
|
||||||
documentation using Doxygen. The resulting files are
|
|
||||||
installed to $docdir/api. This option assumes that
|
|
||||||
the 'doxygen' tool is available.
|
|
||||||
|
|
||||||
NOTE: --disable-doc or XZ_DOC=OFF don't affect this.
|
|
||||||
|
|
||||||
--disable-assembler
|
--disable-assembler
|
||||||
XZ_ASM_I386=OFF
|
liblzma includes some assembler optimizations. Currently
|
||||||
This disables CRC32 and CRC64 assembly code on
|
there is only assembler code for CRC32 and CRC64 for
|
||||||
32-bit x86. This option currently does nothing
|
32-bit x86.
|
||||||
on other architectures (not even on x86-64).
|
|
||||||
|
|
||||||
The 32-bit x86 assembly is position-independent code
|
All the assembler code in liblzma is position-independent
|
||||||
which is suitable for use in shared libraries and
|
code, which is suitable for use in shared libraries and
|
||||||
position-independent executables. It uses only i386
|
position-independent executables. So far only i386
|
||||||
instructions but the code is optimized for i686 class
|
instructions are used, but the code is optimized for i686
|
||||||
CPUs. If you are compiling liblzma exclusively for
|
class CPUs. If you are compiling liblzma exclusively for
|
||||||
pre-i686 systems, you may want to disable the assembler
|
pre-i686 systems, you may want to disable the assembler
|
||||||
code.
|
code.
|
||||||
|
|
||||||
The assembly code is compatible with only certain OSes
|
|
||||||
and toolchains (it's not compatible with MSVC).
|
|
||||||
|
|
||||||
Since XZ Utils 5.7.1alpha, the 32-bit x86 assembly code
|
|
||||||
co-exists with the modern CLMUL code: CLMUL is used if
|
|
||||||
support for it is detected at runtime. On old processors
|
|
||||||
the assembly code is used.
|
|
||||||
|
|
||||||
--disable-clmul-crc
|
--disable-clmul-crc
|
||||||
XZ_CLMUL_CRC=OFF
|
Disable the use carryless multiplication for CRC
|
||||||
Disable the use of carryless multiplication for CRC
|
|
||||||
calculation even if compiler support for it is detected.
|
calculation even if compiler support for it is detected.
|
||||||
The code uses runtime detection of SSSE3, SSE4.1, and
|
The code uses runtime detection of SSSE3, SSE4.1, and
|
||||||
CLMUL instructions on x86. On 32-bit x86 this currently
|
CLMUL instructions on x86. On 32-bit x86 this currently
|
||||||
@ -448,27 +383,7 @@ XZ Utils Installation
|
|||||||
required extensions (-msse4.1 -mpclmul) then runtime
|
required extensions (-msse4.1 -mpclmul) then runtime
|
||||||
detection isn't used and the generic code is omitted.
|
detection isn't used and the generic code is omitted.
|
||||||
|
|
||||||
--disable-arm64-crc32
|
|
||||||
XZ_ARM64_CRC32=OFF
|
|
||||||
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.
|
|
||||||
|
|
||||||
--disable-loongarch-crc32
|
|
||||||
XZ_LOONGARCH_CRC32=OFF
|
|
||||||
Disable the use of the 64-bit LoongArch CRC32
|
|
||||||
instruction extension even if compiler support for
|
|
||||||
it is detected. There is no runtime detection because
|
|
||||||
all 64-bit LoongArch processors should support
|
|
||||||
the CRC32 instructions.
|
|
||||||
|
|
||||||
--enable-unaligned-access
|
--enable-unaligned-access
|
||||||
TUKLIB_FAST_UNALIGNED_ACCESS=ON
|
|
||||||
Allow liblzma to use unaligned memory access for 16-bit,
|
Allow liblzma to use unaligned memory access for 16-bit,
|
||||||
32-bit, and 64-bit loads and stores. This should be
|
32-bit, and 64-bit loads and stores. This should be
|
||||||
enabled only when the hardware supports this, that is,
|
enabled only when the hardware supports this, that is,
|
||||||
@ -477,46 +392,10 @@ XZ Utils Installation
|
|||||||
slow. This option shouldn't be used on systems that
|
slow. This option shouldn't be used on systems that
|
||||||
rely on such emulation.
|
rely on such emulation.
|
||||||
|
|
||||||
Unaligned access is enabled by default on these:
|
Unaligned access is enabled by default on x86, x86-64,
|
||||||
- 32-bit x86
|
big endian PowerPC, some ARM, and some ARM64 systems.
|
||||||
- 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
|
--enable-unsafe-type-punning
|
||||||
TUKLIB_USE_UNSAFE_TYPE_PUNNING=ON
|
|
||||||
This enables use of code like
|
This enables use of code like
|
||||||
|
|
||||||
uint8_t *buf8 = ...;
|
uint8_t *buf8 = ...;
|
||||||
@ -533,7 +412,6 @@ XZ Utils Installation
|
|||||||
GCC 3 and early 4.x on x86, GCC < 6 on ARMv6 and ARMv7).
|
GCC 3 and early 4.x on x86, GCC < 6 on ARMv6 and ARMv7).
|
||||||
|
|
||||||
--enable-small
|
--enable-small
|
||||||
XZ_SMALL=ON
|
|
||||||
Reduce the size of liblzma by selecting smaller but
|
Reduce the size of liblzma by selecting smaller but
|
||||||
semantically equivalent version of some functions, and
|
semantically equivalent version of some functions, and
|
||||||
omit precomputed lookup tables. This option tends to
|
omit precomputed lookup tables. This option tends to
|
||||||
@ -550,7 +428,6 @@ XZ Utils Installation
|
|||||||
flag(s) to CFLAGS manually.
|
flag(s) to CFLAGS manually.
|
||||||
|
|
||||||
--enable-assume-ram=SIZE
|
--enable-assume-ram=SIZE
|
||||||
XZ_ASSUME_RAM=SIZE
|
|
||||||
On the most common operating systems, XZ Utils is able to
|
On the most common operating systems, XZ Utils is able to
|
||||||
detect the amount of physical memory on the system. This
|
detect the amount of physical memory on the system. This
|
||||||
information is used by the options --memlimit-compress,
|
information is used by the options --memlimit-compress,
|
||||||
@ -567,7 +444,6 @@ XZ Utils Installation
|
|||||||
src/common/tuklib_physmem.c for details.
|
src/common/tuklib_physmem.c for details.
|
||||||
|
|
||||||
--enable-threads=METHOD
|
--enable-threads=METHOD
|
||||||
XZ_THREADS=METHOD
|
|
||||||
Threading support is enabled by default so normally there
|
Threading support is enabled by default so normally there
|
||||||
is no need to specify this option.
|
is no need to specify this option.
|
||||||
|
|
||||||
@ -584,14 +460,14 @@ XZ Utils Installation
|
|||||||
too. This is the default for 32-bit x86
|
too. This is the default for 32-bit x86
|
||||||
Windows builds. Unless the compiler
|
Windows builds. Unless the compiler
|
||||||
supports __attribute__((__constructor__)),
|
supports __attribute__((__constructor__)),
|
||||||
the 'win95' threading is incompatible with
|
the `win95' threading is incompatible with
|
||||||
--enable-small.
|
--enable-small.
|
||||||
|
|
||||||
vista Use Windows Vista compatible threads. The
|
vista Use Windows Vista compatible threads. The
|
||||||
resulting binaries won't run on Windows XP
|
resulting binaries won't run on Windows XP
|
||||||
or older. This is the default for Windows
|
or older. This is the default for Windows
|
||||||
excluding 32-bit x86 builds (that is, on
|
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
|
no Disable threading support. This is the
|
||||||
same as using --disable-threads.
|
same as using --disable-threads.
|
||||||
@ -604,17 +480,13 @@ XZ Utils Installation
|
|||||||
one thread, something bad may happen.
|
one thread, something bad may happen.
|
||||||
|
|
||||||
--enable-sandbox=METHOD
|
--enable-sandbox=METHOD
|
||||||
XZ_SANDBOX=METHOD
|
There is limited sandboxing support in the xz tool. If
|
||||||
There is limited sandboxing support in the xz and xzdec
|
built with sandbox support, it's used automatically when
|
||||||
tools. If built with sandbox support, xz uses it
|
(de)compressing exactly one file to standard output and
|
||||||
automatically when (de)compressing exactly one file to
|
the options --files or --files0 weren't used. This is a
|
||||||
standard output when the options --files or --files0 aren't
|
common use case, for example, (de)compressing .tar.xz
|
||||||
used. This is a common use case, for example,
|
files via GNU tar. The sandbox is also used for
|
||||||
(de)compressing .tar.xz files via GNU tar. The sandbox is
|
single-file `xz --test' or `xz --list'.
|
||||||
also used for single-file 'xz --test' or 'xz --list'.
|
|
||||||
xzdec always uses the sandbox, except when more than one
|
|
||||||
file are decompressed. In this case it will enable the
|
|
||||||
sandbox for the last file that is decompressed.
|
|
||||||
|
|
||||||
Supported METHODs:
|
Supported METHODs:
|
||||||
|
|
||||||
@ -626,7 +498,7 @@ XZ Utils Installation
|
|||||||
no Disable sandboxing support.
|
no Disable sandboxing support.
|
||||||
|
|
||||||
capsicum
|
capsicum
|
||||||
Use Capsicum (FreeBSD >= 10.2) for
|
Use Capsicum (FreeBSD >= 10) for
|
||||||
sandboxing. If no Capsicum support
|
sandboxing. If no Capsicum support
|
||||||
is found, configure will give an error.
|
is found, configure will give an error.
|
||||||
|
|
||||||
@ -634,76 +506,23 @@ XZ Utils Installation
|
|||||||
sandboxing. If pledge(2) isn't found,
|
sandboxing. If pledge(2) isn't found,
|
||||||
configure will give an error.
|
configure will give an error.
|
||||||
|
|
||||||
landlock
|
--enable-symbol-versions
|
||||||
Use Landlock (Linux >= 5.13) for
|
Use symbol versioning for liblzma. This is enabled by
|
||||||
sandboxing. If no Landlock support
|
default on GNU/Linux, other GNU-based systems, and
|
||||||
is found, configure will give an error.
|
FreeBSD.
|
||||||
|
|
||||||
--enable-symbol-versions[=VARIANT]
|
|
||||||
XZ_SYMBOL_VERSIONING=VARIANT
|
|
||||||
Use symbol versioning for liblzma shared library.
|
|
||||||
This is enabled by default on GNU/Linux (glibc only),
|
|
||||||
other GNU-based systems, and FreeBSD.
|
|
||||||
|
|
||||||
Symbol versioning is never used for static liblzma. This
|
|
||||||
option is ignored when not building a shared library.
|
|
||||||
|
|
||||||
Supported VARIANTs:
|
|
||||||
|
|
||||||
no Disable symbol versioning. This is the
|
|
||||||
same as using --disable-symbol-versions.
|
|
||||||
|
|
||||||
auto Autodetect between "no", "linux",
|
|
||||||
and "generic".
|
|
||||||
|
|
||||||
yes Autodetect between "linux" and
|
|
||||||
"generic". This forces symbol
|
|
||||||
versioning to be used when
|
|
||||||
building a shared library.
|
|
||||||
|
|
||||||
generic Generic version is the default for
|
|
||||||
FreeBSD and GNU/Linux on MicroBlaze.
|
|
||||||
|
|
||||||
This is also used on GNU/Linux when
|
|
||||||
building with NVIDIA HPC Compiler
|
|
||||||
because the compiler doesn't support
|
|
||||||
the features required for the "linux"
|
|
||||||
variant below.
|
|
||||||
|
|
||||||
linux Special version for GNU/Linux (glibc
|
|
||||||
only). This adds a few extra symbol
|
|
||||||
versions for compatibility with binaries
|
|
||||||
that have been linked against a liblzma
|
|
||||||
version that has been patched with
|
|
||||||
"xz-5.2.2-compat-libs.patch" from
|
|
||||||
RHEL/CentOS 7. That patch was used
|
|
||||||
by some build tools outside of
|
|
||||||
RHEL/CentOS 7 too.
|
|
||||||
|
|
||||||
--enable-debug
|
--enable-debug
|
||||||
This enables the assert() macro and possibly some other
|
This enables the assert() macro and possibly some other
|
||||||
run-time consistency checks. It makes the code slower, so
|
run-time consistency checks. It makes the code slower, so
|
||||||
you normally don't want to have this enabled.
|
you normally don't want to have this enabled.
|
||||||
|
|
||||||
In CMake, the build type (CMAKE_BUILD_TYPE) controls if
|
|
||||||
-DNDEBUG is passed to the compiler. *In this package*,
|
|
||||||
an empty build type disables debugging code too.
|
|
||||||
Non-standard build types like "None" do NOT disable
|
|
||||||
debugging code!
|
|
||||||
|
|
||||||
To enable debugging code with empty build type in CMake,
|
|
||||||
use -UNDEBUG in the CFLAGS environment variable or in
|
|
||||||
the CMAKE_C_FLAGS CMake variable to override -DNDEBUG.
|
|
||||||
|
|
||||||
--enable-werror
|
--enable-werror
|
||||||
CMAKE_COMPILE_WARNING_AS_ERROR=ON (CMake >= 3.24)
|
|
||||||
If building with GCC, make all compiler warnings an error,
|
If building with GCC, make all compiler warnings an error,
|
||||||
that abort the compilation. This may help catching bugs,
|
that abort the compilation. This may help catching bugs,
|
||||||
and should work on most systems. This has no effect on the
|
and should work on most systems. This has no effect on the
|
||||||
resulting binaries.
|
resulting binaries.
|
||||||
|
|
||||||
--enable-path-for-scripts=PREFIX
|
--enable-path-for-scripts=PREFIX
|
||||||
(CMake determines this from the path of XZ_POSIX_SHELL)
|
|
||||||
If PREFIX isn't empty, PATH=PREFIX:$PATH will be set in
|
If PREFIX isn't empty, PATH=PREFIX:$PATH will be set in
|
||||||
the beginning of the scripts (xzgrep and others).
|
the beginning of the scripts (xzgrep and others).
|
||||||
The default is empty except on Solaris the default is
|
The default is empty except on Solaris the default is
|
||||||
@ -720,36 +539,6 @@ XZ Utils Installation
|
|||||||
the PATH for the scripts. It is described in section 3.2
|
the PATH for the scripts. It is described in section 3.2
|
||||||
and is supported in this xz version too.
|
and is supported in this xz version too.
|
||||||
|
|
||||||
gl_cv_posix_shell=/path/to/bin/sh
|
|
||||||
XZ_POSIX_SHELL=/path/to/bin/sh
|
|
||||||
POSIX shell to use for xzgrep and other scripts.
|
|
||||||
|
|
||||||
- configure should autodetect this well enough.
|
|
||||||
Typically it's /bin/sh but in some cases, like
|
|
||||||
Solaris, something else is used.
|
|
||||||
|
|
||||||
- CMake build uses /bin/sh except on Solaris the
|
|
||||||
default is /usr/xpg4/bin/sh.
|
|
||||||
|
|
||||||
CMAKE_DLL_NAME_WITH_SOVERSION=ON
|
|
||||||
CMake on native Windows (not Cygwin) only:
|
|
||||||
|
|
||||||
This changes the filename liblzma.dll to liblzma-5.dll.
|
|
||||||
|
|
||||||
The unversioned filename liblzma.dll has been used
|
|
||||||
since XZ Utils 5.0.0 when creating binary packages
|
|
||||||
using the included windows/build.bash. The same
|
|
||||||
unversioned filename is the default with CMake.
|
|
||||||
However, there are popular builds that, very
|
|
||||||
understandably and reasonably, use the versioned
|
|
||||||
filename produced by GNU Libtool.
|
|
||||||
|
|
||||||
This option should usually be left to its default value
|
|
||||||
(OFF). It can be set to ON if the liblzma DLL filename
|
|
||||||
must be compatible with the versioned filename
|
|
||||||
produced by GNU Libtool. For example, binaries
|
|
||||||
distributed in MSYS2 use a versioned DLL filename.
|
|
||||||
|
|
||||||
|
|
||||||
2.1. Static vs. dynamic linking of liblzma
|
2.1. Static vs. dynamic linking of liblzma
|
||||||
|
|
||||||
@ -918,7 +707,7 @@ XZ Utils Installation
|
|||||||
|
|
||||||
The configure script determines if assembler code can be used by
|
The configure script determines if assembler code can be used by
|
||||||
looking at the configure triplet; there is currently no check if
|
looking at the configure triplet; there is currently no check if
|
||||||
the assembler code can actually be built. The x86 assembler
|
the assembler code can actually actually be built. The x86 assembler
|
||||||
code should work on x86 GNU/Linux, *BSDs, Solaris, Darwin, MinGW,
|
code should work on x86 GNU/Linux, *BSDs, Solaris, Darwin, MinGW,
|
||||||
Cygwin, and DJGPP. On other x86 systems, there may be problems and
|
Cygwin, and DJGPP. On other x86 systems, there may be problems and
|
||||||
the assembler code may need to be disabled with the configure option.
|
the assembler code may need to be disabled with the configure option.
|
||||||
|
|||||||
97
Makefile.am
97
Makefile.am
@ -1,5 +1,9 @@
|
|||||||
## SPDX-License-Identifier: 0BSD
|
##
|
||||||
## Author: Lasse Collin
|
## Author: Lasse Collin
|
||||||
|
##
|
||||||
|
## This file has been put into the public domain.
|
||||||
|
## You can do whatever you want with this file.
|
||||||
|
##
|
||||||
|
|
||||||
# Use -n to prevent gzip from adding a timestamp to the .gz headers.
|
# Use -n to prevent gzip from adding a timestamp to the .gz headers.
|
||||||
GZIP_ENV = -9n
|
GZIP_ENV = -9n
|
||||||
@ -17,11 +21,11 @@ if COND_DOC
|
|||||||
dist_doc_DATA = \
|
dist_doc_DATA = \
|
||||||
AUTHORS \
|
AUTHORS \
|
||||||
COPYING \
|
COPYING \
|
||||||
COPYING.0BSD \
|
|
||||||
COPYING.GPLv2 \
|
COPYING.GPLv2 \
|
||||||
NEWS \
|
NEWS \
|
||||||
README \
|
README \
|
||||||
THANKS \
|
THANKS \
|
||||||
|
TODO \
|
||||||
doc/faq.txt \
|
doc/faq.txt \
|
||||||
doc/history.txt \
|
doc/history.txt \
|
||||||
doc/xz-file-format.txt \
|
doc/xz-file-format.txt \
|
||||||
@ -34,34 +38,47 @@ dist_examples_DATA = \
|
|||||||
doc/examples/02_decompress.c \
|
doc/examples/02_decompress.c \
|
||||||
doc/examples/03_compress_custom.c \
|
doc/examples/03_compress_custom.c \
|
||||||
doc/examples/04_compress_easy_mt.c \
|
doc/examples/04_compress_easy_mt.c \
|
||||||
doc/examples/11_file_info.c \
|
|
||||||
doc/examples/Makefile
|
doc/examples/Makefile
|
||||||
|
|
||||||
|
examplesolddir = $(docdir)/examples_old
|
||||||
|
dist_examplesold_DATA = \
|
||||||
|
doc/examples_old/xz_pipe_comp.c \
|
||||||
|
doc/examples_old/xz_pipe_decomp.c
|
||||||
|
|
||||||
|
# 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"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
cmake \
|
po4a \
|
||||||
|
extra \
|
||||||
dos \
|
dos \
|
||||||
doxygen \
|
doxygen \
|
||||||
extra \
|
|
||||||
po4a \
|
|
||||||
windows \
|
windows \
|
||||||
|
macosx \
|
||||||
|
cmake \
|
||||||
CMakeLists.txt \
|
CMakeLists.txt \
|
||||||
|
autogen.sh \
|
||||||
COPYING.GPLv2 \
|
COPYING.GPLv2 \
|
||||||
COPYING.GPLv3 \
|
COPYING.GPLv3 \
|
||||||
COPYING.LGPLv2.1 \
|
COPYING.LGPLv2.1 \
|
||||||
INSTALL.generic \
|
INSTALL.generic \
|
||||||
PACKAGERS \
|
PACKAGERS \
|
||||||
TODO \
|
|
||||||
autogen.sh \
|
|
||||||
build-aux/license-check.sh \
|
|
||||||
build-aux/manconv.sh \
|
build-aux/manconv.sh \
|
||||||
build-aux/version.sh \
|
build-aux/version.sh
|
||||||
po/xz.pot-header
|
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
# List of man pages to convert to plain text in the dist-hook target
|
# List of man pages to convert to PDF and plain text in the dist-hook target.
|
||||||
# or to PDF in the pdf-local target.
|
|
||||||
manfiles = \
|
manfiles = \
|
||||||
src/xz/xz.1 \
|
src/xz/xz.1 \
|
||||||
src/xzdec/xzdec.1 \
|
src/xzdec/xzdec.1 \
|
||||||
@ -71,53 +88,47 @@ manfiles = \
|
|||||||
src/scripts/xzless.1 \
|
src/scripts/xzless.1 \
|
||||||
src/scripts/xzmore.1
|
src/scripts/xzmore.1
|
||||||
|
|
||||||
# Create ChangeLog using "git log".
|
# Create ChangeLog from output of "git log --date=iso --stat".
|
||||||
# Convert the man pages to plain text (ASCII only) format.
|
# Convert the man pages to PDF and plain text (ASCII only) formats.
|
||||||
dist-hook:
|
dist-hook:
|
||||||
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
||||||
( cd "$(srcdir)" && git log --pretty=medium --date=iso --stat \
|
( cd "$(srcdir)" && git log --date=iso --stat \
|
||||||
b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \
|
6060f7dc76fd6c2a8a1f8e85d0e4d86bb78273e6^..HEAD ) \
|
||||||
> "$(distdir)/ChangeLog"; \
|
> "$(distdir)/ChangeLog"; \
|
||||||
fi
|
fi
|
||||||
if type groff > /dev/null 2>&1; then \
|
if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \
|
||||||
dest="$(distdir)/doc/man" && \
|
dest="$(distdir)/doc/man" && \
|
||||||
$(MKDIR_P) "$$dest/txt" && \
|
$(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \
|
||||||
for FILE in $(manfiles); do \
|
for FILE in $(manfiles); do \
|
||||||
BASE=`basename $$FILE .1` && \
|
BASE=`basename $$FILE .1` && \
|
||||||
$(SHELL) "$(srcdir)/build-aux/manconv.sh" ascii \
|
sh "$(srcdir)/build-aux/manconv.sh" pdf a4 \
|
||||||
|
< "$(srcdir)/$$FILE" \
|
||||||
|
> "$$dest/pdf-a4/$$BASE-a4.pdf" && \
|
||||||
|
sh "$(srcdir)/build-aux/manconv.sh" pdf letter \
|
||||||
|
< "$(srcdir)/$$FILE" \
|
||||||
|
> "$$dest/pdf-letter/$$BASE-letter.pdf" && \
|
||||||
|
sh "$(srcdir)/build-aux/manconv.sh" ascii \
|
||||||
< "$(srcdir)/$$FILE" \
|
< "$(srcdir)/$$FILE" \
|
||||||
> "$$dest/txt/$$BASE.txt"; \
|
> "$$dest/txt/$$BASE.txt"; \
|
||||||
done; \
|
done; \
|
||||||
fi
|
fi
|
||||||
cd "$(distdir)" && $(SHELL) "build-aux/license-check.sh"
|
if test -d "$(srcdir)/doc/api" ; then \
|
||||||
|
$(MKDIR_P) "$(distdir)/doc/api" && \
|
||||||
|
$(INSTALL_DATA) "$(srcdir)"/doc/api/* \
|
||||||
|
"$(distdir)/doc/api"; \
|
||||||
|
fi
|
||||||
|
|
||||||
# This works with GNU tar and gives cleaner package than normal 'make dist'.
|
# This works with GNU tar and gives cleaner package than normal 'make dist'.
|
||||||
# This also ensures that the translations are up to date (dist-hook
|
# This also ensures that the man page translations are up to date (dist-hook
|
||||||
# would be too late for that).
|
# would be too late for that).
|
||||||
mydist:
|
mydist:
|
||||||
$(SHELL) "$(srcdir)/src/liblzma/validate_map.sh"
|
sh "$(srcdir)/src/liblzma/validate_map.sh"
|
||||||
cd po && $(MAKE) xz.pot-update
|
cd "$(srcdir)/po4a" && sh update-po
|
||||||
cd "$(srcdir)/po4a" && $(SHELL) update-po
|
cd "$(srcdir)/doxygen" && sh update-doxygen
|
||||||
VERSION=$(VERSION); \
|
VERSION=$(VERSION); \
|
||||||
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
||||||
$(SHELL) "$(srcdir)/build-aux/license-check.sh" || exit 1; \
|
SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \
|
||||||
SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=8 | cut -b2-`; \
|
|
||||||
test -n "$$SNAPSHOT" && VERSION=$$SNAPSHOT; \
|
test -n "$$SNAPSHOT" && VERSION=$$SNAPSHOT; \
|
||||||
fi; \
|
fi; \
|
||||||
TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w --sort=name' \
|
TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
|
||||||
LC_COLLATE=C \
|
|
||||||
$(MAKE) VERSION="$$VERSION" dist-gzip
|
$(MAKE) VERSION="$$VERSION" dist-gzip
|
||||||
|
|
||||||
# NOTE: This only creates the PDFs. The install rules are missing.
|
|
||||||
pdf-local:
|
|
||||||
dest="doc/man" && \
|
|
||||||
$(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" && \
|
|
||||||
for FILE in $(manfiles); do \
|
|
||||||
BASE=`basename $$FILE .1` && \
|
|
||||||
$(SHELL) "$(srcdir)/build-aux/manconv.sh" pdf a4 \
|
|
||||||
< "$(srcdir)/$$FILE" \
|
|
||||||
> "$$dest/pdf-a4/$$BASE-a4.pdf" && \
|
|
||||||
$(SHELL) "$(srcdir)/build-aux/manconv.sh" pdf letter \
|
|
||||||
< "$(srcdir)/$$FILE" \
|
|
||||||
> "$$dest/pdf-letter/$$BASE-letter.pdf"; \
|
|
||||||
done
|
|
||||||
|
|||||||
30
PACKAGERS
30
PACKAGERS
@ -44,8 +44,8 @@ Information to packagers of XZ Utils
|
|||||||
lzmadec binary for compatibility with LZMA Utils
|
lzmadec binary for compatibility with LZMA Utils
|
||||||
liblzma liblzma.so.*
|
liblzma liblzma.so.*
|
||||||
liblzma-devel liblzma.so, liblzma.a, API headers
|
liblzma-devel liblzma.so, liblzma.a, API headers
|
||||||
liblzma-doc Example programs and, if enabled at build time,
|
liblzma-doc Doxygen-generated liblzma API docs (HTML),
|
||||||
Doxygen-generated liblzma API docs (HTML)
|
example programs
|
||||||
|
|
||||||
|
|
||||||
2. Package description
|
2. Package description
|
||||||
@ -124,15 +124,14 @@ Information to packagers of XZ Utils
|
|||||||
|
|
||||||
If the package manager supports a license field, you probably should
|
If the package manager supports a license field, you probably should
|
||||||
put GPLv2+ there (GNU GPL v2 or later). The interesting parts of
|
put GPLv2+ there (GNU GPL v2 or later). The interesting parts of
|
||||||
XZ Utils are under the BSD Zero Clause License (0BSD), but some less
|
XZ Utils are in the public domain, but some less important files
|
||||||
important files ending up into the binary package are under GPLv2+.
|
ending up into the binary package are under GPLv2+. So it is simplest
|
||||||
So it is simplest to just say GPLv2+ if you cannot specify
|
to just say GPLv2+ if you cannot specify "public domain and GPLv2+".
|
||||||
"BSD0 and GPLv2+".
|
|
||||||
|
|
||||||
If you split XZ Utils into multiple packages as described earlier
|
If you split XZ Utils into multiple packages as described earlier
|
||||||
in this file, liblzma and liblzma-dev packages will contain only
|
in this file, liblzma and liblzma-dev packages will contain only
|
||||||
0BSD-licensed code from XZ Utils (compiler or linker may add some
|
public domain code (from XZ Utils at least; compiler or linker may
|
||||||
third-party code which may have other licenses).
|
add some third-party code, which may be copyrighted).
|
||||||
|
|
||||||
|
|
||||||
4. configure options
|
4. configure options
|
||||||
@ -170,14 +169,13 @@ Information to packagers of XZ Utils
|
|||||||
can be replaced with a symlink if your distro ships with shared
|
can be replaced with a symlink if your distro ships with shared
|
||||||
copies of the common license texts.
|
copies of the common license texts.
|
||||||
|
|
||||||
The Doxygen-generated liblzma API documentation (HTML) is built and
|
The Doxygen-generated documentation (HTML) for the liblzma API
|
||||||
installed if the configure option --enable-doxygen is used (it's
|
headers is included in the source release and will be installed by
|
||||||
disabled by default). This requires that Doxygen is available. The
|
"make install" to $docdir/api. All JavaScript is removed to
|
||||||
API documentation is installed by "make install" to $docdir/api.
|
simplify license compliance and to reduce the install size. If the
|
||||||
|
liblzma API documentation is not desired, either run configure with
|
||||||
NOTE: The files generated by Doxygen include content from
|
--disable-doc or remove the doc/api directory before running
|
||||||
Doxygen itself. Check the license info before distributing
|
"make install".
|
||||||
the Doxygen-generated files.
|
|
||||||
|
|
||||||
|
|
||||||
6. Extra files
|
6. Extra files
|
||||||
|
|||||||
130
README
130
README
@ -10,7 +10,6 @@ XZ Utils
|
|||||||
2. Version numbering
|
2. Version numbering
|
||||||
3. Reporting bugs
|
3. Reporting bugs
|
||||||
4. Translations
|
4. Translations
|
||||||
4.1. Testing translations
|
|
||||||
5. Other implementations of the .xz format
|
5. Other implementations of the .xz format
|
||||||
6. Contact information
|
6. Contact information
|
||||||
|
|
||||||
@ -70,13 +69,12 @@ XZ Utils
|
|||||||
|
|
||||||
README This file
|
README This file
|
||||||
|
|
||||||
INSTALL.generic Generic install instructions for those not
|
INSTALL.generic Generic install instructions for those not familiar
|
||||||
familiar with packages using GNU Autotools
|
with packages using GNU Autotools
|
||||||
INSTALL Installation instructions specific to XZ Utils
|
INSTALL Installation instructions specific to XZ Utils
|
||||||
PACKAGERS Information to packagers of XZ Utils
|
PACKAGERS Information to packagers of XZ Utils
|
||||||
|
|
||||||
COPYING XZ Utils copyright and license information
|
COPYING XZ Utils copyright and license information
|
||||||
COPYING.0BSD BSD Zero Clause License
|
|
||||||
COPYING.GPLv2 GNU General Public License version 2
|
COPYING.GPLv2 GNU General Public License version 2
|
||||||
COPYING.GPLv3 GNU General Public License version 3
|
COPYING.GPLv3 GNU General Public License version 3
|
||||||
COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
|
COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
|
||||||
@ -96,9 +94,9 @@ XZ Utils
|
|||||||
|
|
||||||
The command-line tools are documented as man pages. In source code
|
The command-line tools are documented as man pages. In source code
|
||||||
releases (and possibly also in some binary packages), the man pages
|
releases (and possibly also in some binary packages), the man pages
|
||||||
are also provided in plain text (ASCII only) format in the directory
|
are also provided in plain text (ASCII only) and PDF formats in the
|
||||||
"doc/man" to make the man pages more accessible to those whose
|
directory "doc/man" to make the man pages more accessible to those
|
||||||
operating system doesn't provide an easy way to view man pages.
|
whose operating system doesn't provide an easy way to view man pages.
|
||||||
|
|
||||||
|
|
||||||
1.3. Documentation for liblzma
|
1.3. Documentation for liblzma
|
||||||
@ -204,47 +202,77 @@ XZ Utils
|
|||||||
|
|
||||||
https://translationproject.org/html/translators.html
|
https://translationproject.org/html/translators.html
|
||||||
|
|
||||||
Updates to translations won't be accepted by methods that bypass
|
Below are notes and testing instructions specific to xz
|
||||||
the Translation Project because there is a risk of duplicate work:
|
translations.
|
||||||
translation updates made in the xz repository aren't seen by the
|
|
||||||
translators in the Translation Project. If you have found bugs in
|
|
||||||
a translation, please report them to the Language-Team address
|
|
||||||
which can be found near the beginning of the PO file.
|
|
||||||
|
|
||||||
If you find language problems in the original English strings,
|
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.
|
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.
|
||||||
|
|
||||||
4.1. Testing translations
|
Thanks for your help!
|
||||||
|
|
||||||
Testing can be done by installing xz into a temporary directory.
|
|
||||||
|
|
||||||
If building from Git repository (not tarball), generate the
|
|
||||||
Autotools files:
|
|
||||||
|
|
||||||
./autogen.sh
|
|
||||||
|
|
||||||
Create a subdirectory for the build files. The tmp-build directory
|
|
||||||
can be deleted after testing.
|
|
||||||
|
|
||||||
mkdir tmp-build
|
|
||||||
cd tmp-build
|
|
||||||
../configure --disable-shared --enable-debug --prefix=$PWD/inst
|
|
||||||
|
|
||||||
Edit the .po file in the po directory. Then build and install to
|
|
||||||
the "tmp-build/inst" directory, and use translations.bash to see
|
|
||||||
how some of the messages look. Repeat these steps if needed:
|
|
||||||
|
|
||||||
make -C po update-po
|
|
||||||
make -j"$(nproc)" install
|
|
||||||
bash ../debug/translation.bash | less
|
|
||||||
bash ../debug/translation.bash | less -S # For --list outputs
|
|
||||||
|
|
||||||
To test other languages, set the LANGUAGE environment variable
|
|
||||||
before running translations.bash. The value should match the PO file
|
|
||||||
name without the .po suffix. Example:
|
|
||||||
|
|
||||||
export LANGUAGE=fi
|
|
||||||
|
|
||||||
|
|
||||||
5. Other implementations of the .xz format
|
5. Other implementations of the .xz format
|
||||||
@ -269,13 +297,11 @@ XZ Utils
|
|||||||
6. Contact information
|
6. Contact information
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
XZ Utils in general:
|
If you have questions, bug reports, patches etc. related to XZ Utils,
|
||||||
- Home page: https://tukaani.org/xz/
|
the project maintainers Lasse Collin and Jia Tan can be reached via
|
||||||
- Email to maintainer(s): xz@tukaani.org
|
<xz@tukaani.org>.
|
||||||
- IRC: #tukaani on Libera Chat
|
|
||||||
- GitHub: https://github.com/tukaani-project/xz
|
|
||||||
|
|
||||||
Lead maintainer:
|
You might find Lasse also from #tukaani on Libera Chat (IRC).
|
||||||
- Email: Lasse Collin <lasse.collin@tukaani.org>
|
The nick is Larhzu. The channel tends to be pretty quiet,
|
||||||
- IRC: Larhzu on Libera Chat
|
so just ask your question and someone might wake up.
|
||||||
|
|
||||||
|
|||||||
385
THANKS
385
THANKS
@ -3,252 +3,169 @@ Thanks
|
|||||||
======
|
======
|
||||||
|
|
||||||
Some people have helped more, some less, but nevertheless everyone's help
|
Some people have helped more, some less, but nevertheless everyone's help
|
||||||
has been important. :-)
|
has been important. :-) In alphabetical order:
|
||||||
- Adam Borowski
|
- Mark Adler
|
||||||
- Adam Walling
|
|
||||||
- Adrien Nader
|
|
||||||
- Agostino Sarubbo
|
|
||||||
- Alexander Bluhm
|
|
||||||
- Alexander M. Greenham
|
|
||||||
- Alexander Neumann
|
|
||||||
- Alexandre Sauvé
|
|
||||||
- Alexey Tourbin
|
|
||||||
- Anders F. Björklund
|
|
||||||
- Andraž 'ruskie' Levstik
|
|
||||||
- Andre Noll
|
|
||||||
- Andreas K. Hüttel
|
|
||||||
- Andreas Müller
|
|
||||||
- Andreas Schwab
|
|
||||||
- Andreas Zieringer
|
|
||||||
- Andrej Skenderija
|
|
||||||
- Andres Freund
|
|
||||||
- Andrew Dudman
|
|
||||||
- Andrew Murray
|
|
||||||
- Antoine Cœur
|
|
||||||
- Anton Kochkov
|
|
||||||
- Antonio Diaz Diaz
|
|
||||||
- Arkadiusz Miskiewicz
|
|
||||||
- Asgeir Storesund Nilsen
|
|
||||||
- Aziz Chaudhry
|
|
||||||
- Bela Lubkin
|
|
||||||
- Ben Boeckel
|
|
||||||
- Benjamin Buch
|
|
||||||
- Benno Schulenberg
|
|
||||||
- Bernhard Reutner-Fischer
|
|
||||||
- Bert Wesarg
|
|
||||||
- Bhargava Shastry
|
|
||||||
- Bill Glessner
|
|
||||||
- Bjarni Ingi Gislason
|
|
||||||
- Boud Roukema
|
|
||||||
- Brad Smith
|
|
||||||
- Bruce Stark
|
|
||||||
- Cary Lewis
|
|
||||||
- Charles Wilson
|
|
||||||
- Chenxi Mao
|
|
||||||
- Chien Wong
|
|
||||||
- Chris Donawa
|
|
||||||
- Chris McCrohan
|
|
||||||
- Christian Hesse
|
|
||||||
- Christian Kujau
|
|
||||||
- Christian von Roques
|
|
||||||
- Christian Weisgerber
|
|
||||||
- Christoph Junghans
|
|
||||||
- Collin Funk
|
|
||||||
- Conley Moorhous
|
|
||||||
- Cristian Rodríguez
|
|
||||||
- Cristiano Ceglia
|
|
||||||
- Dan Shechter
|
|
||||||
- Dan Stromberg
|
|
||||||
- Dan Weiss
|
|
||||||
- Daniel Leonard
|
|
||||||
- Daniel Mealha Cabrita
|
|
||||||
- Daniel Packard
|
|
||||||
- Daniel Richard G.
|
|
||||||
- David Burklund
|
|
||||||
- Denis Excoffier
|
|
||||||
- Derwin McGeary
|
|
||||||
- Dexter Castor Döpping
|
|
||||||
- Diederik de Haas
|
|
||||||
- Diego Elio Pettenò
|
|
||||||
- Dimitri Papadopoulos Orfanos
|
|
||||||
- Dirk Müller
|
|
||||||
- Douglas Thor
|
|
||||||
- Ed Maste
|
|
||||||
- Elbert Pol
|
|
||||||
- Eli Schwartz
|
|
||||||
- Elijah Almeida Coimbra
|
|
||||||
- Émilie Labbé
|
|
||||||
- Emmanuel Blot
|
|
||||||
- Eric Lindblad
|
|
||||||
- Eric S. Raymond
|
|
||||||
- Étienne Mollier
|
|
||||||
- Evan Nemerson
|
|
||||||
- Fangrui Song
|
|
||||||
- Felix Collin
|
|
||||||
- Filip Palian
|
|
||||||
- Firas Khalil Khana
|
|
||||||
- François Etcheverry
|
|
||||||
- Frank Busse
|
|
||||||
- Frank Prochnow
|
|
||||||
- Fredrik Wikstrom
|
|
||||||
- Gabi Davar
|
|
||||||
- Gabriela Gutierrez
|
|
||||||
- Gilles Espinasse
|
|
||||||
- Gregory Margo
|
|
||||||
- Guillaume Outters
|
|
||||||
- Guiorgy Potskhishvili
|
|
||||||
- H. Peter Anvin
|
- H. Peter Anvin
|
||||||
- Hajin Jang
|
|
||||||
- Hans Jansen
|
|
||||||
- Harri K. Koskinen
|
|
||||||
- Hin-Tak Leung
|
|
||||||
- H.J. Lu
|
|
||||||
- Hongbo Ni
|
|
||||||
- Igor Pavlov
|
|
||||||
- İhsan Doğan
|
|
||||||
- Ilya Kurdyukov
|
|
||||||
- Iouri Kharon
|
|
||||||
- İsmail Dönmez
|
|
||||||
- Ivan A. Melnikov
|
|
||||||
- Jakub Bogusz
|
|
||||||
- James Buren
|
|
||||||
- James M Leddy
|
|
||||||
- Jan Kratochvil
|
|
||||||
- Jan Terje Hansen
|
|
||||||
- Jason Gorski
|
|
||||||
- Jeff Bastian
|
- Jeff Bastian
|
||||||
- Jeffrey Walton
|
- Nelson H. F. Beebe
|
||||||
- Jeroen Roovers
|
|
||||||
- Jim Meyering
|
|
||||||
- Jim Wilcoxson
|
|
||||||
- Joachim Henke
|
|
||||||
- John Paul Adrian Glaubitz
|
|
||||||
- Jonathan Nieder
|
|
||||||
- Jonathan Stott
|
|
||||||
- Joona Kannisto
|
|
||||||
- Jouk Jansen
|
|
||||||
- Juan Manuel Guerrero
|
|
||||||
- Jukka Salmi
|
|
||||||
- Julien Marrec
|
|
||||||
- Jun I Jin
|
|
||||||
- Kai Pastor
|
|
||||||
- Karl Beldan
|
- Karl Beldan
|
||||||
- Karl Berry
|
- Karl Berry
|
||||||
- Keith Patton
|
- Anders F. Björklund
|
||||||
- Kelvin Lee
|
- Emmanuel Blot
|
||||||
- Kevin R. Bulgrien
|
|
||||||
- Kian-Meng Ang
|
|
||||||
- Kim Jinyeong
|
|
||||||
- Kirill A. Korinsky
|
|
||||||
- Kiyoshi Kanazawa
|
|
||||||
- Lars Wirzenius
|
|
||||||
- Li Chenggang
|
|
||||||
- Lizandro Heredia
|
|
||||||
- Loganaden Velvindron
|
|
||||||
- Lorenzo De Liso
|
|
||||||
- Lukas Braune
|
|
||||||
- Maarten Bosmans
|
|
||||||
- Maksym Vatsyk
|
|
||||||
- Marcin Kowalczyk
|
|
||||||
- Marcus Comstedt
|
|
||||||
- Marcus Tillmanns
|
|
||||||
- Marek Černocký
|
|
||||||
- Mark Adler
|
|
||||||
- Mark Wielaard
|
|
||||||
- Markus Duft
|
|
||||||
- Markus Rickert
|
|
||||||
- Martin Blumenstingl
|
|
||||||
- Martin Matuška
|
|
||||||
- Martin Storsjö
|
|
||||||
- Martin Väth
|
|
||||||
- Mathieu Vachon
|
|
||||||
- Matthew Good
|
|
||||||
- Matthieu Rakotojaona
|
|
||||||
- Melanie Blower
|
- Melanie Blower
|
||||||
|
- Alexander Bluhm
|
||||||
|
- Martin Blumenstingl
|
||||||
|
- Ben Boeckel
|
||||||
|
- Jakub Bogusz
|
||||||
|
- Adam Borowski
|
||||||
|
- Maarten Bosmans
|
||||||
|
- Lukas Braune
|
||||||
|
- Benjamin Buch
|
||||||
|
- Trent W. Buck
|
||||||
|
- Kevin R. Bulgrien
|
||||||
|
- James Buren
|
||||||
|
- David Burklund
|
||||||
|
- Frank Busse
|
||||||
|
- Daniel Mealha Cabrita
|
||||||
|
- Milo Casagrande
|
||||||
|
- Marek Černocký
|
||||||
|
- Tomer Chachamu
|
||||||
|
- Vitaly Chikunov
|
||||||
|
- Antoine Cœur
|
||||||
|
- Gabi Davar
|
||||||
|
- İhsan Doğan
|
||||||
|
- Chris Donawa
|
||||||
|
- Andrew Dudman
|
||||||
|
- Markus Duft
|
||||||
|
- İsmail Dönmez
|
||||||
|
- Paul Eggert
|
||||||
|
- Robert Elz
|
||||||
|
- Gilles Espinasse
|
||||||
|
- Denis Excoffier
|
||||||
|
- Vincent Fazio
|
||||||
- Michael Felt
|
- Michael Felt
|
||||||
- Michael Fox
|
- Michael Fox
|
||||||
- Michał Górny
|
|
||||||
- Mike Frysinger
|
- Mike Frysinger
|
||||||
- Mikko Pouru
|
- Daniel Richard G.
|
||||||
- Milo Casagrande
|
|
||||||
- Mohammed Adnène Trojette
|
|
||||||
- Nathan Moinvaziri
|
|
||||||
- Nelson H. F. Beebe
|
|
||||||
- Nicholas Jackson
|
|
||||||
- Ole André Vadla Ravnås
|
|
||||||
- Orange Tsai
|
|
||||||
- Orgad Shaneh
|
|
||||||
- Patrick J. Volkerding
|
|
||||||
- Paul Eggert
|
|
||||||
- Paul Townsend
|
|
||||||
- Pavel Raiskup
|
|
||||||
- Per Øyvind Karlsen
|
|
||||||
- Peter Ivanov
|
|
||||||
- Peter Lawler
|
|
||||||
- Peter O'Gorman
|
|
||||||
- Peter Pallinger
|
|
||||||
- Peter Seiderer
|
|
||||||
- Pierre-Yves Martin
|
|
||||||
- Pilorz Wojciech
|
|
||||||
- Pippijn van Steenhoven
|
|
||||||
- Rafał Mużyło
|
|
||||||
- Rainer Müller
|
|
||||||
- Ralf Wildenhues
|
|
||||||
- Rich Prohaska
|
|
||||||
- Richard Koch
|
|
||||||
- Richard W.M. Jones
|
|
||||||
- Robert Elz
|
|
||||||
- Robert Readman
|
|
||||||
- Roel Bouckaert
|
|
||||||
- Ron Desmond
|
|
||||||
- Ruarí Ødegaard
|
|
||||||
- Rui Paulo
|
|
||||||
- Ryan Colyer
|
|
||||||
- Ryan Young
|
|
||||||
- Sam James
|
|
||||||
- Scott McAllister
|
|
||||||
- Sean Fenian
|
|
||||||
- Sebastian Andrzej Siewior
|
|
||||||
- Sergey Kosukhin
|
|
||||||
- Simon Josefsson
|
|
||||||
- Siteshwar Vashisht
|
|
||||||
- Steffen Nurpmeso
|
|
||||||
- Stephan Kulow
|
|
||||||
- Stephen Sachs
|
|
||||||
- Stuart Shelton
|
|
||||||
- Taiki Tsunekawa
|
|
||||||
- Thomas Klausner
|
|
||||||
- Tobias Lahrmann Hansen
|
|
||||||
- Tobias Stoeckmann
|
|
||||||
- Tomasz Gajc
|
- Tomasz Gajc
|
||||||
- Tomer Chachamu
|
- Bjarni Ingi Gislason
|
||||||
- Torsten Rupp
|
- John Paul Adrian Glaubitz
|
||||||
- Trần Ngọc Quân
|
- Bill Glessner
|
||||||
- Trent W. Buck
|
- Michał Górny
|
||||||
- Victoria Alexia
|
- Jason Gorski
|
||||||
- Vijay Sarvepalli
|
- Juan Manuel Guerrero
|
||||||
- Ville Koskinen
|
- Diederik de Haas
|
||||||
- Ville Skyttä
|
- Joachim Henke
|
||||||
- Vincent Cruz
|
- Christian Hesse
|
||||||
- Vincent Fazio
|
|
||||||
- Vincent Lefevre
|
|
||||||
- Vincent Torri
|
|
||||||
- Vincent Wixsom
|
|
||||||
- Vincenzo Innocente
|
- Vincenzo Innocente
|
||||||
- Vitaly Chikunov
|
- Peter Ivanov
|
||||||
|
- Nicholas Jackson
|
||||||
|
- Sam James
|
||||||
|
- Hajin Jang
|
||||||
|
- Jouk Jansen
|
||||||
|
- Jun I Jin
|
||||||
|
- Kiyoshi Kanazawa
|
||||||
|
- Joona Kannisto
|
||||||
|
- Per Øyvind Karlsen
|
||||||
|
- Iouri Kharon
|
||||||
|
- Thomas Klausner
|
||||||
|
- Richard Koch
|
||||||
|
- Anton Kochkov
|
||||||
|
- Ville Koskinen
|
||||||
|
- Marcin Kowalczyk
|
||||||
|
- Jan Kratochvil
|
||||||
|
- Christian Kujau
|
||||||
|
- Stephan Kulow
|
||||||
|
- Ilya Kurdyukov
|
||||||
|
- Peter Lawler
|
||||||
|
- James M Leddy
|
||||||
|
- Vincent Lefevre
|
||||||
|
- Hin-Tak Leung
|
||||||
|
- Andraž 'ruskie' Levstik
|
||||||
|
- Cary Lewis
|
||||||
- Wim Lewis
|
- Wim Lewis
|
||||||
- Xi Ruoyao
|
|
||||||
- Xin Li
|
- Xin Li
|
||||||
- Yifeng Li
|
- Eric Lindblad
|
||||||
- 榆柳松 (ZhengSen Wang)
|
- Lorenzo De Liso
|
||||||
|
- H.J. Lu
|
||||||
Companies:
|
- Bela Lubkin
|
||||||
- Google
|
- Gregory Margo
|
||||||
- Sandfly Security
|
- Julien Marrec
|
||||||
|
- Ed Maste
|
||||||
Other credits:
|
- Martin Matuška
|
||||||
- cleemy desu wayo working with Trend Micro Zero Day Initiative
|
- Ivan A. Melnikov
|
||||||
- Orange Tsai and splitline from DEVCORE Research Team
|
- Jim Meyering
|
||||||
|
- Arkadiusz Miskiewicz
|
||||||
|
- Nathan Moinvaziri
|
||||||
|
- Étienne Mollier
|
||||||
|
- Conley Moorhous
|
||||||
|
- Rafał Mużyło
|
||||||
|
- Adrien Nader
|
||||||
|
- Evan Nemerson
|
||||||
|
- Hongbo Ni
|
||||||
|
- Jonathan Nieder
|
||||||
|
- Andre Noll
|
||||||
|
- Peter O'Gorman
|
||||||
|
- Dimitri Papadopoulos Orfanos
|
||||||
|
- Daniel Packard
|
||||||
|
- Filip Palian
|
||||||
|
- Peter Pallinger
|
||||||
|
- Rui Paulo
|
||||||
|
- Igor Pavlov
|
||||||
|
- Diego Elio Pettenò
|
||||||
|
- Elbert Pol
|
||||||
|
- Mikko Pouru
|
||||||
|
- Rich Prohaska
|
||||||
|
- Trần Ngọc Quân
|
||||||
|
- Pavel Raiskup
|
||||||
|
- Ole André Vadla Ravnås
|
||||||
|
- Eric S. Raymond
|
||||||
|
- Robert Readman
|
||||||
|
- Bernhard Reutner-Fischer
|
||||||
|
- Markus Rickert
|
||||||
|
- Cristian Rodríguez
|
||||||
|
- Christian von Roques
|
||||||
|
- Boud Roukema
|
||||||
|
- Torsten Rupp
|
||||||
|
- Stephen Sachs
|
||||||
|
- Jukka Salmi
|
||||||
|
- Agostino Sarubbo
|
||||||
|
- Alexandre Sauvé
|
||||||
|
- Benno Schulenberg
|
||||||
|
- Andreas Schwab
|
||||||
|
- Bhargava Shastry
|
||||||
|
- Dan Shechter
|
||||||
|
- Stuart Shelton
|
||||||
|
- Sebastian Andrzej Siewior
|
||||||
|
- Ville Skyttä
|
||||||
|
- Brad Smith
|
||||||
|
- Bruce Stark
|
||||||
|
- Pippijn van Steenhoven
|
||||||
|
- Martin Storsjö
|
||||||
|
- Jonathan Stott
|
||||||
|
- Dan Stromberg
|
||||||
|
- Jia Tan
|
||||||
|
- Vincent Torri
|
||||||
|
- Paul Townsend
|
||||||
|
- Mohammed Adnène Trojette
|
||||||
|
- Alexey Tourbin
|
||||||
|
- Taiki Tsunekawa
|
||||||
|
- Loganaden Velvindron
|
||||||
|
- Patrick J. Volkerding
|
||||||
|
- Martin Väth
|
||||||
|
- Adam Walling
|
||||||
|
- Jeffrey Walton
|
||||||
|
- Christian Weisgerber
|
||||||
|
- Dan Weiss
|
||||||
|
- Bert Wesarg
|
||||||
|
- Fredrik Wikstrom
|
||||||
|
- Jim Wilcoxson
|
||||||
|
- Ralf Wildenhues
|
||||||
|
- Charles Wilson
|
||||||
|
- Lars Wirzenius
|
||||||
|
- Pilorz Wojciech
|
||||||
|
- Ryan Young
|
||||||
|
- Andreas Zieringer
|
||||||
|
|
||||||
Also thanks to all the people who have participated in the Tukaani project.
|
Also thanks to all the people who have participated in the Tukaani project.
|
||||||
|
|
||||||
|
|||||||
29
TODO
29
TODO
@ -5,7 +5,12 @@ XZ Utils To-Do List
|
|||||||
Known bugs
|
Known bugs
|
||||||
----------
|
----------
|
||||||
|
|
||||||
The test suite is incomplete.
|
The test suite is too incomplete.
|
||||||
|
|
||||||
|
If the memory usage limit is less than about 13 MiB, xz is unable to
|
||||||
|
automatically scale down the compression settings enough even though
|
||||||
|
it would be possible by switching from BT2/BT3/BT4 match finder to
|
||||||
|
HC3/HC4.
|
||||||
|
|
||||||
XZ Utils compress some files significantly worse than LZMA Utils.
|
XZ Utils compress some files significantly worse than LZMA Utils.
|
||||||
This is due to faster compression presets used by XZ Utils, and
|
This is due to faster compression presets used by XZ Utils, and
|
||||||
@ -14,8 +19,15 @@ Known bugs
|
|||||||
compress extremely well, so going from compression ratio of 0.003
|
compress extremely well, so going from compression ratio of 0.003
|
||||||
to 0.004 means big relative increase in the compressed file size.
|
to 0.004 means big relative increase in the compressed file size.
|
||||||
|
|
||||||
|
xz doesn't quote unprintable characters when it displays file names
|
||||||
|
given on the command line.
|
||||||
|
|
||||||
tuklib_exit() doesn't block signals => EINTR is possible.
|
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
|
If liblzma has created threads and fork() gets called, liblzma
|
||||||
code will break in the child process unless it calls exec() and
|
code will break in the child process unless it calls exec() and
|
||||||
doesn't touch liblzma.
|
doesn't touch liblzma.
|
||||||
@ -33,6 +45,9 @@ Missing features
|
|||||||
be mostly useful when using a preset dictionary in LZMA2, but
|
be mostly useful when using a preset dictionary in LZMA2, but
|
||||||
it may have other uses too. Compare to deflateCopy() in zlib.
|
it may have other uses too. Compare to deflateCopy() in zlib.
|
||||||
|
|
||||||
|
Support LZMA_FINISH in raw decoder to indicate end of LZMA1 and
|
||||||
|
other streams that don't have an end of payload marker.
|
||||||
|
|
||||||
Adjust dictionary size when the input file size is known.
|
Adjust dictionary size when the input file size is known.
|
||||||
Maybe do this only if an option is given.
|
Maybe do this only if an option is given.
|
||||||
|
|
||||||
@ -56,9 +71,9 @@ Missing features
|
|||||||
Support LZMA_FULL_FLUSH for lzma_stream_decoder() to stop at
|
Support LZMA_FULL_FLUSH for lzma_stream_decoder() to stop at
|
||||||
Block and Stream boundaries.
|
Block and Stream boundaries.
|
||||||
|
|
||||||
Error codes from lzma_code() aren't very specific. A more detailed
|
lzma_strerror() to convert lzma_ret to human readable form?
|
||||||
error message (string) could be provided too. It could be returned
|
This is tricky, because the same error codes are used with
|
||||||
by a new function or use a currently-reserved member of lzma_stream.
|
slightly different meanings, and this cannot be fixed anymore.
|
||||||
|
|
||||||
Make it possible to adjust LZMA2 options in the middle of a Block
|
Make it possible to adjust LZMA2 options in the middle of a Block
|
||||||
so that the encoding speed vs. compression ratio can be optimized
|
so that the encoding speed vs. compression ratio can be optimized
|
||||||
@ -86,3 +101,9 @@ Documentation
|
|||||||
|
|
||||||
Document the LZMA1 and LZMA2 algorithms.
|
Document the LZMA1 and LZMA2 algorithms.
|
||||||
|
|
||||||
|
|
||||||
|
Miscellaneous
|
||||||
|
------------
|
||||||
|
|
||||||
|
Try to get the media type for .xz registered at IANA.
|
||||||
|
|
||||||
|
|||||||
22
autogen.sh
22
autogen.sh
@ -1,10 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
set -e -x
|
set -e -x
|
||||||
@ -17,12 +19,14 @@ ${AUTOCONF:-autoconf}
|
|||||||
${AUTOHEADER:-autoheader}
|
${AUTOHEADER:-autoheader}
|
||||||
${AUTOMAKE:-automake} -acf --foreign
|
${AUTOMAKE:-automake} -acf --foreign
|
||||||
|
|
||||||
# Generate the translated man pages if the "po4a" tool is available.
|
# Generate the translated man pages and the doxygen documentation if the
|
||||||
|
# "po4a" and "doxygen" tools are available.
|
||||||
# This is *NOT* done by "autoreconf -fi" or when "make" is run.
|
# This is *NOT* done by "autoreconf -fi" or when "make" is run.
|
||||||
# Pass --no-po4a to this script to skip this step.
|
# Pass --no-po4a or --no-doxygen to this script to skip these steps.
|
||||||
# It can be useful when you know that po4a isn't available and
|
# 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.
|
# don't want autogen.sh to exit with non-zero exit status.
|
||||||
generate_po4a="y"
|
generate_po4a="y"
|
||||||
|
generate_doxygen="y"
|
||||||
|
|
||||||
for arg in "$@"
|
for arg in "$@"
|
||||||
do
|
do
|
||||||
@ -30,6 +34,10 @@ do
|
|||||||
"--no-po4a")
|
"--no-po4a")
|
||||||
generate_po4a="n"
|
generate_po4a="n"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"--no-doxygen")
|
||||||
|
generate_doxygen="n"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -39,4 +47,10 @@ if test "$generate_po4a" != "n"; then
|
|||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$generate_doxygen" != "n"; then
|
||||||
|
cd doxygen
|
||||||
|
sh update-doxygen
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@ -1,295 +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|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"
|
|
||||||
CLMUL="y"
|
|
||||||
SANDBOX="y"
|
|
||||||
DOXYGEN="y"
|
|
||||||
SRC_DIR="$ABS_DIR/../"
|
|
||||||
DEST_DIR="$SRC_DIR/../xz_build"
|
|
||||||
PHASE="all"
|
|
||||||
ARTIFACTS_DIR_NAME="output"
|
|
||||||
|
|
||||||
[[ -z ${CPU_COUNT} ]] && { CPU_COUNT=$(nproc 2>/dev/null || sysctl -n hw.activecpu); }
|
|
||||||
[[ -z ${MAKEFLAGS} ]] && export MAKEFLAGS="-j${CPU_COUNT} -l${CPU_COUNT}"
|
|
||||||
[[ -z ${CFLAGS} ]] && export CFLAGS="-O2"
|
|
||||||
|
|
||||||
###################
|
|
||||||
# Parse arguments #
|
|
||||||
###################
|
|
||||||
|
|
||||||
while getopts a:b:c:d:l:m:n:s:p:f:w: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";;
|
|
||||||
clmul) CLMUL="n";;
|
|
||||||
sandbox) SANDBOX="n";;
|
|
||||||
doxygen) DOXYGEN="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
|
|
||||||
;;
|
|
||||||
w) WRAPPER="$OPTARG"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unsupported option: $opt"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
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
|
|
||||||
crc32 | 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 "$CLMUL" "" "--disable-clmul-crc"
|
|
||||||
add_extra_option "$SANDBOX" "" "--disable-sandbox"
|
|
||||||
add_extra_option "$DOXYGEN" "--enable-doxygen" ""
|
|
||||||
|
|
||||||
# Workaround a bug in too old config.guess. Version with
|
|
||||||
# timestamp='2022-05-08' would be needed but the autotools-dev
|
|
||||||
# package has 2022-01-09 in Ubuntu 22.04LTS and 24.04LTS. The
|
|
||||||
# bug breaks i386 assembler usage autodetection.
|
|
||||||
if "$SRC_DIR/build-aux/config.guess" | grep -q x86_64-pc-linux-gnux32
|
|
||||||
then
|
|
||||||
EXTRA_OPTIONS="$EXTRA_OPTIONS --build=i686-pc-linux-gnu"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 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" "-DXZ_THREADS=yes" "-DXZ_THREADS=no"
|
|
||||||
|
|
||||||
# Disable MicroLZMA if encoders are not configured.
|
|
||||||
add_extra_option "$ENCODERS" "-DXZ_ENCODERS=$FILTER_LIST" "-DXZ_ENCODERS= -DXZ_MICROLZMA_ENCODER=OFF"
|
|
||||||
|
|
||||||
# Disable MicroLZMA and lzip decoders if decoders are not configured.
|
|
||||||
add_extra_option "$DECODERS" "-DXZ_DECODERS=$FILTER_LIST" "-DXZ_DECODERS= -DXZ_MICROLZMA_DECODER=OFF -DXZ_LZIP_DECODER=OFF"
|
|
||||||
|
|
||||||
# CMake disables the shared library by default.
|
|
||||||
add_extra_option "$SHARED" "-DBUILD_SHARED_LIBS=ON" ""
|
|
||||||
|
|
||||||
add_extra_option "$NATIVE_LANG_SUPPORT" "" "-DXZ_NLS=OFF"
|
|
||||||
add_extra_option "$SMALL" "-DXZ_SMALL=ON" ""
|
|
||||||
add_extra_option "$DOXYGEN" "-DXZ_DOXYGEN=ON" ""
|
|
||||||
|
|
||||||
# Remove old cache file to clear previous settings.
|
|
||||||
rm -f "CMakeCache.txt"
|
|
||||||
cmake "$SRC_DIR/CMakeLists.txt" -B "$DEST_DIR" $EXTRA_OPTIONS -DXZ_CHECKS="$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 VERBOSE=1 LOG_COMPILER="$WRAPPER"
|
|
||||||
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 ${WRAPPER} make CTEST_OUTPUT_ON_FAILURE=1 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,177 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# Look for missing license info in xz.git
|
|
||||||
#
|
|
||||||
# The project doesn't conform to the FSFE REUSE specification for now.
|
|
||||||
# Instead, this script helps in finding files that lack license info.
|
|
||||||
# Pass -v as an argument to get license info from all files in xz.git or,
|
|
||||||
# when .git isn't available, from files extracted from a release tarball
|
|
||||||
# (in case of a release tarball, the tree must be clean of any extra files).
|
|
||||||
#
|
|
||||||
# NOTE: This relies on non-POSIX xargs -0. It's supported on GNU and *BSDs.
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# Author: Lasse Collin
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Print good files too if -v is passed as an argument.
|
|
||||||
VERBOSE=false
|
|
||||||
case $1 in
|
|
||||||
'')
|
|
||||||
;;
|
|
||||||
-v)
|
|
||||||
VERBOSE=true
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 [-v]"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
# Use the C locale so that sorting is always the same.
|
|
||||||
LC_ALL=C
|
|
||||||
export LC_ALL
|
|
||||||
|
|
||||||
|
|
||||||
# String to match the SPDX license identifier tag.
|
|
||||||
# Spell it here in a way that doesn't match regular grep patterns.
|
|
||||||
SPDX_LI='SPDX''-License-''Identifier'':'
|
|
||||||
|
|
||||||
# Pattern for files that don't contain SPDX tags but they are under
|
|
||||||
# a free license that isn't 0BSD.
|
|
||||||
PAT_UNTAGGED_MISC='^COPYING\.
|
|
||||||
^INSTALL\.generic$'
|
|
||||||
|
|
||||||
# Pattern for files that are 0BSD but don't contain SPDX tags.
|
|
||||||
# (The two file format specification files are public domain but
|
|
||||||
# they can be treated as 0BSD too.)
|
|
||||||
PAT_UNTAGGED_0BSD='^(.*/)?\.gitattributes$
|
|
||||||
^(.*/)?\.gitignore$
|
|
||||||
^\.github/SECURITY\.md$
|
|
||||||
^AUTHORS$
|
|
||||||
^COPYING$
|
|
||||||
^ChangeLog$
|
|
||||||
^INSTALL$
|
|
||||||
^NEWS$
|
|
||||||
^PACKAGERS$
|
|
||||||
^(.*/)?README$
|
|
||||||
^THANKS$
|
|
||||||
^TODO$
|
|
||||||
^(.*/)?[^/]+\.txt$
|
|
||||||
^doc/SHA256SUMS$
|
|
||||||
^po/LINGUAS$
|
|
||||||
^src/common/w32_application\.manifest$
|
|
||||||
^tests/xzgrep_expected_output$
|
|
||||||
^tests/files/[^/]+\.(lz|lzma|xz)$'
|
|
||||||
|
|
||||||
# Pattern for files that must be ignored when Git isn't available. This is
|
|
||||||
# useful when this script is run right after extracting a release tarball.
|
|
||||||
PAT_TARBALL_IGNORE='^(m4/)?[^/]*\.m4$
|
|
||||||
^(.*/)?Makefile\.in(\.in)?$
|
|
||||||
^(po|po4a)/.*[^.]..$
|
|
||||||
^ABOUT-NLS$
|
|
||||||
^build-aux/(config\..*|ltmain\.sh|[^.]*)$
|
|
||||||
^config\.h\.in$
|
|
||||||
^configure$'
|
|
||||||
|
|
||||||
|
|
||||||
# Go to the top source dir.
|
|
||||||
cd "$(dirname "$0")/.." || exit 1
|
|
||||||
|
|
||||||
# Get the list of files to check from git if possible.
|
|
||||||
# Otherwise list the whole source tree. This script should pass
|
|
||||||
# if it is run right after extracting a release tarball.
|
|
||||||
if test -d .git && type git > /dev/null 2>&1; then
|
|
||||||
FILES=$(git ls-files) || exit 1
|
|
||||||
IS_TARBALL=false
|
|
||||||
else
|
|
||||||
FILES=$(find . -type f) || exit 1
|
|
||||||
FILES=$(printf '%s\n' "$FILES" | sed 's,^\./,,')
|
|
||||||
IS_TARBALL=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Sort to keep the order consistent.
|
|
||||||
FILES=$(printf '%s\n' "$FILES" | sort)
|
|
||||||
|
|
||||||
|
|
||||||
# Find the tagged files.
|
|
||||||
TAGGED=$(printf '%s\n' "$FILES" \
|
|
||||||
| tr '\n' '\000' | xargs -0r grep -l "$SPDX_LI" --)
|
|
||||||
|
|
||||||
# Find the tagged 0BSD files.
|
|
||||||
TAGGED_0BSD=$(printf '%s\n' "$TAGGED" \
|
|
||||||
| tr '\n' '\000' | xargs -0r grep -l "$SPDX_LI 0BSD" --)
|
|
||||||
|
|
||||||
# Find the tagged non-0BSD files, that is, remove the 0BSD-tagged files
|
|
||||||
# from the list of tagged files.
|
|
||||||
TAGGED_MISC=$(printf '%s\n%s\n' "$TAGGED" "$TAGGED_0BSD" | sort | uniq -u)
|
|
||||||
|
|
||||||
|
|
||||||
# Remove the tagged files from the list.
|
|
||||||
FILES=$(printf '%s\n%s\n' "$FILES" "$TAGGED" | sort | uniq -u)
|
|
||||||
|
|
||||||
# Find the intentionally-untagged files.
|
|
||||||
UNTAGGED_0BSD=$(printf '%s\n' "$FILES" | grep -E "$PAT_UNTAGGED_0BSD")
|
|
||||||
UNTAGGED_MISC=$(printf '%s\n' "$FILES" | grep -E "$PAT_UNTAGGED_MISC")
|
|
||||||
|
|
||||||
# Remove the intentionally-untagged files from the list.
|
|
||||||
FILES=$(printf '%s\n' "$FILES" | grep -Ev \
|
|
||||||
-e "$PAT_UNTAGGED_0BSD" -e "$PAT_UNTAGGED_MISC")
|
|
||||||
|
|
||||||
|
|
||||||
# FIXME: Allow untagged translations if they have a public domain notice.
|
|
||||||
# These are old translations that haven't been updated after 2024-02-14.
|
|
||||||
# Eventually these should go away.
|
|
||||||
PD_PO=$(printf '%s\n' "$FILES" | grep '\.po$' | tr '\n' '\000' \
|
|
||||||
| xargs -0r grep -Fl '# This file is put in the public domain.' --)
|
|
||||||
|
|
||||||
if test -n "$PD_PO"; then
|
|
||||||
# Remove the public domain .po files from the list.
|
|
||||||
FILES=$(printf '%s\n%s\n' "$FILES" "$PD_PO" | sort | uniq -u)
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Remove generated files from the list which don't have SPDX tags but which
|
|
||||||
# can be present in release tarballs. This step is skipped when the file list
|
|
||||||
# is from "git ls-files".
|
|
||||||
GENERATED=
|
|
||||||
if $IS_TARBALL; then
|
|
||||||
GENERATED=$(printf '%s\n' "$FILES" | grep -E "$PAT_TARBALL_IGNORE")
|
|
||||||
FILES=$(printf '%s\n' "$FILES" | grep -Ev "$PAT_TARBALL_IGNORE")
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if $VERBOSE; then
|
|
||||||
printf '# Tagged 0BSD files:\n%s\n\n' "$TAGGED_0BSD"
|
|
||||||
printf '# Intentionally untagged 0BSD:\n%s\n\n' "$UNTAGGED_0BSD"
|
|
||||||
|
|
||||||
# FIXME: Remove when no longer needed.
|
|
||||||
if test -n "$PD_PO"; then
|
|
||||||
printf '# Old public domain translations:\n%s\n\n' "$PD_PO"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '# Tagged non-0BSD files:\n%s\n\n' "$TAGGED_MISC"
|
|
||||||
printf '# Intentionally untagged miscellaneous: \n%s\n\n' \
|
|
||||||
"$UNTAGGED_MISC"
|
|
||||||
|
|
||||||
if test -n "$GENERATED"; then
|
|
||||||
printf '# Generated files whose license was NOT checked:\n%s\n\n' \
|
|
||||||
"$GENERATED"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Look for files with an unknown license and set the exit status accordingly.
|
|
||||||
STATUS=0
|
|
||||||
if test -n "$FILES"; then
|
|
||||||
printf '# ERROR: Licensing is unclear:\n%s\n' "$FILES"
|
|
||||||
STATUS=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit "$STATUS"
|
|
||||||
@ -1,6 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# SPDX-License-Identifier: 0BSD
|
#
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Wrapper for GNU groff to convert man pages to a few formats
|
# Wrapper for GNU groff to convert man pages to a few formats
|
||||||
@ -18,6 +17,9 @@
|
|||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
FORMAT=$1
|
FORMAT=$1
|
||||||
@ -42,12 +44,12 @@ case $FORMAT in
|
|||||||
groff -t -mandoc -Tutf8 -P-c | col -bx
|
groff -t -mandoc -Tutf8 -P-c | col -bx
|
||||||
;;
|
;;
|
||||||
ps)
|
ps)
|
||||||
sed "$SED_PD" | groff -dpaper="$PAPER" -t -mandoc \
|
sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \
|
||||||
-rC1 -rS"$FONT" -Tps -P-p"$PAPER"
|
-rC1 -rS$FONT -Tps -P-p$PAPER
|
||||||
;;
|
;;
|
||||||
pdf)
|
pdf)
|
||||||
sed "$SED_PD" | groff -dpaper="$PAPER" -t -mandoc \
|
sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \
|
||||||
-rC1 -rS"$FONT" -Tps -P-p"$PAPER" | ps2pdf - -
|
-rC1 -rS$FONT -Tps -P-p$PAPER | ps2pdf - -
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo 'Invalid arguments' >&2
|
echo 'Invalid arguments' >&2
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# SPDX-License-Identifier: 0BSD
|
#
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
#
|
#
|
||||||
# Get the version string from version.h and print it out without
|
# Get the version string from version.h and print it out without
|
||||||
@ -10,6 +9,9 @@
|
|||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/
|
sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/
|
||||||
@ -17,5 +19,6 @@ sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/
|
|||||||
s/LZMA_VERSION_STABILITY_STABLE//
|
s/LZMA_VERSION_STABILITY_STABLE//
|
||||||
s/^#define LZMA_VERSION_[MPS][AIT][AJNT][A-Z]* //p' \
|
s/^#define LZMA_VERSION_[MPS][AIT][AJNT][A-Z]* //p' \
|
||||||
src/liblzma/api/lzma/version.h \
|
src/liblzma/api/lzma/version.h \
|
||||||
| sed 'N; N; N; s/\n/./; s/\n/./; s/\n//g' \
|
| tr '\n' '|' \
|
||||||
| tr -d '\012\015\025'
|
| sed 's/|/./; s/|/./; s/|//g' \
|
||||||
|
| tr -d '\r\n'
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
#
|
#
|
||||||
# remove-ordinals.cmake
|
# remove-ordinals.cmake
|
||||||
@ -18,6 +16,9 @@
|
|||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
file(READ "${INPUT_FILE}" STR)
|
file(READ "${INPUT_FILE}" STR)
|
||||||
|
|||||||
@ -1,12 +1,11 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
#
|
#
|
||||||
# tuklib_common.cmake - common functions and macros for tuklib_*.cmake files
|
# tuklib_common.cmake - common functions and macros for tuklib_*.cmake files
|
||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# 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)
|
function(tuklib_add_definitions TARGET_OR_ALL DEFINITIONS)
|
||||||
# DEFINITIONS may be an empty string/list but it's fine here. There is
|
# DEFINITIONS may be an empty string/list but it's fine here. There is
|
||||||
@ -26,29 +25,23 @@ endfunction()
|
|||||||
|
|
||||||
# This is an over-simplified version of AC_USE_SYSTEM_EXTENSIONS in Autoconf
|
# This is an over-simplified version of AC_USE_SYSTEM_EXTENSIONS in Autoconf
|
||||||
# or gl_USE_SYSTEM_EXTENSIONS in gnulib.
|
# or gl_USE_SYSTEM_EXTENSIONS in gnulib.
|
||||||
#
|
macro(tuklib_use_system_extensions TARGET_OR_ALL)
|
||||||
# NOTE: This is a macro because the changes to CMAKE_REQUIRED_DEFINITIONS
|
if(NOT WIN32)
|
||||||
# must be visible in the calling scope.
|
# FIXME? The Solaris-specific __EXTENSIONS__ should be conditional
|
||||||
macro(tuklib_use_system_extensions)
|
# even on Solaris. See gnulib: git log m4/extensions.m4.
|
||||||
if(NOT MSVC)
|
# FIXME? gnulib and autoconf.git has lots of new stuff.
|
||||||
add_compile_definitions(
|
tuklib_add_definitions("${TARGET_OR_ALL}"
|
||||||
_GNU_SOURCE # glibc, musl, mingw-w64
|
_GNU_SOURCE
|
||||||
_NETBSD_SOURCE # NetBSD, MINIX 3
|
__EXTENSIONS__
|
||||||
_OPENBSD_SOURCE # Also NetBSD!
|
_POSIX_PTHREAD_SEMANTICS
|
||||||
__EXTENSIONS__ # Solaris
|
_TANDEM_SOURCE
|
||||||
_POSIX_PTHREAD_SEMANTICS # Solaris
|
_ALL_SOURCE
|
||||||
_DARWIN_C_SOURCE # macOS
|
|
||||||
_TANDEM_SOURCE # HP NonStop
|
|
||||||
_ALL_SOURCE # AIX, z/OS
|
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS
|
list(APPEND CMAKE_REQUIRED_DEFINITIONS
|
||||||
-D_GNU_SOURCE
|
-D_GNU_SOURCE
|
||||||
-D_NETBSD_SOURCE
|
|
||||||
-D_OPENBSD_SOURCE
|
|
||||||
-D__EXTENSIONS__
|
-D__EXTENSIONS__
|
||||||
-D_POSIX_PTHREAD_SEMANTICS
|
-D_POSIX_PTHREAD_SEMANTICS
|
||||||
-D_DARWIN_C_SOURCE
|
|
||||||
-D_TANDEM_SOURCE
|
-D_TANDEM_SOURCE
|
||||||
-D_ALL_SOURCE
|
-D_ALL_SOURCE
|
||||||
)
|
)
|
||||||
|
|||||||
@ -1,15 +1,13 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
#
|
#
|
||||||
# tuklib_cpucores.cmake - see tuklib_cpucores.m4 for description and comments
|
# tuklib_cpucores.cmake - see tuklib_cpucores.m4 for description and comments
|
||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
#############################################################################
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
||||||
include(CMakePushCheckState)
|
|
||||||
include(CheckCSourceCompiles)
|
include(CheckCSourceCompiles)
|
||||||
include(CheckIncludeFile)
|
include(CheckIncludeFile)
|
||||||
|
|
||||||
@ -77,7 +75,6 @@ function(tuklib_cpucores_internal_check)
|
|||||||
#
|
#
|
||||||
# We test sysctl() first and intentionally break the sysctl() test on QNX
|
# We test sysctl() first and intentionally break the sysctl() test on QNX
|
||||||
# so that sysctl() is never used on QNX.
|
# so that sysctl() is never used on QNX.
|
||||||
cmake_push_check_state()
|
|
||||||
check_include_file(sys/param.h HAVE_SYS_PARAM_H)
|
check_include_file(sys/param.h HAVE_SYS_PARAM_H)
|
||||||
if(HAVE_SYS_PARAM_H)
|
if(HAVE_SYS_PARAM_H)
|
||||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_PARAM_H)
|
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_PARAM_H)
|
||||||
@ -105,7 +102,6 @@ function(tuklib_cpucores_internal_check)
|
|||||||
}
|
}
|
||||||
"
|
"
|
||||||
TUKLIB_CPUCORES_SYSCTL)
|
TUKLIB_CPUCORES_SYSCTL)
|
||||||
cmake_pop_check_state()
|
|
||||||
if(TUKLIB_CPUCORES_SYSCTL)
|
if(TUKLIB_CPUCORES_SYSCTL)
|
||||||
if(HAVE_SYS_PARAM_H)
|
if(HAVE_SYS_PARAM_H)
|
||||||
set(TUKLIB_CPUCORES_DEFINITIONS
|
set(TUKLIB_CPUCORES_DEFINITIONS
|
||||||
|
|||||||
@ -1,12 +1,11 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
#
|
#
|
||||||
# tuklib_integer.cmake - see tuklib_integer.m4 for description and comments
|
# tuklib_integer.cmake - see tuklib_integer.m4 for description and comments
|
||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
#############################################################################
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
||||||
include(TestBigEndian)
|
include(TestBigEndian)
|
||||||
@ -14,69 +13,6 @@ include(CheckCSourceCompiles)
|
|||||||
include(CheckIncludeFile)
|
include(CheckIncludeFile)
|
||||||
include(CheckSymbolExists)
|
include(CheckSymbolExists)
|
||||||
|
|
||||||
# An internal helper for tuklib_integer that attempts to detect if
|
|
||||||
# -mstrict-align or -mno-strict-align is in effect. This sets the
|
|
||||||
# cache variable TUKLIB_INTEGER_STRICT_ALIGN to ON if OBJDUMP_REGEX
|
|
||||||
# matches the objdump output of a check program. Otherwise it is set to OFF.
|
|
||||||
function(tuklib_integer_internal_strict_align OBJDUMP_REGEX)
|
|
||||||
if(NOT DEFINED TUKLIB_INTEGER_STRICT_ALIGN)
|
|
||||||
# Build a static library because then the function won't be optimized
|
|
||||||
# away, and there won't be any unrelated startup code either.
|
|
||||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
|
||||||
|
|
||||||
# CMake >= 3.25 wouldn't require us to create a temporary file,
|
|
||||||
# but the following method is compatible with 3.20.
|
|
||||||
file(WRITE "${CMAKE_BINARY_DIR}/tuklib_integer_strict_align.c" "
|
|
||||||
#include <string.h>
|
|
||||||
unsigned int check_strict_align(const void *p)
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
memcpy(&i, p, sizeof(i));
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
")
|
|
||||||
|
|
||||||
# Force -O2 because memcpy() won't be optimized out if optimizations
|
|
||||||
# are disabled.
|
|
||||||
try_compile(
|
|
||||||
TRY_COMPILE_RESULT
|
|
||||||
"${CMAKE_BINARY_DIR}"
|
|
||||||
"${CMAKE_BINARY_DIR}/tuklib_integer_strict_align.c"
|
|
||||||
COMPILE_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}"
|
|
||||||
CMAKE_FLAGS "-DCOMPILE_DEFINITIONS=${CMAKE_REQUIRED_FLAGS} -O2"
|
|
||||||
COPY_FILE "${CMAKE_BINARY_DIR}/tuklib_integer_strict_align.a"
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT TRY_COMPILE_RESULT)
|
|
||||||
message(FATAL_ERROR
|
|
||||||
"Compilation of the strict align check failed. "
|
|
||||||
"Either the specified compiler flags are broken "
|
|
||||||
"or ${CMAKE_CURRENT_FUNCTION_LIST_FILE} has a bug.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Use WORKING_DIRECTORY instead of passing the full path to objdump.
|
|
||||||
# This ensures that the pathname won't affect the objdump output,
|
|
||||||
# which could result in an unwanted regex match in the next step.
|
|
||||||
execute_process(
|
|
||||||
COMMAND "${CMAKE_OBJDUMP}" -d "tuklib_integer_strict_align.a"
|
|
||||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
|
|
||||||
OUTPUT_VARIABLE OBJDUMP_OUTPUT
|
|
||||||
RESULT_VARIABLE OBJDUMP_RESULT
|
|
||||||
)
|
|
||||||
|
|
||||||
# FIXME? Should we remove the temporary files here?
|
|
||||||
|
|
||||||
# Look for instructions that load unsigned bytes. If none are found,
|
|
||||||
# assume that -mno-strict-align is in effect.
|
|
||||||
if(OBJDUMP_RESULT STREQUAL "0" AND
|
|
||||||
OBJDUMP_OUTPUT MATCHES "${OBJDUMP_REGEX}")
|
|
||||||
set(TUKLIB_INTEGER_STRICT_ALIGN ON CACHE INTERNAL "")
|
|
||||||
else()
|
|
||||||
set(TUKLIB_INTEGER_STRICT_ALIGN OFF CACHE INTERNAL "")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(tuklib_integer TARGET_OR_ALL)
|
function(tuklib_integer TARGET_OR_ALL)
|
||||||
# Check for endianness. Unlike the Autoconf's AC_C_BIGENDIAN, this doesn't
|
# Check for endianness. Unlike the Autoconf's AC_C_BIGENDIAN, this doesn't
|
||||||
# support Apple universal binaries. The CMake module will leave the
|
# support Apple universal binaries. The CMake module will leave the
|
||||||
@ -123,148 +59,25 @@ function(tuklib_integer TARGET_OR_ALL)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Autodetect if unaligned memory access is fast when the cache variable
|
# Unaligned access is fast on x86(-64), big endian PowerPC, and usually on
|
||||||
# TUKLIB_FAST_UNALIGNED_ACCESS isn't set. The result is stored in
|
# 32/64-bit ARM too. There are others too and ARM could be a false match.
|
||||||
# FAST_UNALIGNED_GUESS. Assume that unaligned access shouldn't be used.
|
#
|
||||||
# Initialize the variable here so that it's never undefined in the
|
# Guess the default value for the option.
|
||||||
# option() command after the if()...endif() block.
|
# 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)
|
set(FAST_UNALIGNED_GUESS OFF)
|
||||||
if(NOT DEFINED TUKLIB_FAST_UNALIGNED_ACCESS)
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES
|
||||||
message(CHECK_START "Check if unaligned memory access should be used")
|
"[Xx3456]86|^[Xx]64|^[Aa][Mm][Dd]64|^[Aa][Rr][Mm]|^aarch|^powerpc|^ppc")
|
||||||
|
if(NOT WORDS_BIGENDIAN OR
|
||||||
# Guess that unaligned access is fast on these archs:
|
NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc|^ppc")
|
||||||
# - 32/64-bit x86 / x86-64
|
|
||||||
# - 32/64-bit big endian PowerPC
|
|
||||||
# - 64-bit little endian PowerPC
|
|
||||||
# - 32/64-bit Loongarch (*)
|
|
||||||
# - Some 32-bit ARM
|
|
||||||
# - Some 64-bit ARM64 (AArch64)
|
|
||||||
# - Some 32/64-bit RISC-V
|
|
||||||
#
|
|
||||||
# (*) See sections 7.4, 8.1, and 8.2:
|
|
||||||
# https://github.com/loongson/la-softdev-convention/blob/v0.2/la-softdev-convention.adoc
|
|
||||||
#
|
|
||||||
# That is, desktop and server processors likely support
|
|
||||||
# unaligned access in hardware but embedded processors
|
|
||||||
# might not. GCC defaults to -mno-strict-align and so
|
|
||||||
# do majority of GNU/Linux distributions. As of
|
|
||||||
# GCC 15.2, there is no predefined macro to detect
|
|
||||||
# if -mstrict-align or -mno-strict-align is in effect.
|
|
||||||
# We use heuristics based on compiler output.
|
|
||||||
#
|
|
||||||
# CMake < 4.1 doesn't provide a standardized/normalized list of arch
|
|
||||||
# names. For example, x86-64 may be "x86_64" (Linux),
|
|
||||||
# "AMD64" (Windows), or even "EM64T" (64-bit WinXP).
|
|
||||||
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" PROCESSOR)
|
|
||||||
|
|
||||||
# CMake 4.1 made CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID useful on many
|
|
||||||
# targets. In earlier versions it's still useful with MSVC with which
|
|
||||||
# CMAKE_SYSTEM_PROCESSOR can refer to the build machine.
|
|
||||||
if(NOT CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "")
|
|
||||||
# CMake 4.2.0 docs say that the list typically has only one entry
|
|
||||||
# except possibly on macOS. On macOS, most (all?) archs support
|
|
||||||
# unaligned access. Just pick the first one from the list.
|
|
||||||
list(GET CMAKE_C_COMPILER_ARCHITECTURE_ID 0 PROCESSOR)
|
|
||||||
string(TOLOWER "${PROCESSOR}" PROCESSOR)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# 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|^riscv" AND
|
|
||||||
NOT PROCESSOR MATCHES "^arm64")
|
|
||||||
# On 32-bit ARM, GCC and Clang # #define __ARM_FEATURE_UNALIGNED
|
|
||||||
# if and only if unaligned access is supported.
|
|
||||||
#
|
|
||||||
# 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-bit ARM supports fast unaligned access.
|
|
||||||
# If MSVC gets RISC-V support then this will assume
|
|
||||||
# fast unaligned access on RISC-V too.
|
|
||||||
check_c_source_compiles("
|
|
||||||
#if !defined(__ARM_FEATURE_UNALIGNED) \
|
|
||||||
&& !defined(__riscv_misaligned_fast) \
|
|
||||||
&& !defined(_MSC_VER)
|
|
||||||
compile error
|
|
||||||
#endif
|
|
||||||
int main(void) { return 0; }
|
|
||||||
"
|
|
||||||
TUKLIB_FAST_UNALIGNED_DEFINED_BY_PREPROCESSOR)
|
|
||||||
if(TUKLIB_FAST_UNALIGNED_DEFINED_BY_PREPROCESSOR)
|
|
||||||
set(FAST_UNALIGNED_GUESS ON)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
elseif(PROCESSOR MATCHES "^aarch64|^arm64")
|
|
||||||
# On ARM64, Clang defines __ARM_FEATURE_UNALIGNED if and only if
|
|
||||||
# unaligned access is supported. However, GCC (at least up to 15.2.0)
|
|
||||||
# defines it even when using -mstrict-align, so autodetection with
|
|
||||||
# this macro doesn't work with GCC on ARM64. (It does work on
|
|
||||||
# 32-bit ARM.) See:
|
|
||||||
#
|
|
||||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111555
|
|
||||||
#
|
|
||||||
# We need three checks:
|
|
||||||
#
|
|
||||||
# 1. If __ARM_FEATURE_UNALIGNED is defined and the
|
|
||||||
# compiler isn't GCC, unaligned access is enabled.
|
|
||||||
# If the compiler is MSVC, unaligned access is
|
|
||||||
# enabled even without __ARM_FEATURE_UNALIGNED.
|
|
||||||
check_c_source_compiles("
|
|
||||||
#if defined(__ARM_FEATURE_UNALIGNED) \
|
|
||||||
&& (!defined(__GNUC__) || defined(__clang__))
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
#else
|
|
||||||
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)
|
|
||||||
else()
|
|
||||||
# 2. If __ARM_FEATURE_UNALIGNED is not defined,
|
|
||||||
# unaligned access is disabled.
|
|
||||||
check_c_source_compiles("
|
|
||||||
#ifdef __ARM_FEATURE_UNALIGNED
|
|
||||||
compile error
|
|
||||||
#endif
|
|
||||||
int main(void) { return 0; }
|
|
||||||
"
|
|
||||||
TUKLIB_FAST_UNALIGNED_NOT_DEFINED_BY_PREPROCESSOR)
|
|
||||||
if(NOT TUKLIB_FAST_UNALIGNED_NOT_DEFINED_BY_PREPROCESSOR)
|
|
||||||
# 3. Use heuristics to detect if -mstrict-align is
|
|
||||||
# in effect when building with GCC.
|
|
||||||
tuklib_integer_internal_strict_align("[ \t]ldrb[ \t]")
|
|
||||||
if(NOT TUKLIB_INTEGER_STRICT_ALIGN)
|
|
||||||
set(FAST_UNALIGNED_GUESS ON)
|
set(FAST_UNALIGNED_GUESS ON)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
elseif(PROCESSOR MATCHES "^loongarch")
|
|
||||||
tuklib_integer_internal_strict_align("[ \t]ld\\.bu[ \t]")
|
|
||||||
if(NOT TUKLIB_INTEGER_STRICT_ALIGN)
|
|
||||||
set(FAST_UNALIGNED_GUESS ON)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(FAST_UNALIGNED_GUESS)
|
|
||||||
message(CHECK_PASS "yes")
|
|
||||||
else()
|
|
||||||
message(CHECK_PASS "no")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
option(TUKLIB_FAST_UNALIGNED_ACCESS
|
option(TUKLIB_FAST_UNALIGNED_ACCESS
|
||||||
"Enable if the system supports *fast* unaligned memory access \
|
"Enable if the system supports *fast* unaligned memory access \
|
||||||
with 16-bit, 32-bit, and 64-bit integers."
|
with 16-bit, 32-bit, and 64-bit integers."
|
||||||
|
|||||||
@ -1,6 +1,3 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
#
|
#
|
||||||
# tuklib_large_file_support.cmake
|
# tuklib_large_file_support.cmake
|
||||||
#
|
#
|
||||||
@ -11,10 +8,11 @@
|
|||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
#############################################################################
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
||||||
include(CMakePushCheckState)
|
|
||||||
include(CheckCSourceCompiles)
|
include(CheckCSourceCompiles)
|
||||||
|
|
||||||
function(tuklib_large_file_support TARGET_OR_ALL)
|
function(tuklib_large_file_support TARGET_OR_ALL)
|
||||||
|
|||||||
@ -1,12 +1,11 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
#
|
#
|
||||||
# tuklib_mbstr.cmake - see tuklib_mbstr.m4 for description and comments
|
# tuklib_mbstr.cmake - see tuklib_mbstr.m4 for description and comments
|
||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
#############################################################################
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
||||||
include(CheckSymbolExists)
|
include(CheckSymbolExists)
|
||||||
@ -18,8 +17,4 @@ function(tuklib_mbstr TARGET_OR_ALL)
|
|||||||
# NOTE: wcwidth() requires _GNU_SOURCE or _XOPEN_SOURCE on GNU/Linux.
|
# NOTE: wcwidth() requires _GNU_SOURCE or _XOPEN_SOURCE on GNU/Linux.
|
||||||
check_symbol_exists(wcwidth wchar.h HAVE_WCWIDTH)
|
check_symbol_exists(wcwidth wchar.h HAVE_WCWIDTH)
|
||||||
tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_WCWIDTH)
|
tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_WCWIDTH)
|
||||||
|
|
||||||
# NOTE: vasprintf() requires _GNU_SOURCE on GNU/Linux.
|
|
||||||
check_symbol_exists(vasprintf stdio.h HAVE_VASPRINTF)
|
|
||||||
tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_VASPRINTF)
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|||||||
@ -1,6 +1,3 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
#
|
#
|
||||||
# tuklib_physmem.cmake - see tuklib_physmem.m4 for description and comments
|
# tuklib_physmem.cmake - see tuklib_physmem.m4 for description and comments
|
||||||
#
|
#
|
||||||
@ -9,10 +6,11 @@
|
|||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
#############################################################################
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
||||||
include(CMakePushCheckState)
|
|
||||||
include(CheckCSourceCompiles)
|
include(CheckCSourceCompiles)
|
||||||
include(CheckIncludeFile)
|
include(CheckIncludeFile)
|
||||||
|
|
||||||
@ -77,11 +75,11 @@ function(tuklib_physmem_internal_check)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# sysctl()
|
# sysctl()
|
||||||
cmake_push_check_state()
|
|
||||||
check_include_file(sys/param.h HAVE_SYS_PARAM_H)
|
check_include_file(sys/param.h HAVE_SYS_PARAM_H)
|
||||||
if(HAVE_SYS_PARAM_H)
|
if(HAVE_SYS_PARAM_H)
|
||||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_PARAM_H)
|
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_PARAM_H)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#ifdef HAVE_SYS_PARAM_H
|
#ifdef HAVE_SYS_PARAM_H
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
@ -97,7 +95,6 @@ function(tuklib_physmem_internal_check)
|
|||||||
}
|
}
|
||||||
"
|
"
|
||||||
TUKLIB_PHYSMEM_SYSCTL)
|
TUKLIB_PHYSMEM_SYSCTL)
|
||||||
cmake_pop_check_state()
|
|
||||||
if(TUKLIB_PHYSMEM_SYSCTL)
|
if(TUKLIB_PHYSMEM_SYSCTL)
|
||||||
if(HAVE_SYS_PARAM_H)
|
if(HAVE_SYS_PARAM_H)
|
||||||
set(TUKLIB_PHYSMEM_DEFINITIONS
|
set(TUKLIB_PHYSMEM_DEFINITIONS
|
||||||
|
|||||||
@ -1,12 +1,11 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
#
|
#
|
||||||
# tuklib_progname.cmake - see tuklib_progname.m4 for description and comments
|
# tuklib_progname.cmake - see tuklib_progname.m4 for description and comments
|
||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
#############################################################################
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
|
||||||
include(CheckSymbolExists)
|
include(CheckSymbolExists)
|
||||||
|
|||||||
426
configure.ac
426
configure.ac
@ -1,12 +1,13 @@
|
|||||||
# -*- Autoconf -*-
|
# -*- 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
|
# 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
|
# NOTE: Don't add useless checks. autoscan detects this and that, but don't
|
||||||
@ -78,8 +79,8 @@ fi
|
|||||||
# Filters #
|
# Filters #
|
||||||
###########
|
###########
|
||||||
|
|
||||||
m4_define([SUPPORTED_FILTERS], [lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,arm64,sparc,riscv])dnl
|
m4_define([SUPPORTED_FILTERS], [lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,arm64,sparc])dnl
|
||||||
m4_define([SIMPLE_FILTERS], [x86,powerpc,ia64,arm,armthumb,arm64,sparc,riscv])
|
m4_define([SIMPLE_FILTERS], [x86,powerpc,ia64,arm,armthumb,arm64,sparc])
|
||||||
m4_define([LZ_FILTERS], [lzma1,lzma2])
|
m4_define([LZ_FILTERS], [lzma1,lzma2])
|
||||||
|
|
||||||
m4_foreach([NAME], [SUPPORTED_FILTERS],
|
m4_foreach([NAME], [SUPPORTED_FILTERS],
|
||||||
@ -309,7 +310,7 @@ case $enable_microlzma in
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
AC_MSG_RESULT([])
|
AC_MSG_RESULT([])
|
||||||
AC_MSG_ERROR([--enable-microlzma accepts only 'yes' or 'no'.])
|
AC_MSG_ERROR([--enable-microlzma accepts only `yes' or `no'.])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
AM_CONDITIONAL(COND_MICROLZMA, test "x$enable_microlzma" = xyes)
|
AM_CONDITIONAL(COND_MICROLZMA, test "x$enable_microlzma" = xyes)
|
||||||
@ -358,17 +359,12 @@ if test "x$enable_assembler" = xyes; then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
case $enable_assembler in
|
case $enable_assembler in
|
||||||
x86)
|
x86 | no)
|
||||||
AC_DEFINE([HAVE_CRC_X86_ASM], [1], [Define to 1 if
|
AC_MSG_RESULT([$enable_assembler])
|
||||||
the 32-bit x86 CRC assembly files are used.])
|
|
||||||
AC_MSG_RESULT([x86])
|
|
||||||
;;
|
|
||||||
no)
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
AC_MSG_RESULT([])
|
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', or `x86' (32-bit).])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
AM_CONDITIONAL(COND_ASM_X86, test "x$enable_assembler" = xx86)
|
AM_CONDITIONAL(COND_ASM_X86, test "x$enable_assembler" = xx86)
|
||||||
@ -384,26 +380,6 @@ AC_ARG_ENABLE([clmul-crc], AS_HELP_STRING([--disable-clmul-crc],
|
|||||||
[], [enable_clmul_crc=yes])
|
[], [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])
|
|
||||||
|
|
||||||
|
|
||||||
################################
|
|
||||||
# LoongArch CRC32 instructions #
|
|
||||||
################################
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([loongarch-crc32], AS_HELP_STRING([--disable-loongarch-crc32],
|
|
||||||
[Do not use LoongArch CRC32 instructions even if support for
|
|
||||||
them is detected.]),
|
|
||||||
[], [enable_loongarch_crc32=yes])
|
|
||||||
|
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
# Size optimization #
|
# Size optimization #
|
||||||
#####################
|
#####################
|
||||||
@ -417,7 +393,7 @@ if test "x$enable_small" = xyes; then
|
|||||||
AC_DEFINE([HAVE_SMALL], [1], [Define to 1 if optimizing for size.])
|
AC_DEFINE([HAVE_SMALL], [1], [Define to 1 if optimizing for size.])
|
||||||
elif test "x$enable_small" != xno; then
|
elif test "x$enable_small" != xno; then
|
||||||
AC_MSG_RESULT([])
|
AC_MSG_RESULT([])
|
||||||
AC_MSG_ERROR([--enable-small accepts only 'yes' or 'no'])
|
AC_MSG_ERROR([--enable-small accepts only `yes' or `no'])
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT([$enable_small])
|
AC_MSG_RESULT([$enable_small])
|
||||||
AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
|
AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
|
||||||
@ -429,8 +405,8 @@ AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
|
|||||||
|
|
||||||
AC_MSG_CHECKING([if threading support is wanted])
|
AC_MSG_CHECKING([if threading support is wanted])
|
||||||
AC_ARG_ENABLE([threads], AS_HELP_STRING([--enable-threads=METHOD],
|
AC_ARG_ENABLE([threads], AS_HELP_STRING([--enable-threads=METHOD],
|
||||||
[Supported METHODS are 'yes', 'no', 'posix', 'win95', and
|
[Supported METHODS are `yes', `no', `posix', `win95', and
|
||||||
'vista'. The default is 'yes'. Using 'no' together with
|
`vista'. The default is `yes'. Using `no' together with
|
||||||
--enable-small makes liblzma thread unsafe.]),
|
--enable-small makes liblzma thread unsafe.]),
|
||||||
[], [enable_threads=yes])
|
[], [enable_threads=yes])
|
||||||
|
|
||||||
@ -457,7 +433,7 @@ case $enable_threads in
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
AC_MSG_RESULT([])
|
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
|
esac
|
||||||
|
|
||||||
@ -531,18 +507,10 @@ AM_CONDITIONAL([COND_SCRIPTS], [test x$enable_scripts != xno])
|
|||||||
|
|
||||||
AC_ARG_ENABLE([doc], [AS_HELP_STRING([--disable-doc],
|
AC_ARG_ENABLE([doc], [AS_HELP_STRING([--disable-doc],
|
||||||
[do not install documentation files to docdir
|
[do not install documentation files to docdir
|
||||||
(man pages are still installed and,
|
(man pages will still be installed)])],
|
||||||
if --enable-doxygen is used,
|
|
||||||
liblzma API documentation is installed too)])],
|
|
||||||
[], [enable_doc=yes])
|
[], [enable_doc=yes])
|
||||||
AM_CONDITIONAL([COND_DOC], [test x$enable_doc != xno])
|
AM_CONDITIONAL([COND_DOC], [test x$enable_doc != xno])
|
||||||
|
|
||||||
AC_ARG_ENABLE([doxygen], [AS_HELP_STRING([--enable-doxygen],
|
|
||||||
[generate HTML version of the liblzma API documentation
|
|
||||||
using Doxygen and install the result to docdir])],
|
|
||||||
[], [enable_doxygen=no])
|
|
||||||
AM_CONDITIONAL([COND_DOXYGEN], [test x$enable_doxygen != xno])
|
|
||||||
|
|
||||||
|
|
||||||
##############
|
##############
|
||||||
# Sandboxing #
|
# Sandboxing #
|
||||||
@ -551,24 +519,20 @@ AM_CONDITIONAL([COND_DOXYGEN], [test x$enable_doxygen != xno])
|
|||||||
AC_MSG_CHECKING([if sandboxing should be used])
|
AC_MSG_CHECKING([if sandboxing should be used])
|
||||||
AC_ARG_ENABLE([sandbox], [AS_HELP_STRING([--enable-sandbox=METHOD],
|
AC_ARG_ENABLE([sandbox], [AS_HELP_STRING([--enable-sandbox=METHOD],
|
||||||
[Sandboxing METHOD can be
|
[Sandboxing METHOD can be
|
||||||
'auto', 'no', 'capsicum', 'pledge', or 'landlock'.
|
`auto', `no', `capsicum', or `pledge'.
|
||||||
The default is 'auto' which enables sandboxing if
|
The default is `auto' which enables sandboxing if
|
||||||
a supported sandboxing method is found.])],
|
a supported sandboxing method is found.])],
|
||||||
[], [enable_sandbox=auto])
|
[], [enable_sandbox=auto])
|
||||||
case $enable_xzdec-$enable_xz-$enable_sandbox in
|
case $enable_sandbox in
|
||||||
no-no-*)
|
auto)
|
||||||
enable_sandbox=no
|
|
||||||
AC_MSG_RESULT([no, --disable-xz and --disable-xzdec was used])
|
|
||||||
;;
|
|
||||||
*-*-auto)
|
|
||||||
AC_MSG_RESULT([maybe (autodetect)])
|
AC_MSG_RESULT([maybe (autodetect)])
|
||||||
;;
|
;;
|
||||||
*-*-no | *-*-capsicum | *-*-pledge | *-*-landlock)
|
no | capsicum | pledge)
|
||||||
AC_MSG_RESULT([$enable_sandbox])
|
AC_MSG_RESULT([$enable_sandbox])
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
AC_MSG_RESULT([])
|
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', `capsicum', or `pledge'.])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -642,38 +606,12 @@ AM_PROG_CC_C_O
|
|||||||
AM_PROG_AS
|
AM_PROG_AS
|
||||||
AC_USE_SYSTEM_EXTENSIONS
|
AC_USE_SYSTEM_EXTENSIONS
|
||||||
|
|
||||||
# If using GCC or compatible compiler, verify that CFLAGS doesn't contain
|
|
||||||
# something that makes -Werror unhappy. It's important to check this after
|
|
||||||
# the above check for system extensions. It adds macros that can trigger,
|
|
||||||
# for example, -Wunused-macros.
|
|
||||||
if test "$GCC" = yes && test "x$SKIP_WERROR_CHECK" != xyes ; then
|
|
||||||
AC_MSG_CHECKING([if the -Werror option is usable])
|
|
||||||
OLD_CFLAGS=$CFLAGS
|
|
||||||
CFLAGS="$CFLAGS -Werror"
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[extern int foo; int foo;]])], [
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
], [
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
AC_MSG_ERROR([
|
|
||||||
CFLAGS contains something that makes -Werror complain (see config.log).
|
|
||||||
This would break certain checks in 'configure'. It is strongly
|
|
||||||
recommended to modify CFLAGS to fix this. If you want to use noisy
|
|
||||||
warning options, for example, -Weverything, it is still possible to
|
|
||||||
add them later when running 'make': make CFLAGS+=-Weverything
|
|
||||||
|
|
||||||
In case you really want to continue with the current CFLAGS, pass
|
|
||||||
'SKIP_WERROR_CHECK=yes' as an argument to 'configure'.
|
|
||||||
])
|
|
||||||
])
|
|
||||||
CFLAGS=$OLD_CFLAGS
|
|
||||||
fi
|
|
||||||
|
|
||||||
AS_CASE([$enable_threads],
|
AS_CASE([$enable_threads],
|
||||||
[posix], [
|
[posix], [
|
||||||
echo
|
echo
|
||||||
echo "POSIX threading support:"
|
echo "POSIX threading support:"
|
||||||
AX_PTHREAD([:]) dnl We don't need the HAVE_PTHREAD macro.
|
AX_PTHREAD([:]) dnl We don't need the HAVE_PTHREAD macro.
|
||||||
LIBS="$PTHREAD_LIBS $LIBS"
|
LIBS="$LIBS $PTHREAD_LIBS"
|
||||||
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
|
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
|
||||||
|
|
||||||
dnl NOTE: PTHREAD_CC is ignored. It would be useful on AIX,
|
dnl NOTE: PTHREAD_CC is ignored. It would be useful on AIX,
|
||||||
@ -684,10 +622,21 @@ AS_CASE([$enable_threads],
|
|||||||
AC_DEFINE([MYTHREAD_POSIX], [1],
|
AC_DEFINE([MYTHREAD_POSIX], [1],
|
||||||
[Define to 1 when using POSIX threads (pthreads).])
|
[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
|
OLD_CFLAGS=$CFLAGS
|
||||||
CFLAGS="$CFLAGS $PTHREAD_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_DECL([CLOCK_MONOTONIC], [AC_DEFINE(
|
||||||
|
[HAVE_CLOCK_MONOTONIC], [1], [Define to 1 if
|
||||||
|
`CLOCK_MONOTONIC' is declared in <time.h>.])], [],
|
||||||
|
[[#include <time.h>]])
|
||||||
CFLAGS=$OLD_CFLAGS
|
CFLAGS=$OLD_CFLAGS
|
||||||
],
|
],
|
||||||
[win95], [
|
[win95], [
|
||||||
@ -758,45 +707,23 @@ fi
|
|||||||
# --with-pic and --without-pic though. As long as neither --with-pic nor
|
# --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
|
# --without-pic is used then we can use #ifdef PIC to detect if the file is
|
||||||
# being built for a shared library.
|
# being built for a shared library.
|
||||||
LINKER_FLAG_UNDEFINED_VERSION=
|
if test "x$enable_symbol_versions" = xno ; then
|
||||||
AS_IF([test "x$enable_symbol_versions" = xno], [
|
|
||||||
enable_symbol_versions=no
|
enable_symbol_versions=no
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
], [test "x$enable_shared" = xno], [
|
elif test "x$enable_shared" = xno ; then
|
||||||
enable_symbol_versions=no
|
enable_symbol_versions=no
|
||||||
AC_MSG_RESULT([no (not building a shared library)])
|
AC_MSG_RESULT([no (not building a shared library)])
|
||||||
], [
|
else
|
||||||
# "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
|
case "$host_cpu-$host_os" in
|
||||||
microblaze*)
|
microblaze*)
|
||||||
# GCC 12 on MicroBlaze doesn't support
|
# GCC 12 on MicroBlaze doesn't support __symver__
|
||||||
# __symver__ attribute. It's simplest and
|
# attribute. It's simplest and safest to use the
|
||||||
# safest to use the generic version on that
|
# generic version on that platform since then only
|
||||||
# platform since then only the linker script
|
# the linker script is needed. The RHEL/CentOS 7
|
||||||
# is needed. The RHEL/CentOS 7 compatibility
|
# compatibility symbols don't matter on MicroBlaze.
|
||||||
# symbols don't matter on MicroBlaze.
|
|
||||||
enable_symbol_versions=generic
|
enable_symbol_versions=generic
|
||||||
;;
|
;;
|
||||||
*-linux*)
|
*-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
|
case "$pic_mode-$enable_static" in
|
||||||
default-*)
|
default-*)
|
||||||
# Use symvers if PIC is defined.
|
# Use symvers if PIC is defined.
|
||||||
@ -817,6 +744,7 @@ AS_IF([test "x$enable_symbol_versions" = xno], [
|
|||||||
possibly picking only src/liblzma/.libs/liblzma.a from the static build.])
|
possibly picking only src/liblzma/.libs/liblzma.a from the static build.])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
enable_symbol_versions=linux
|
||||||
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
|
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
|
||||||
[$have_symbol_versions_linux],
|
[$have_symbol_versions_linux],
|
||||||
[Define to 1 to if GNU/Linux-specific details
|
[Define to 1 to if GNU/Linux-specific details
|
||||||
@ -827,39 +755,18 @@ AS_IF([test "x$enable_symbol_versions" = xno], [
|
|||||||
time with Libtool if neither --with-pic nor
|
time with Libtool if neither --with-pic nor
|
||||||
--without-pic is used). This define must be
|
--without-pic is used). This define must be
|
||||||
used together with liblzma_linux.map.])
|
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'])
|
enable_symbol_versions=generic
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
AC_MSG_RESULT([yes ($enable_symbol_versions)])
|
AC_MSG_RESULT([yes ($enable_symbol_versions)])
|
||||||
|
fi
|
||||||
# If features are disabled in liblzma, some symbols may be missing.
|
|
||||||
# LLVM's lld defaults to --no-undefined-version and the build breaks
|
|
||||||
# if not all symbols in the version script exist. That is good for
|
|
||||||
# catching errors like typos, but in our case the downside is too big.
|
|
||||||
# Avoid the problem by using --undefined-version if the linker
|
|
||||||
# supports it.
|
|
||||||
#
|
|
||||||
# GNU ld has had --no-undefined-version for a long time but it's not
|
|
||||||
# the default. The opposite option --undefined-version was only added
|
|
||||||
# in 2022, thus we must use --undefined-version conditionally.
|
|
||||||
AC_MSG_CHECKING([if linker supports --undefined-version])
|
|
||||||
OLD_LDFLAGS=$LDFLAGS
|
|
||||||
LDFLAGS="$LDFLAGS -Wl,--undefined-version"
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])], [
|
|
||||||
LINKER_FLAG_UNDEFINED_VERSION=-Wl,--undefined-version
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
], [
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
])
|
|
||||||
LDFLAGS=$OLD_LDFLAGS
|
|
||||||
])
|
|
||||||
|
|
||||||
AM_CONDITIONAL([COND_SYMVERS_LINUX],
|
AM_CONDITIONAL([COND_SYMVERS_LINUX],
|
||||||
[test "x$enable_symbol_versions" = xlinux])
|
[test "x$enable_symbol_versions" = xlinux])
|
||||||
AM_CONDITIONAL([COND_SYMVERS_GENERIC],
|
AM_CONDITIONAL([COND_SYMVERS_GENERIC],
|
||||||
[test "x$enable_symbol_versions" = xgeneric])
|
[test "x$enable_symbol_versions" = xgeneric])
|
||||||
AC_SUBST([LINKER_FLAG_UNDEFINED_VERSION])
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -875,35 +782,6 @@ AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.6])
|
|||||||
AM_GNU_GETTEXT_VERSION([0.19.6])
|
AM_GNU_GETTEXT_VERSION([0.19.6])
|
||||||
AM_GNU_GETTEXT([external])
|
AM_GNU_GETTEXT([external])
|
||||||
|
|
||||||
# The command line tools use UTF-8 on native Windows. Non-ASCII characters
|
|
||||||
# display correctly only when using UCRT and gettext-runtime >= 0.23.1.
|
|
||||||
AS_CASE([$USE_NLS-$host_os],
|
|
||||||
[yes-mingw*], [
|
|
||||||
AC_MSG_CHECKING([for UCRT and gettext-runtime >= 0.23.1])
|
|
||||||
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
|
||||||
#include <libintl.h>
|
|
||||||
|
|
||||||
#ifndef _UCRT
|
|
||||||
#error "Not UCRT"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LIBINTL_VERSION < 0x001701
|
|
||||||
#error "gettext-runtime < 0.23.1"
|
|
||||||
#endif
|
|
||||||
]])], [
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
], [
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
AC_MSG_ERROR([
|
|
||||||
Translation support (--enable-nls) on native Windows requires
|
|
||||||
UCRT and gettext-runtime >= 0.23.1. Use --disable-nls to build
|
|
||||||
with MSVCRT or old gettext-runtime.])
|
|
||||||
])
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
@ -912,6 +790,12 @@ AS_CASE([$USE_NLS-$host_os],
|
|||||||
echo
|
echo
|
||||||
echo "System headers and functions:"
|
echo "System headers and functions:"
|
||||||
|
|
||||||
|
# There is currently no workarounds in this package if some of
|
||||||
|
# these headers are missing.
|
||||||
|
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.
|
# 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.
|
# cpuid.h may be used for detecting x86 processor features at runtime.
|
||||||
AC_CHECK_HEADERS([immintrin.h cpuid.h])
|
AC_CHECK_HEADERS([immintrin.h cpuid.h])
|
||||||
@ -949,6 +833,13 @@ AC_C_BIGENDIAN
|
|||||||
# __attribute__((__constructor__)) can be used for one-time initializations.
|
# __attribute__((__constructor__)) can be used for one-time initializations.
|
||||||
# Use -Werror because some compilers accept unknown attributes and just
|
# Use -Werror because some compilers accept unknown attributes and just
|
||||||
# give a warning.
|
# 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])
|
AC_MSG_CHECKING([if __attribute__((__constructor__)) can be used])
|
||||||
have_func_attribute_constructor=no
|
have_func_attribute_constructor=no
|
||||||
OLD_CFLAGS="$CFLAGS"
|
OLD_CFLAGS="$CFLAGS"
|
||||||
@ -967,6 +858,7 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
|||||||
])
|
])
|
||||||
CFLAGS="$OLD_CFLAGS"
|
CFLAGS="$OLD_CFLAGS"
|
||||||
|
|
||||||
|
|
||||||
# The Win95 threading lacks a thread-safe one-time initialization function.
|
# 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
|
# 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
|
# create the CRC tables. So if small mode is enabled, the threading mode is
|
||||||
@ -981,7 +873,6 @@ if test "x$enable_small$enable_threads$have_func_attribute_constructor" \
|
|||||||
__attribute__((__constructor__))])
|
__attribute__((__constructor__))])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -989,27 +880,11 @@ fi
|
|||||||
# Gnulib replacements as needed
|
# Gnulib replacements as needed
|
||||||
gl_GETOPT
|
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.
|
# Find the best function to set timestamps.
|
||||||
AC_CHECK_FUNCS([futimens futimes futimesat utimes _futime utime], [break])
|
AC_CHECK_FUNCS([futimens futimes futimesat utimes _futime utime], [break])
|
||||||
|
|
||||||
# These are nice to have but not mandatory.
|
# This is nice to have but not mandatory.
|
||||||
AC_CHECK_FUNCS([getrlimit posix_fadvise])
|
AC_CHECK_FUNCS([posix_fadvise])
|
||||||
|
|
||||||
TUKLIB_PROGNAME
|
TUKLIB_PROGNAME
|
||||||
TUKLIB_INTEGER
|
TUKLIB_INTEGER
|
||||||
@ -1096,15 +971,11 @@ AC_CHECK_DECL([_mm_movemask_epi8],
|
|||||||
#
|
#
|
||||||
# If everything above is supported, runtime detection will be used to keep the
|
# If everything above is supported, runtime detection will be used to keep the
|
||||||
# binaries working on systems that don't support the required extensions.
|
# binaries working on systems that don't support the required extensions.
|
||||||
#
|
|
||||||
# NOTE: Use a check that links and not merely compiles to ensure that
|
|
||||||
# missing intrinsics don't get accepted with compilers that allow
|
|
||||||
# implicit function declarations.
|
|
||||||
AC_MSG_CHECKING([if _mm_clmulepi64_si128 is usable])
|
AC_MSG_CHECKING([if _mm_clmulepi64_si128 is usable])
|
||||||
AS_IF([test "x$enable_clmul_crc" = xno], [
|
AS_IF([test "x$enable_clmul_crc" = xno], [
|
||||||
AC_MSG_RESULT([no, --disable-clmul-crc was used])
|
AC_MSG_RESULT([no, --disable-clmul-crc was used])
|
||||||
], [
|
], [
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
|
|
||||||
// CLMUL works on older E2K instruction set but it is slow due to emulation.
|
// CLMUL works on older E2K instruction set but it is slow due to emulation.
|
||||||
@ -1118,162 +989,31 @@ AS_IF([test "x$enable_clmul_crc" = xno], [
|
|||||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
|
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
|
||||||
__attribute__((__target__("ssse3,sse4.1,pclmul")))
|
__attribute__((__target__("ssse3,sse4.1,pclmul")))
|
||||||
#endif
|
#endif
|
||||||
int main(void)
|
__m128i my_clmul(__m128i a)
|
||||||
{
|
{
|
||||||
__m128i a = _mm_set_epi64x(1, 2);
|
const __m128i b = _mm_set_epi64x(1, 2);
|
||||||
a = _mm_clmulepi64_si128(a, a, 0);
|
return _mm_clmulepi64_si128(a, b, 0);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
]])], [
|
]])], [
|
||||||
AC_DEFINE([HAVE_USABLE_CLMUL], [1],
|
AC_DEFINE([HAVE_USABLE_CLMUL], [1],
|
||||||
[Define to 1 if _mm_set_epi64x and
|
[Define to 1 if _mm_set_epi64x and
|
||||||
_mm_clmulepi64_si128 are usable.
|
_mm_clmulepi64_si128 are usable.
|
||||||
See configure.ac for details.])
|
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])
|
|
||||||
], [
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
|
||||||
#include <arm_acle.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
|
|
||||||
__attribute__((__target__("+crc")))
|
|
||||||
#endif
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
return __crc32d(1, 2) != 0;
|
|
||||||
}
|
|
||||||
]])], [
|
|
||||||
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])
|
|
||||||
])
|
|
||||||
|
|
||||||
# Check for ARM64 CRC32 instruction runtime detection.
|
|
||||||
#
|
|
||||||
# - getauxval() is supported on Linux. We also need HWCAP_CRC32 which was
|
|
||||||
# added in glibc 2.24.
|
|
||||||
#
|
|
||||||
# - elf_aux_info() is supported on FreeBSD and OpenBSD >= 7.6.
|
|
||||||
#
|
|
||||||
# - 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], [break])
|
|
||||||
AC_CHECK_DECL([HWCAP_CRC32], [AC_DEFINE([HAVE_HWCAP_CRC32], [1],
|
|
||||||
[Define to 1 if 'HWCAP_CRC32' is declared in <sys/auxv.h>.])],
|
|
||||||
[], [[#include <sys/auxv.h>]])
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# LoongArch CRC32 intrinsics are in larchintrin.h.
|
|
||||||
# These are supported by at least GCC and Clang.
|
|
||||||
#
|
|
||||||
# Only 64-bit LoongArch is currently supported.
|
|
||||||
# It doesn't need runtime detection.
|
|
||||||
AC_MSG_CHECKING([if LoongArch CRC32 instructions are usable])
|
|
||||||
AS_IF([test "x$enable_loongarch_crc32" = xno], [
|
|
||||||
AC_MSG_RESULT([no, --disable-loongarch-crc32 was used])
|
|
||||||
], [
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
|
||||||
#if !(defined(__loongarch__) && __loongarch_grlen >= 64)
|
|
||||||
# error
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <larchintrin.h>
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
return __crc_w_w_w(1, 2);
|
|
||||||
}
|
|
||||||
]])], [
|
|
||||||
AC_DEFINE([HAVE_LOONGARCH_CRC32], [1], [Define to 1 if
|
|
||||||
64-bit LoongArch CRC32 instructions are supported.])
|
|
||||||
enable_loongarch_crc32=yes
|
|
||||||
], [
|
|
||||||
enable_loongarch_crc32=no
|
|
||||||
])
|
|
||||||
AC_MSG_RESULT([$enable_loongarch_crc32])
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# 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_LINK_IFELSE([AC_LANG_SOURCE([[
|
|
||||||
#include <linux/landlock.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
#include <sys/prctl.h>
|
|
||||||
|
|
||||||
int main(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 0;
|
|
||||||
}
|
|
||||||
]])], [
|
|
||||||
enable_sandbox=found
|
|
||||||
|
|
||||||
AS_CASE(["$CC $CFLAGS"], [*-fsanitize=*],
|
|
||||||
[AC_MSG_ERROR([
|
|
||||||
CC or CFLAGS contain '-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([yes])
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
])
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
# Check for sandbox support. If one is found, set enable_sandbox=found.
|
||||||
|
AS_CASE([$enable_sandbox],
|
||||||
|
[auto | capsicum], [
|
||||||
|
AX_CHECK_CAPSICUM([enable_sandbox=found], [:])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
AS_CASE([$enable_sandbox],
|
||||||
|
[auto | pledge], [
|
||||||
|
AC_CHECK_FUNCS([pledge], [enable_sandbox=found ; break])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1323,6 +1063,7 @@ AS_IF([test "$GCC" = yes], [
|
|||||||
-Wall \
|
-Wall \
|
||||||
-Wextra \
|
-Wextra \
|
||||||
-Wvla \
|
-Wvla \
|
||||||
|
-Wc99-c11-compat \
|
||||||
-Wformat=2 \
|
-Wformat=2 \
|
||||||
-Winit-self \
|
-Winit-self \
|
||||||
-Wmissing-include-dirs \
|
-Wmissing-include-dirs \
|
||||||
@ -1346,8 +1087,6 @@ AS_IF([test "$GCC" = yes], [
|
|||||||
-Wmissing-prototypes \
|
-Wmissing-prototypes \
|
||||||
-Wmissing-declarations \
|
-Wmissing-declarations \
|
||||||
-Wredundant-decls \
|
-Wredundant-decls \
|
||||||
-Wimplicit-fallthrough \
|
|
||||||
-Wimplicit-fallthrough=5 \
|
|
||||||
\
|
\
|
||||||
-Wc99-compat \
|
-Wc99-compat \
|
||||||
-Wc11-extensions \
|
-Wc11-extensions \
|
||||||
@ -1360,7 +1099,6 @@ AS_IF([test "$GCC" = yes], [
|
|||||||
-Wdocumentation \
|
-Wdocumentation \
|
||||||
-Wduplicate-enum \
|
-Wduplicate-enum \
|
||||||
-Wempty-translation-unit \
|
-Wempty-translation-unit \
|
||||||
-Wextra-semi-stmt \
|
|
||||||
-Wflexible-array-extensions \
|
-Wflexible-array-extensions \
|
||||||
-Wmissing-variable-declarations \
|
-Wmissing-variable-declarations \
|
||||||
-Wnewline-eof \
|
-Wnewline-eof \
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
## SPDX-License-Identifier: 0BSD
|
##
|
||||||
## Author: Lasse Collin
|
## Author: Lasse Collin
|
||||||
|
##
|
||||||
|
## This file has been put into the public domain.
|
||||||
|
## You can do whatever you want with this file.
|
||||||
|
##
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
translation.bash
|
translation.bash
|
||||||
@ -11,8 +15,7 @@ noinst_PROGRAMS = \
|
|||||||
memusage \
|
memusage \
|
||||||
crc32 \
|
crc32 \
|
||||||
known_sizes \
|
known_sizes \
|
||||||
hex2bin \
|
hex2bin
|
||||||
testfilegen-arm64
|
|
||||||
|
|
||||||
AM_CPPFLAGS = \
|
AM_CPPFLAGS = \
|
||||||
-I$(top_srcdir)/src/common \
|
-I$(top_srcdir)/src/common \
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
// SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
/// \file crc32.c
|
/// \file crc32.c
|
||||||
@ -7,6 +5,9 @@
|
|||||||
//
|
//
|
||||||
// Author: Lasse Collin
|
// Author: Lasse Collin
|
||||||
//
|
//
|
||||||
|
// This file has been put into the public domain.
|
||||||
|
// You can do whatever you want with this file.
|
||||||
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "sysdefs.h"
|
#include "sysdefs.h"
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
// SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
/// \file full_flush.c
|
/// \file full_flush.c
|
||||||
@ -7,6 +5,9 @@
|
|||||||
//
|
//
|
||||||
// Author: Lasse Collin
|
// Author: Lasse Collin
|
||||||
//
|
//
|
||||||
|
// This file has been put into the public domain.
|
||||||
|
// You can do whatever you want with this file.
|
||||||
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "sysdefs.h"
|
#include "sysdefs.h"
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
// SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
/// \file hex2bin.c
|
/// \file hex2bin.c
|
||||||
@ -7,6 +5,9 @@
|
|||||||
//
|
//
|
||||||
// Author: Lasse Collin
|
// Author: Lasse Collin
|
||||||
//
|
//
|
||||||
|
// This file has been put into the public domain.
|
||||||
|
// You can do whatever you want with this file.
|
||||||
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "sysdefs.h"
|
#include "sysdefs.h"
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
// SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
/// \file known_sizes.c
|
/// \file known_sizes.c
|
||||||
@ -11,6 +9,9 @@
|
|||||||
//
|
//
|
||||||
// Author: Lasse Collin
|
// Author: Lasse Collin
|
||||||
//
|
//
|
||||||
|
// This file has been put into the public domain.
|
||||||
|
// You can do whatever you want with this file.
|
||||||
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "sysdefs.h"
|
#include "sysdefs.h"
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
// SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
/// \file memusage.c
|
/// \file memusage.c
|
||||||
@ -7,6 +5,9 @@
|
|||||||
//
|
//
|
||||||
// Author: Lasse Collin
|
// Author: Lasse Collin
|
||||||
//
|
//
|
||||||
|
// This file has been put into the public domain.
|
||||||
|
// You can do whatever you want with this file.
|
||||||
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "sysdefs.h"
|
#include "sysdefs.h"
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
// SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
/// \file repeat.c
|
/// \file repeat.c
|
||||||
@ -11,6 +9,9 @@
|
|||||||
//
|
//
|
||||||
// Author: Lasse Collin
|
// Author: Lasse Collin
|
||||||
//
|
//
|
||||||
|
// This file has been put into the public domain.
|
||||||
|
// You can do whatever you want with this file.
|
||||||
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "sysdefs.h"
|
#include "sysdefs.h"
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
// SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
/// \file sync_flush.c
|
/// \file sync_flush.c
|
||||||
@ -7,6 +5,9 @@
|
|||||||
//
|
//
|
||||||
// Author: Lasse Collin
|
// Author: Lasse Collin
|
||||||
//
|
//
|
||||||
|
// This file has been put into the public domain.
|
||||||
|
// You can do whatever you want with this file.
|
||||||
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "sysdefs.h"
|
#include "sysdefs.h"
|
||||||
|
|||||||
@ -1,116 +0,0 @@
|
|||||||
// SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
/// \file testfilegen-arm64.c
|
|
||||||
/// \brief Generates uncompressed test file for the ARM64 filter
|
|
||||||
//
|
|
||||||
// Author: Lasse Collin
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
|
|
||||||
static uint32_t pc4 = 0;
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
put32le(uint32_t v)
|
|
||||||
{
|
|
||||||
putchar((v >> 0) & 0xFF);
|
|
||||||
putchar((v >> 8) & 0xFF);
|
|
||||||
putchar((v >> 16) & 0xFF);
|
|
||||||
putchar((v >> 24) & 0xFF);
|
|
||||||
++pc4;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
putbl(uint32_t imm)
|
|
||||||
{
|
|
||||||
imm &= (1U << 26) - 1;
|
|
||||||
imm |= 0x25U << 26;
|
|
||||||
put32le(imm);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
putadrp32(uint32_t imm)
|
|
||||||
{
|
|
||||||
imm &= 0x1FFFFFU;
|
|
||||||
|
|
||||||
// fprintf(stderr, "ADRP 0x%08X\n", imm);
|
|
||||||
|
|
||||||
uint32_t instr = 0x90000000;
|
|
||||||
instr |= (pc4 * 5 + 11) & 0x1F;
|
|
||||||
instr |= (imm & 3) << 29;
|
|
||||||
instr |= (imm >> 2) << 5;
|
|
||||||
|
|
||||||
put32le(instr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
extern int
|
|
||||||
main(void)
|
|
||||||
{
|
|
||||||
putbl(0);
|
|
||||||
putbl(0x03FFFFFF);
|
|
||||||
putbl(0x03FFFFFE);
|
|
||||||
putbl(0x03FFFFFD);
|
|
||||||
|
|
||||||
putbl(3);
|
|
||||||
putbl(2);
|
|
||||||
putbl(1);
|
|
||||||
putbl(0);
|
|
||||||
|
|
||||||
|
|
||||||
putbl(0x02000001);
|
|
||||||
putbl(0x02000000);
|
|
||||||
putbl(0x01FFFFFF);
|
|
||||||
putbl(0x01FFFFFE);
|
|
||||||
|
|
||||||
putbl(0x01111117);
|
|
||||||
putbl(0x01111116);
|
|
||||||
putbl(0x01111115);
|
|
||||||
putbl(0x01111114);
|
|
||||||
|
|
||||||
|
|
||||||
putbl(0x02222227);
|
|
||||||
putbl(0x02222226);
|
|
||||||
putbl(0x02222225);
|
|
||||||
putbl(0x02222224);
|
|
||||||
|
|
||||||
putbl(0U - pc4);
|
|
||||||
putbl(0U - pc4);
|
|
||||||
putbl(0U - pc4);
|
|
||||||
putbl(0U - pc4);
|
|
||||||
|
|
||||||
putadrp32(0x00);
|
|
||||||
putadrp32(0x05);
|
|
||||||
putadrp32(0x15);
|
|
||||||
putadrp32(0x25);
|
|
||||||
|
|
||||||
for (unsigned rep = 0; rep < 2; ++rep) {
|
|
||||||
while ((pc4 << 2) & 4095)
|
|
||||||
put32le(0x55555555U);
|
|
||||||
|
|
||||||
for (unsigned i = 10; i <= 21; ++i) {
|
|
||||||
const uint32_t neg = (0x1FFF00 >> (21 - i)) & ~255U;
|
|
||||||
const uint32_t plus = 1U << (i - 1);
|
|
||||||
putadrp32(0x000000 | plus);
|
|
||||||
putadrp32(0x000005 | plus);
|
|
||||||
putadrp32(0x0000FE | plus);
|
|
||||||
putadrp32(0x0000FF | plus);
|
|
||||||
|
|
||||||
putadrp32(0x000000 | neg);
|
|
||||||
putadrp32(0x000005 | neg);
|
|
||||||
putadrp32(0x0000FE | neg);
|
|
||||||
putadrp32(0x0000FF | neg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@ -1,5 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
@ -10,8 +9,8 @@
|
|||||||
# cover most of the cases where mistakes can easily happen.
|
# cover most of the cases where mistakes can easily happen.
|
||||||
#
|
#
|
||||||
# Give the path and filename of the xz executable as an argument. If no
|
# Give the path and filename of the xz executable as an argument. If no
|
||||||
# arguments are given, this script uses src/xz/xz (relative to the current
|
# arguments are given, this script uses ../src/xz/xz (relative to the
|
||||||
# directory).
|
# location of this script).
|
||||||
#
|
#
|
||||||
# You may want to pipe the output of this script to less -S to view the
|
# You may want to pipe the output of this script to less -S to view the
|
||||||
# tables printed by xz --list on a 80-column terminal. On the other hand,
|
# tables printed by xz --list on a 80-column terminal. On the other hand,
|
||||||
@ -21,6 +20,9 @@
|
|||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@ -32,6 +34,10 @@ if [ -n "$1" ]; then
|
|||||||
[ "x${XZ:0:1}" != "x/" ] && XZ="$PWD/$XZ"
|
[ "x${XZ:0:1}" != "x/" ] && XZ="$PWD/$XZ"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Locate top_srcdir and go there.
|
||||||
|
top_srcdir="$(cd -- "$(dirname -- "$0")" && cd .. && pwd)"
|
||||||
|
cd -- "$top_srcdir"
|
||||||
|
|
||||||
# If XZ wasn't already set, use the default location.
|
# If XZ wasn't already set, use the default location.
|
||||||
XZ=${XZ-"$PWD/src/xz/xz"}
|
XZ=${XZ-"$PWD/src/xz/xz"}
|
||||||
if [ "$(type -t "$XZ" || true)" != "file" ]; then
|
if [ "$(type -t "$XZ" || true)" != "file" ]; then
|
||||||
@ -41,20 +47,15 @@ if [ "$(type -t "$XZ" || true)" != "file" ]; then
|
|||||||
fi
|
fi
|
||||||
XZ=$(type -p -- "$XZ")
|
XZ=$(type -p -- "$XZ")
|
||||||
|
|
||||||
# Locate top_srcdir and go there.
|
|
||||||
top_srcdir="$(cd -- "$(dirname -- "$0")" && cd .. && pwd)"
|
|
||||||
cd -- "$top_srcdir"
|
|
||||||
|
|
||||||
# Print the xz version and locale information.
|
# Print the xz version and locale information.
|
||||||
echo "$XZ --version"
|
echo "$XZ --version"
|
||||||
"$XZ" --version
|
"$XZ" --version
|
||||||
echo
|
echo
|
||||||
if [ -d .git ] && type git > /dev/null 2>&1; then
|
if [ -d .git ] && type git > /dev/null 2>&1; then
|
||||||
echo "Source code version in $PWD:"
|
echo "Source code version in $PWD:"
|
||||||
git describe --abbrev=8
|
git describe --abbrev=4
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
echo "LANGUAGE=$LANGUAGE"
|
|
||||||
locale
|
locale
|
||||||
echo
|
echo
|
||||||
|
|
||||||
@ -79,13 +80,17 @@ for CMD in \
|
|||||||
"xz --lzma2=foobarbaz=abcd" \
|
"xz --lzma2=foobarbaz=abcd" \
|
||||||
"xz --lzma2=mf=abcd" \
|
"xz --lzma2=mf=abcd" \
|
||||||
"xz --lzma2=preset=foobarbaz" \
|
"xz --lzma2=preset=foobarbaz" \
|
||||||
|
"xz --lzma2=mf=bt4,nice=2" \
|
||||||
"xz --lzma2=nice=50000" \
|
"xz --lzma2=nice=50000" \
|
||||||
"xz --help" \
|
"xz --help" \
|
||||||
"xz --long-help" \
|
"xz --long-help" \
|
||||||
"xz --filters-help" \
|
|
||||||
"xz --list good-*lzma2*" \
|
"xz --list good-*lzma2*" \
|
||||||
"xz --list good-1-check* unsupported-check.xz" \
|
"xz --list good-1-check*" \
|
||||||
"xz --list --verbose --verbose good-1-arm64-lzma2-1.xz good-1-block_header-1.xz good-1-check-sha256.xz good-2-lzma2.xz"
|
"xz --list --verbose good-*lzma2*" \
|
||||||
|
"xz --list --verbose good-1-check*" \
|
||||||
|
"xz --list --verbose --verbose good-*lzma2*" \
|
||||||
|
"xz --list --verbose --verbose good-1-check*" \
|
||||||
|
"xz --list --verbose --verbose unsupported-check.xz"
|
||||||
do
|
do
|
||||||
echo "-----------------------------------------------------------"
|
echo "-----------------------------------------------------------"
|
||||||
echo
|
echo
|
||||||
|
|||||||
249
doc/SHA256SUMS
249
doc/SHA256SUMS
@ -1,249 +0,0 @@
|
|||||||
61e82b90203cd44c3a712fee5e1efb2a3de62c673cfbe010928856ef2a29b907 xz-4.999.9beta.tar
|
|
||||||
330312c4397608d8b7be362cc7edbfeafa6101614bc2164d816ea767656aa15c xz-4.999.9beta.tar.bz2
|
|
||||||
fa3901d1c034842da47fec1a24a9b5a5bd435f5ecfbb444c168512e2daddb86f xz-4.999.9beta.tar.gz
|
|
||||||
d6649124c7046caea616f599716a559c971c97947e4533c8f25f683310154e8c xz-4.999.9beta.tar.xz
|
|
||||||
0cb40c62ab80536c9cda0125bad445994c0c48f7f9e7c5a3839dbe2be7e7dabc xz-5.0.0.tar
|
|
||||||
47a89e65c4690364a0123871a221e663d23a9fbd1ca756a804b10dd4006056d8 xz-5.0.0.tar.bz2
|
|
||||||
eba9211990a642fc2c35ea02618b710c7fa898d78ccca48b546a07bdde03c44d xz-5.0.0.tar.gz
|
|
||||||
2da61184b5da24b7dd9266416259dbf65212d1ef83726202427233e7fcfe5754 xz-5.0.0.tar.xz
|
|
||||||
2485450f5bdfcdef701454c0ae61eeab144e852a20a14e07b0f3cba2f2a758e9 xz-5.0.0-dos.zip
|
|
||||||
ba46384f060b2c6646f2b342cc9de0e220d057f1ee148b5002eafe7156f27412 xz-5.0.0-windows.zip
|
|
||||||
e4103c00b237a7dfc0f2419ea0aafb739822405facea7e4ecc8fd10dcd82c734 xz-5.0.0-windows.7z
|
|
||||||
e0aa4e3d504d7b27b9d6b76107d0f3656a06a3217dd5006c401aa83d18931b40 xz-5.0.1.tar
|
|
||||||
9b380f502d37085a60821484a3a13747454638927cc36033be64970512451ed8 xz-5.0.1.tar.bz2
|
|
||||||
3770b8872a4322b9502937b4781d523303bf193962c4822899fd3a210878fc80 xz-5.0.1.tar.gz
|
|
||||||
0bd2cb93c172f6cce144493004755aa565d751cb40945bbbb5b5d210c037fce4 xz-5.0.1.tar.xz
|
|
||||||
47337530220b8eb5951c6be1bcdcaee49b32b843e39ea97e0da4c2791e994a98 xz-5.0.1-dos.zip
|
|
||||||
73488c8d475d6634484a65e32aa3ccdc9e56de21b6e8872feaee0d52dc1cd879 xz-5.0.1-windows.zip
|
|
||||||
0505cc1a49b5fd38226a28f145dff6d34bc7f14ff5a1d78a3e08b6fa3398425e xz-5.0.1-windows.7z
|
|
||||||
574b8b84359c263c0bb3c35ee13d53fdf36fac2ea89f0a6234cb5bdc5ae6fe87 xz-5.0.2.tar
|
|
||||||
216df1ddbd591f0da63de31d4b0837eed6d019ccb0e36e57812764c69af645bc xz-5.0.2.tar.bz2
|
|
||||||
57e979baaa40147dde1bbb284e3618f8f18b6532c932648bd57b5aee674b98a7 xz-5.0.2.tar.gz
|
|
||||||
b334483005639a65a37bcc3c33971de2df94764c11a1c3329ce388abb1d95334 xz-5.0.2.tar.xz
|
|
||||||
8d65f9e9b625394f98846fc9a19e79dafeacd7a905aba2e0f28397df099d57c9 xz-5.0.2-windows.zip
|
|
||||||
4e89d87fe9a3d795ed79b93f9d70478107e45ee51047758d4812ac070f13a54a xz-5.0.2-windows.7z
|
|
||||||
74984834d91aadd516f26bcf60e4f82adb74044f9a3f367dca5488ee3c97b8d4 xz-5.0.3.tar
|
|
||||||
5a11b9e17bfcda62319c5a8c4a2062dc81607a316d3f6adff89422d81ec1eae9 xz-5.0.3.tar.bz2
|
|
||||||
10eb4df72dffb2fb14c3d2d82b450e72282ffcb9ee3908a8e5b392b8f09681bf xz-5.0.3.tar.gz
|
|
||||||
3544421e3447fd3f668fd89fb384ff9d312d2730cb860f6b8e09564028de8e32 xz-5.0.3.tar.xz
|
|
||||||
f7e741635976eead2dd5ff592cc98a04261d96df81b7db94a957a96cc2b13cce xz-5.0.3-windows.zip
|
|
||||||
0ed3c11430735e81ec65fb3588b2b8cf4bea6953ad4dda99d9aef4ee231a6036 xz-5.0.3-windows.7z
|
|
||||||
403df1a612036569a1bf54a171a609b6c11370f6b774bcb4940533a72edda1f9 xz-5.0.4.tar
|
|
||||||
5cd9b060d3a1ad396b3be52c9b9311046a1c369e6062aea752658c435629ce92 xz-5.0.4.tar.bz2
|
|
||||||
d67405798dad645965fe51cf4e40c23d1201fb234378d3c44f5a3787142b83b6 xz-5.0.4.tar.gz
|
|
||||||
b7fd25be1ebead021447960804f91006e3fc2f151d7a19948c6a27b4db09b5e9 xz-5.0.4.tar.xz
|
|
||||||
45e5771ebb88bc71805a3fc183bcb49d1e24b21aa6f762d94be6bc11426d9101 xz-5.0.4-dos.zip
|
|
||||||
7ed7d59f71bbfac959a4d4c6eb86733440a0ca115677522c6f5f43ab0e106edc xz-5.0.4-windows.zip
|
|
||||||
7be3642f91ba2fe3339bcb6c458cad303cd9d8ab085537c7b4e96e14c5025de9 xz-5.0.4-windows.7z
|
|
||||||
dd665d739d07ff4b1cae5ecadfad929928fc069d3a617cf682435beadb568e3c xz-5.0.5.tar
|
|
||||||
166c48d2842519bc4f96333bff9e265f8cdda44d38e40594ef3f9bbb52890490 xz-5.0.5.tar.bz2
|
|
||||||
5dcffe6a3726d23d1711a65288de2e215b4960da5092248ce63c99d50093b93a xz-5.0.5.tar.gz
|
|
||||||
3515c74d170d0f6ec00820de63106ad16c07bae55a59c174b4741242c76264a4 xz-5.0.5.tar.xz
|
|
||||||
f5463e2a45788773e33a8056c931d8973da5a00122056df417da24033088daff xz-5.0.5-windows.zip
|
|
||||||
8dbe3357a6ad39cc3076e4f5f0cef9a4ef67461559d4db02f1f06841b74dec44 xz-5.0.5-windows.7z
|
|
||||||
1a8c89616655bf05b04b6dfb62642db02e5fe368d53ee033990be5c26f194a15 xz-5.0.5-with-libtool-2.4.2.418.tar
|
|
||||||
0b6fa3b002c8e15fcc4417001ef0327cfdf6ad53656d7e545c6069ff7657b26d xz-5.0.5-with-libtool-2.4.2.418.tar.gz
|
|
||||||
ea314028ba6aa221de52e0bb4b149db4704a3317e6676adde2607debd026054f xz-5.0.6.tar
|
|
||||||
2f444375cd1d66c04247127e9b5101ce8fb2a8726449f211f05c84c143289408 xz-5.0.6.tar.bz2
|
|
||||||
b6cf4cdc1313556a00848e722625bce40d2cd552c052b0465791c64c9202c3f1 xz-5.0.6.tar.gz
|
|
||||||
9d4136392b6266219fd0f1068256c34180f106ee4214752136c58c0f4864391c xz-5.0.6.tar.xz
|
|
||||||
97ab44b55b252cb2e1b851f6dbdb9811011bad7a80eb42445b0ea63bb1444dc3 xz-5.0.7.tar
|
|
||||||
e8851dc749df2340dac6c9297cb2653eff684e73c3dedf690930119502edd616 xz-5.0.7.tar.bz2
|
|
||||||
f4d2165553b9d0d82fd08bc2eacddeb48ebeb862a5686a603f8c044a2e52c93f xz-5.0.7.tar.gz
|
|
||||||
55146936f33a432282e399ef702b2c3ab06644d9f091a811b39ff483fd190e24 xz-5.0.7.tar.xz
|
|
||||||
e4cb781440e29b2c1e1700730f3fdabf7ccc62317a61931609a098c384bfca96 xz-5.0.8.tar
|
|
||||||
2286f9d90bb0a0de34cba990df1b10cfad0777f00cb2883def26b8ec1b326bda xz-5.0.8.tar.bz2
|
|
||||||
cac71b31ed322a487f1da1f10dfcf47f8855f97ff2c23b92680c7ae7be58babb xz-5.0.8.tar.gz
|
|
||||||
1b5c105c1f372f128bf23ed7a1fd9acf473c88adefb3243d2ea762edca2a0b79 xz-5.0.8.tar.xz
|
|
||||||
812fb3369dde3c81d0765e1a7e00afa0dcfa2e5fa63fdb57e7582147220b2491 xz-5.1.1alpha.tar
|
|
||||||
54e59a83690a4a0ec88a7d7c3bdef90c6b196c892a93463863c71c24fe87951a xz-5.1.1alpha.tar.gz
|
|
||||||
90d7162c001d388d6ef082ccda7b7852c6adc367c492a8935cdf170e49a9ccda xz-5.1.1alpha.tar.xz
|
|
||||||
5d1f5b39d19d1e0b5e7e446b11add769ce68fef781173e116bf8e7d533a90dcb xz-5.1.2alpha.tar
|
|
||||||
70e792d2a67cfbb8f2dffd0feab6ca6e5a4a618d65070fb44a367629d1ba94e5 xz-5.1.2alpha.tar.gz
|
|
||||||
7a9c8dbede0b62e70c75cc0dc14135760a39e9fc6504f87091a59fea87461e18 xz-5.1.2alpha.tar.xz
|
|
||||||
b77cfbdea2f805b69c4c3db40da311555af3fe78271097cf5dec06f7919f07c9 xz-5.1.3alpha.tar
|
|
||||||
9f94506e301d5b6863921bba861a99ba00de384dafb4e5f409679a93e41613d4 xz-5.1.3alpha.tar.gz
|
|
||||||
0413632457df9c65b1ce9dcf78495152fc9307bea5c3267c9996eebf708bf2b6 xz-5.1.3alpha.tar.xz
|
|
||||||
1b70584fdf6c872d7a921dea53772b89962dc0b292b0e3ec0d7a0ca5c860242b xz-5.1.4beta.tar
|
|
||||||
7c47b9e2cfb5be93245d9fcf2bec5b459412b7628c333896dded373dcd0cf0e0 xz-5.1.4beta.tar.gz
|
|
||||||
9f9c6a97959afbbd1315626f253f2d3d48c47e01a921c7f160dab4fde10678b5 xz-5.1.4beta.tar.xz
|
|
||||||
2d066a7ed58c98cd91111d8408fb8896b8100a8ee7e519ce5ea2315c284ba5b0 xz-5.2.0.tar
|
|
||||||
f7357d7455a1670229b3cca021da71dd5d13b789db62743c20624bdffc9cc4a5 xz-5.2.0.tar.bz2
|
|
||||||
231ef369982240bb20ed7cffa52bb12a4a297ce6871f480ab85e8a7ba98bf3d6 xz-5.2.0.tar.gz
|
|
||||||
5962fe32e0b42c7065b4410b7d8ffbf2895e197e97d410c4fc374ea0d7610a14 xz-5.2.0.tar.xz
|
|
||||||
490fc2ad09fea7bc3772bb23432b3dce32d0ef81d413b3b974730436599d9ec5 xz-5.2.0-dos.zip
|
|
||||||
b49c05f82cd05fa67031e72138e40f422d8fd6e2c9ca106016dfd24fae0e629e xz-5.2.0-windows.zip
|
|
||||||
13dfe89a796f4c50f28fac9059d33241746b8e66c540e54d2ac44fd3ea1fd027 xz-5.2.0-windows.7z
|
|
||||||
a9ebc19a511b650c4b678802375505302992214f578a40ce78db089f99c3341f xz-5.2.1.tar
|
|
||||||
679148f497e0bff2c1adce42dee5a23f746e71321c33ebb0f641a302e30c2a80 xz-5.2.1.tar.bz2
|
|
||||||
b918b6648076e74f8d7ae19db5ee663df800049e187259faf5eb997a7b974681 xz-5.2.1.tar.gz
|
|
||||||
6ecdd4d80b12001497df0741d6037f918d270fa0f9a1ab4e2664bf4157ae323c xz-5.2.1.tar.xz
|
|
||||||
e4150f52b2e9937cbe54f0e85325a25a3dc2da68cf643310bd973c9b5c121131 xz-5.2.1-dos.zip
|
|
||||||
2447f5e70dd105900a2957d6c2fad2b5872a6482ba59c1fa0513d03e8b2d10f4 xz-5.2.1-windows.zip
|
|
||||||
afc018a5ab327aac5c8d6e60dc20aae844204b4e86cfac56ec7dd455921dc2ce xz-5.2.1-windows.7z
|
|
||||||
f96b347204dbb984f6e58ecc98f01f823742d403133a461dd8a52993b237bb8c xz-5.2.2.tar
|
|
||||||
6ff5f57a4b9167155e35e6da8b529de69270efb2b4cf3fbabf41a4ee793840b5 xz-5.2.2.tar.bz2
|
|
||||||
73df4d5d34f0468bd57d09f2d8af363e95ed6cc3a4a86129d2f2c366259902a2 xz-5.2.2.tar.gz
|
|
||||||
f341b1906ebcdde291dd619399ae944600edc9193619dd0c0110a5f05bfcc89e xz-5.2.2.tar.xz
|
|
||||||
1a88e9645eca0c3d95e00e8fc4b1a155fa3e527a60bec5a667ca56ed36dbb29b xz-5.2.3.tar
|
|
||||||
fd9ca16de1052aac899ad3495ad20dfa906c27b4a5070102a2ec35ca3a4740c1 xz-5.2.3.tar.bz2
|
|
||||||
71928b357d0a09a12a4b4c5fafca8c31c19b0e7d3b8ebb19622e96f26dbf28cb xz-5.2.3.tar.gz
|
|
||||||
7876096b053ad598c31f6df35f7de5cd9ff2ba3162e5a5554e4fc198447e0347 xz-5.2.3.tar.xz
|
|
||||||
afe73c260e38fdebdd14c9eaab71c19b206ff74cebbdc744b0fa35b77b243220 xz-5.2.3-windows.zip
|
|
||||||
30352e7f1f1605ff0758d10e951f4b3eda108538ecd500b831124dc480e603f3 xz-5.2.3-windows.7z
|
|
||||||
7f77d67aec8207e4fef28c58f19919e51ef469621a58eafd13bf1f80ce956312 xz-5.2.4.tar
|
|
||||||
3313fd2a95f43d88e44264e6b015e7d03053e681860b0d5d3f9baca79c57b7bf xz-5.2.4.tar.bz2
|
|
||||||
b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145 xz-5.2.4.tar.gz
|
|
||||||
9717ae363760dedf573dad241420c5fea86256b65bc21d2cf71b2b12f0544f4b xz-5.2.4.tar.xz
|
|
||||||
9a5163623f435b6fa0844b6b884babd6bf4f8d876ae2d8134deeb296afd49c61 xz-5.2.4-windows.zip
|
|
||||||
efb267a5c7b267cd9e7bf18b29857738b06845178c74f424e3c502609fbf9862 xz-5.2.4-windows.7z
|
|
||||||
cdd92f155d202979dace48d16ea9e1a7c93d09eb2c2c0ac9a207e7544ed4703a xz-5.2.5.tar
|
|
||||||
5117f930900b341493827d63aa910ff5e011e0b994197c3b71c08a20228a42df xz-5.2.5.tar.bz2
|
|
||||||
f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10 xz-5.2.5.tar.gz
|
|
||||||
3e1e518ffc912f86608a8cb35e4bd41ad1aec210df2a47aaa1f95e7f5576ef56 xz-5.2.5.tar.xz
|
|
||||||
601ccfa756da378429eb246b60c52d5e9c7f7b41e95e187c487004c093112789 xz-5.2.5.tar.zst
|
|
||||||
98c6cb1042284fe704ec30083f3fc87364ce9ed2ea51f62bbb0ee9d3448717ec xzgrep-ZDI-CAN-16587.patch
|
|
||||||
0b77f9ac5af53dec0b14773087f8f53e699ad6ce97cc8bfc3ea3cf89535dd335 xz-5.2.5-dos.zip
|
|
||||||
d83b82ca75dfab39a13dda364367b34970c781a9df4d41264db922ac3a8f622d xz-5.2.5-windows.zip
|
|
||||||
bee788dcc8f4a16e232a5a91c5625be1cfad36085eade6983013d1a92a308cfc xz-5.2.5-windows.7z
|
|
||||||
49305a2e5804ba438aa4690377e9b630646da6ae9f3edd0e3e727f92b47dc661 xz-5.2.6.tar
|
|
||||||
13e3402e301b6018f6a71ef0e497f714c6d11e214ae82dab156b81c2a64acb25 xz-5.2.6.tar.bz2
|
|
||||||
a2105abee17bcd2ebd15ced31b4f5eda6e17efd6b10f921a01cda4a44c91b3a0 xz-5.2.6.tar.gz
|
|
||||||
e076ba3439cb7cfc45b908c869f51a8c89f3c9ee9ee982fde28849c015e723a7 xz-5.2.6.tar.xz
|
|
||||||
2716b4067763de99b3901bcc71d3bda233798045cb8189735e611b165b8a7f4f xz-5.2.6.tar.zst
|
|
||||||
6fd6dad79e5b0d3b24a43bc3f79472b62a48d210f1aaa02fb06e5dfad89a4ebc xz-5.2.6-windows.zip
|
|
||||||
88242ad128b131ae7340370cc3c17f8d35e8b238a1db528185b28be2e6c164e1 xz-5.2.6-windows.7z
|
|
||||||
050958af3ccf032f0dba7104743e48ee6ddd9fdf5c21ec905b237e92b221c524 xz-5.2.7.tar
|
|
||||||
b65f1d0c2708e57716f4dd2216989a73847ac6fdb4168ffceb155767e22b834b xz-5.2.7.tar.bz2
|
|
||||||
06327c2ddc81e126a6d9a78b0be5014b976a2c0832f492dcfc4755d7facf6d33 xz-5.2.7.tar.gz
|
|
||||||
8712e9acb0b6b49a97d443458a3067dc5c08a025e02dc5f773176c51dd7cfc69 xz-5.2.7.tar.xz
|
|
||||||
709372e665270acf21a8ef55a8e34ca1f2421e7b5cc3146f4d45cc717fb2bea4 xz-5.2.7.tar.zst
|
|
||||||
30837d396bb50d5cec2c2431686de6f94c537c0551dc884e5cd3ab5551e65f1e xz-5.2.7-windows.zip
|
|
||||||
e9eb1dc1b8beaa5e3c535fbeaaab3780869b08fdfea0aa3ac09a804cc8a84c1a xz-5.2.7-windows.7z
|
|
||||||
96ebba68e4cc33dcd6e47a6326a39babeccc78ed17a08f5db0c11942d2c6fbc4 xz-5.2.8.tar
|
|
||||||
1f8a43d9fcf325d049a31fe4514dc8c44a6d00ce8860d48c4212d1e349d2a3ed xz-5.2.8.tar.bz2
|
|
||||||
ec5cda9f0b91336ab1b881d3d144e8203fcca604e607caca8ae678ddbc29207d xz-5.2.8.tar.gz
|
|
||||||
2424b2711b1d40d2129645d550363896c6853c97528f085f7765092fe68679d4 xz-5.2.8.tar.xz
|
|
||||||
c4092edd7ca1416be97364548cb86d7ef40b07c48a417a7254fb053b68098794 xz-5.2.8.tar.zst
|
|
||||||
f4c1eb727301b9a2acb1ae065562ad0beb7a6512639f8088af1afefcbbcc6260 xz-5.2.8-windows.zip
|
|
||||||
13390e4bd6023e27985cd25a61087e93a248858e7cd01755af8a84f5eef11feb xz-5.2.8-windows.7z
|
|
||||||
18d594e0c3ca307c89c809d636a8878e3d067f0c26983cbc7dc5a586377bc0bd xz-5.2.9.tar
|
|
||||||
b194507fba3a462a753c553149ccdaa168337bcb7deefddd067ba987c83dfce6 xz-5.2.9.tar.bz2
|
|
||||||
e982ea31b81543d7ee2b6fa34c2ad11760e1c50c6f4475add8ba0f2f005f07b4 xz-5.2.9.tar.gz
|
|
||||||
287ef163e7e57561e9de590b2a9037457af24f03a46bbd12bf84f3263679e8d2 xz-5.2.9.tar.xz
|
|
||||||
45cb9dd8785dbb60341450a28c39228cc86146119b4eac48e754a6650bc26931 xz-5.2.9.tar.zst
|
|
||||||
62ac7ba1e223616b365bd7bf1f2231b1c7e0aad111d53e675bef77ef1ac65c43 xz-5.2.9-windows.zip
|
|
||||||
19810e26e202ab2f0b28b70ca785320c006a72826f7bf80c9c9db65db24a23cc xz-5.2.9-windows.7z
|
|
||||||
33aa379c788ffe5af0765296fd9d31fd1fd6d409088ded09af7ff60035694521 xz-5.2.10.tar
|
|
||||||
01b71df61521d9da698ce3c33148bff06a131628ff037398c09482f3a26e5408 xz-5.2.10.tar.bz2
|
|
||||||
eb7a3b2623c9d0135da70ca12808a214be9c019132baaa61c9e1d198d1d9ded3 xz-5.2.10.tar.gz
|
|
||||||
d615974a17299eaa1bf3d0f3b7afa172624755c8885111b17659051869d6f072 xz-5.2.10.tar.xz
|
|
||||||
4cb110fa88b6062758c1c7600f5fc497cbe10372690a7964c611adc3399c8e4b xz-5.2.10.tar.zst
|
|
||||||
02232767320c7587a9f16f9c1c42a1d0bdc94f33d93aa327bb0f0fb67a5f0beb xz-5.2.11.tar
|
|
||||||
7859c47a5e909299e77d0e87e2bafc52fb1d09e35abac48b6426c1be213c5b37 xz-5.2.11.tar.bz2
|
|
||||||
0089d47b966bd9ab48f1d01baf7ce146a3b591716c7477866b807010de3d96ab xz-5.2.11.tar.gz
|
|
||||||
503b4a9fb405e70e1d3912e418fdffe5de27e713e58925fb67e12d20d03a77bc xz-5.2.11.tar.xz
|
|
||||||
1facb7ec3c0950a95e7d5396488fd5c9710c7fec353292962291b2c103777989 xz-5.2.11.tar.zst
|
|
||||||
4d8837034498dcbe64d3cff5f71b5fb6584c1af027eda7548831832efba1c0f4 xz-5.2.12.tar
|
|
||||||
fbedff8eb67e229f2e95eb1ff920b255e405c86c9e1a53d4a6861d9823acff18 xz-5.2.12.tar.bz2
|
|
||||||
61bda930767dcb170a5328a895ec74cab0f5aac4558cdda561c83559db582a13 xz-5.2.12.tar.gz
|
|
||||||
f79a92b84101d19d76be833aecc93e68e56065b61ec737610964cd4f6c54ff2e xz-5.2.12.tar.xz
|
|
||||||
88e6796dada9b65b50ec80a3815be3e4d4ee5fbee17541f112a070d875d59a5d xz-5.2.12.tar.zst
|
|
||||||
515f41be4b7bfd4d2d1ddb939ebd028b8e979bec9baf28b7886e04637a8e54f0 xz-5.2.13.tar
|
|
||||||
620cdbfc31adbc7e3e5cd8c3c3aa9ffed9335f0ddc42719cf9afce5136a978c1 xz-5.2.13.tar.bz2
|
|
||||||
2942a1a8397cd37688f79df9584947d484dd658db088d51b790317eb3184827b xz-5.2.13.tar.gz
|
|
||||||
03eca718652bc8a77f0d2e9ad7744755818aece15cebbc11a3a069cc604ecd84 xz-5.2.13.tar.xz
|
|
||||||
9bbcac67b776385b4345d287e90e345f6c841d4285502aa386515a49696abd5d xz-5.3.1alpha.tar
|
|
||||||
55a92fe16b1dbf2067dda6c0d8fcfff5639b0c8fe926f2a6aad4785699095ec2 xz-5.3.1alpha.tar.xz
|
|
||||||
fe96db09fa3cd289a2e67af8b4045213117e47fbf7fb882bed606556edcf7d5c xz-5.3.2alpha.tar
|
|
||||||
36f4fe561714385eea08945a910a31e6ea5d48611eb7af2fe7966dd030b502d2 xz-5.3.2alpha.tar.gz
|
|
||||||
35b7e753a0da827020bd3fe9c55b34d86b888f69a82a8c5d981e8f89e555360d xz-5.3.2alpha.tar.xz
|
|
||||||
ed8fe42c7f36f707f8b65f70f106c8c06e4cc68322f3277ab31aa17b57ea0927 xz-5.3.3alpha.tar
|
|
||||||
c6d4789a79bab565440784db2e132d6bf03b2e75dd6d66a8102cf002d8dfe926 xz-5.3.3alpha.tar.gz
|
|
||||||
8d50c45575cb943d14dfef2a3f5b1199cc86b5066273d322556cf16e7f75411f xz-5.3.3alpha.tar.xz
|
|
||||||
f3dfc690c1207efd3bcb362dcb5d63df21817c9780ea058c46ef0236febf43e0 xz-5.3.4alpha.tar
|
|
||||||
829e7bc21334b163be9155cb6148f4ca80a573dc453b90e6f1e3bf023764e5f9 xz-5.3.4alpha.tar.gz
|
|
||||||
e0358fb10e59dac8da9b58c14aae59ed9b5b56cc075fbdd884b44d87a35971e9 xz-5.3.4alpha.tar.xz
|
|
||||||
9ad807c4e203ff21b921944c441d5de509d21262f5db81deeae6f56fc97c54ea xz-5.3.5beta.tar
|
|
||||||
542bb3549b2a1988d5d9ce871a5db189d117eb51371c9c1e675f5a0b1870f692 xz-5.3.5beta.tar.gz
|
|
||||||
e08932f382bed9c293a13a3cb72e07464b6caad6d6ceafe9a7545bee501f857c xz-5.3.5beta.tar.xz
|
|
||||||
d2f31178627378b6a2567e028194a4e7c18164925ac0d0364d439a8226bb06a4 xz-5.4.0.tar
|
|
||||||
795ea0494c66d509b052ddc36dc63bd634e59ff2a0f39c16a3b5644dd01d87e6 xz-5.4.0.tar.bz2
|
|
||||||
7471ef5991f690268a8f2be019acec2e0564b7b233ca40035f339fe9a07f830b xz-5.4.0.tar.gz
|
|
||||||
5f260e3b43f75cf43ca43d107dd18209f7d516782956a74ddd53288e02a83a31 xz-5.4.0.tar.xz
|
|
||||||
3d16dc30760af691318cd4bebbae9f7a177ee9a270dbaa47cb58cb1d271cac36 xz-5.4.0.tar.zst
|
|
||||||
48f8a02005c1b0f49eb629daa6567dfeccaa9cb9b6725feaf8b7cd1955bd049d xz-5.4.0-dos.zip
|
|
||||||
749fe4d7c0ce95b5c9cf35e725ed78d6158477e140cf84cde2107ec8465a5e9b xz-5.4.1.tar
|
|
||||||
dd172acb53867a68012f94c17389401b2f274a1aa5ae8f84cbfb8b7e383ea8d3 xz-5.4.1.tar.bz2
|
|
||||||
e4b0f81582efa155ccf27bb88275254a429d44968e488fc94b806f2a61cd3e22 xz-5.4.1.tar.gz
|
|
||||||
5d9827aa1875b21c288f78864bb26d2650b436ea8d2cad364e4921eb6266a5a5 xz-5.4.1.tar.xz
|
|
||||||
9b3d36dd65ecffc9cfef093010061ffe1d48ee34eef0cff69b63cf82b2d099c4 xz-5.4.1.tar.zst
|
|
||||||
3db1ec993b96cfee143df08d780b642ace8b40bb14043537db8a9c951317fafc xz-5.4.2.tar
|
|
||||||
aa49909cbd9028c4666a35fa4975f9a6203ed98154fbb8223ee43ef9ceee97c3 xz-5.4.2.tar.bz2
|
|
||||||
87947679abcf77cc509d8d1b474218fd16b72281e2797360e909deaee1ac9d05 xz-5.4.2.tar.gz
|
|
||||||
3ee13d0f40148625306b90f9622f8c9660b8082884051b0cfe46f18492f88955 xz-5.4.2.tar.xz
|
|
||||||
cd43589df77eb776956c8082a0cbae1d0cd1a2637a6930ea93ba5759639511b1 xz-5.4.2.tar.zst
|
|
||||||
475e09077f4a0cd57306ea1d4cf9ccdfd5add1a2744cf75956725e7fb531ce36 xz-5.4.3.tar
|
|
||||||
9243a04598d7a70c1f567a0143a255581ac5c64b140fd55fd5cbc1e00b0e6f90 xz-5.4.3.tar.bz2
|
|
||||||
1c382e0bc2e4e0af58398a903dd62fff7e510171d2de47a1ebe06d1528e9b7e9 xz-5.4.3.tar.gz
|
|
||||||
92177bef62c3824b4badc524f8abcce54a20b7dbcfb84cde0a2eb8b49159518c xz-5.4.3.tar.xz
|
|
||||||
da51e1105e152e62a72fd81acd9a3e325609b4aed5631c50de3ea58a7f162ebb xz-5.4.3.tar.zst
|
|
||||||
a9ffcc046c96908caed200e2d11b27a4af66b1b4351880f9ba88657a6b6b690c xz-5.4.4.tar
|
|
||||||
0b6fcde1ac38e90433a2556f500c065950b9bcd2d602006efc334782bdfe6296 xz-5.4.4.tar.bz2
|
|
||||||
aae39544e254cfd27e942d35a048d592959bd7a79f9a624afb0498bb5613bdf8 xz-5.4.4.tar.gz
|
|
||||||
705d0d96e94e1840e64dec75fc8d5832d34f6649833bec1ced9c3e08cf88132e xz-5.4.4.tar.xz
|
|
||||||
610c4d79ea3a56bfd1df178578aa17e10a88d58a362b0a7b3fa47321469bae20 xz-5.4.4.tar.zst
|
|
||||||
3ee65a3efb5c96da5e50a0f16567a926258f83f472d2773d40c4d19c8873daad xz-5.4.5.tar
|
|
||||||
8ccf5fff868c006f29522e386fb4c6a1b66463fbca65a4cfc3c4bd596e895e79 xz-5.4.5.tar.bz2
|
|
||||||
135c90b934aee8fbc0d467de87a05cb70d627da36abe518c357a873709e5b7d6 xz-5.4.5.tar.gz
|
|
||||||
da9dec6c12cf2ecf269c31ab65b5de18e8e52b96f35d5bcd08c12b43e6878803 xz-5.4.5.tar.xz
|
|
||||||
9ab5561ce9fed7860695c14b955a0ebec2df9a00fb171862a25910546a1737cc xz-5.4.5.tar.zst
|
|
||||||
b32e1195788a00ca01ea43bc5ea67ecf5bdbaf35ea8faa272da0066e795cb7e2 xz-5.4.6.tar
|
|
||||||
913851b274e8e1d31781ec949f1c23e8dbcf0ecf6e73a2436dc21769dd3e6f49 xz-5.4.6.tar.bz2
|
|
||||||
aeba3e03bf8140ddedf62a0a367158340520f6b384f75ca6045ccc6c0d43fd5c xz-5.4.6.tar.gz
|
|
||||||
b92d4e3a438affcf13362a1305cd9d94ed47ddda22e456a42791e630a5644f5c xz-5.4.6.tar.xz
|
|
||||||
21326933d567a87a7d7484a22cd5723387a71b5934b131dc91ea7495a813bdf3 xz-5.4.6.tar.zst
|
|
||||||
f30cdc66bb071622b382106b0a06ef0e28263e5656a96d88ff55cf92786391f9 xz-5.4.7.tar
|
|
||||||
9976ed9cd0764e962d852d7d519ee1c3a7f87aca3b86e5d021a45650ba3ecb41 xz-5.4.7.tar.bz2
|
|
||||||
8db6664c48ca07908b92baedcfe7f3ba23f49ef2476864518ab5db6723836e71 xz-5.4.7.tar.gz
|
|
||||||
016182c70bb5c7c9eb3465030e3a7f6baa25e17b0e8c0afe92772e6021843ce2 xz-5.4.7.tar.xz
|
|
||||||
f4a16279ebe33a607a41536fd203dc9337bdd6395ef72130cff47dc8276fd9ff xz-5.6.2.tar
|
|
||||||
e12aa03cbd200597bd4ce11d97be2d09a6e6d39a9311ce72c91ac7deacde3171 xz-5.6.2.tar.bz2
|
|
||||||
8bfd20c0e1d86f0402f2497cfa71c6ab62d4cd35fd704276e3140bfb71414519 xz-5.6.2.tar.gz
|
|
||||||
a9db3bb3d64e248a0fae963f8fb6ba851a26ba1822e504dc0efd18a80c626caf xz-5.6.2.tar.xz
|
|
||||||
31f58851acdf0d24d15bce14782dafa5a447ee922eaa39859170277dc9a8fae7 xz-5213-547-562-libtool.patch
|
|
||||||
b55087b6e30fb0cb0175e89022dafd4acb46190a4ec6831cb3e21172fc815186 xz-5.6.3.tar
|
|
||||||
a95a49147b2dbb5487517acc0adcd77f9c2032cf00664eeae352405357d14a6c xz-5.6.3.tar.bz2
|
|
||||||
b1d45295d3f71f25a4c9101bd7c8d16cb56348bbef3bbc738da0351e17c73317 xz-5.6.3.tar.gz
|
|
||||||
db0590629b6f0fa36e74aea5f9731dc6f8df068ce7b7bafa45301832a5eebc3a xz-5.6.3.tar.xz
|
|
||||||
c06b09e74a64616c36ce7c65c8af442d62031135f948d04c704f46d8c2cc2fef xz-5.6.4.tar
|
|
||||||
176d510c30d80a23b8050bbc048f2ecaacb823ae48b6821727ed6591f0df9200 xz-5.6.4.tar.bz2
|
|
||||||
269e3f2e512cbd3314849982014dc199a7b2148cf5c91cedc6db629acdf5e09b xz-5.6.4.tar.gz
|
|
||||||
829ccfe79d769748f7557e7a4429a64d06858e27e1e362e25d01ab7b931d9c95 xz-5.6.4.tar.xz
|
|
||||||
e5403003b4698967680ca57c733e11fdc110426858091cc83c8df8f4322957ee xz-5.6.4-windows.zip
|
|
||||||
a69d83338facb6e9a45147384beb7d7d8ed53b5e2a41e8c059ae0d0260b356ac xz-5.6.4-windows.7z
|
|
||||||
31199267fba9588305c0df3de5d6d9898d00c4ee02f5eee19f79baa427628519 xz-5.7.1alpha.tar
|
|
||||||
ae655a4bec0820f750985ecd270d6802ae0a987bb1cb03d41d9afa37abc2e87c xz-5.7.1alpha.tar.gz
|
|
||||||
c859193b8619f6818326141ee041870d9b76ba83f55c3c94ebcfcb71e1f79e5d xz-5.7.1alpha.tar.xz
|
|
||||||
b75a932fa38515e5d3953242b1e3c2e7edd882504b24280f0e9776d596e9cc0d xz-5.7.2beta.tar
|
|
||||||
608ed92561c9f27a1eead76653c6f63c6a40d0a20ec91753ed508ba40f9703b3 xz-5.7.2beta.tar.gz
|
|
||||||
98a61e45e5917b93ce17d826ef2d11f9331951882b2558675cdf115cdf3f77c8 xz-5.7.2beta.tar.xz
|
|
||||||
bdff4615bf19c46042bced4d7b8c52bdacce61261b39db464d482692c948dd02 xz-5.8.0.tar
|
|
||||||
8c107270289807e2047f35d687b4d7a5bb029137f7c89ebdcfa909cb3b674440 xz-5.8.0.tar.bz2
|
|
||||||
b523c5e47d1490338c5121bdf2a6ecca2bcf0dce05a83ad40a830029cbe6679b xz-5.8.0.tar.gz
|
|
||||||
05ecad9e71919f4fca9f19fbbc979ea28e230188ed123dc6f06b98031ea14542 xz-5.8.0.tar.xz
|
|
||||||
397165cedccb8e16700b8fdd026c3fd7ff2d18923e28cfbf7d0c5f89cd6a50af xz-5.8.0-windows.zip
|
|
||||||
078caa9d406018d4d43df343455f57811e9ba69c1340670a85a0ae6341d42ba3 xz-5.8.0-windows.7z
|
|
||||||
ee188eabc3220684422f62df7a385541a86d2a5c385407f9d8fd94d49b251c4e xz-cve-2025-31115.patch
|
|
||||||
c9789682496d124fd214e665f6aa2f6d3d9e8527a7f0e120f9180c531d322bd6 xz-5.8.1.tar
|
|
||||||
5965c692c4c8800cd4b33ce6d0f6ac9ac9d6ab227b17c512b6561bce4f08d47e xz-5.8.1.tar.bz2
|
|
||||||
507825b599356c10dca1cd720c9d0d0c9d5400b9de300af00e4d1ea150795543 xz-5.8.1.tar.gz
|
|
||||||
0b54f79df85912504de0b14aec7971e3f964491af1812d83447005807513cd9e xz-5.8.1.tar.xz
|
|
||||||
62fdfde73d5c5d293bbb4a96211b29d09adbd56bc6736976e4c9fc9942ae3c67 xz-5.8.1-windows.zip
|
|
||||||
8ed1403fe6c971a2a6ac85fb7b27c8438b83175bc6f3bc49fec06540c904c84d xz-5.8.1-windows.7z
|
|
||||||
b4c8a939220546e275456fac3d19540b152a85dfdb13d6e36289ed8fb49cb700 xz-5.8.2.tar
|
|
||||||
60345d7c0b9c8d7ffa469e96898c300def3669f5047fc76219b819340839f3d8 xz-5.8.2.tar.bz2
|
|
||||||
ce09c50a5962786b83e5da389c90dd2c15ecd0980a258dd01f70f9e7ce58a8f1 xz-5.8.2.tar.gz
|
|
||||||
890966ec3f5d5cc151077879e157c0593500a522f413ac50ba26d22a9a145214 xz-5.8.2.tar.xz
|
|
||||||
c90c4044b9562594d2125409dd4969ce0e281b9db60d2224c2f4a5419c7e2a4e xz-5.8.2-windows.zip
|
|
||||||
a64996b3219461bd959735376eb413fecfe71a6247bcdb870a7be30bf2040fd8 xz-5.8.2-windows.7z
|
|
||||||
@ -1,5 +1,3 @@
|
|||||||
// SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
/// \file 01_compress_easy.c
|
/// \file 01_compress_easy.c
|
||||||
@ -11,6 +9,9 @@
|
|||||||
//
|
//
|
||||||
// Author: Lasse Collin
|
// Author: Lasse Collin
|
||||||
//
|
//
|
||||||
|
// This file has been put into the public domain.
|
||||||
|
// You can do whatever you want with this file.
|
||||||
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
@ -26,7 +27,7 @@ show_usage_and_exit(const char *argv0)
|
|||||||
{
|
{
|
||||||
fprintf(stderr, "Usage: %s PRESET < INFILE > OUTFILE\n"
|
fprintf(stderr, "Usage: %s PRESET < INFILE > OUTFILE\n"
|
||||||
"PRESET is a number 0-9 and can optionally be "
|
"PRESET is a number 0-9 and can optionally be "
|
||||||
"followed by 'e' to indicate extreme preset\n",
|
"followed by `e' to indicate extreme preset\n",
|
||||||
argv0);
|
argv0);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
// SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
/// \file 02_decompress.c
|
/// \file 02_decompress.c
|
||||||
@ -11,6 +9,9 @@
|
|||||||
//
|
//
|
||||||
// Author: Lasse Collin
|
// Author: Lasse Collin
|
||||||
//
|
//
|
||||||
|
// This file has been put into the public domain.
|
||||||
|
// You can do whatever you want with this file.
|
||||||
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
// SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
/// \file 03_compress_custom.c
|
/// \file 03_compress_custom.c
|
||||||
@ -11,6 +9,9 @@
|
|||||||
//
|
//
|
||||||
// Author: Lasse Collin
|
// Author: Lasse Collin
|
||||||
//
|
//
|
||||||
|
// This file has been put into the public domain.
|
||||||
|
// You can do whatever you want with this file.
|
||||||
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
@ -45,7 +46,7 @@ init_encoder(lzma_stream *strm)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now we could customize the LZMA2 options if we wanted. For example,
|
// Now we could customize the LZMA2 options if we wanted. For example,
|
||||||
// we could set the dictionary size (opt_lzma2.dict_size) to
|
// we could set the the dictionary size (opt_lzma2.dict_size) to
|
||||||
// something else than the default (8 MiB) of the default preset.
|
// something else than the default (8 MiB) of the default preset.
|
||||||
// See lzma/lzma12.h for details of all LZMA2 options.
|
// See lzma/lzma12.h for details of all LZMA2 options.
|
||||||
//
|
//
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
// SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
/// \file 04_compress_easy_mt.c
|
/// \file 04_compress_easy_mt.c
|
||||||
@ -11,6 +9,9 @@
|
|||||||
//
|
//
|
||||||
// Author: Lasse Collin
|
// Author: Lasse Collin
|
||||||
//
|
//
|
||||||
|
// This file has been put into the public domain.
|
||||||
|
// You can do whatever you want with this file.
|
||||||
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
// SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
/// \file 11_file_info.c
|
/// \file 11_file_info.c
|
||||||
@ -11,6 +9,9 @@
|
|||||||
//
|
//
|
||||||
// Author: Lasse Collin
|
// Author: Lasse Collin
|
||||||
//
|
//
|
||||||
|
// This file has been put into the public domain.
|
||||||
|
// You can do whatever you want with this file.
|
||||||
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
@ -32,7 +33,7 @@ print_file_size(lzma_stream *strm, FILE *infile, const char *filename)
|
|||||||
// large files on 32-bit systems (POSIX versions fseeko() and
|
// large files on 32-bit systems (POSIX versions fseeko() and
|
||||||
// ftello() can support large files).
|
// ftello() can support large files).
|
||||||
if (fseek(infile, 0, SEEK_END)) {
|
if (fseek(infile, 0, SEEK_END)) {
|
||||||
fprintf(stderr, "Error seeking the file '%s': %s\n",
|
fprintf(stderr, "Error seeking the file `%s': %s\n",
|
||||||
filename, strerror(errno));
|
filename, strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -79,7 +80,7 @@ print_file_size(lzma_stream *strm, FILE *infile, const char *filename)
|
|||||||
|
|
||||||
if (ferror(infile)) {
|
if (ferror(infile)) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Error reading from '%s': %s\n",
|
"Error reading from `%s': %s\n",
|
||||||
filename, strerror(errno));
|
filename, strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -103,7 +104,7 @@ print_file_size(lzma_stream *strm, FILE *infile, const char *filename)
|
|||||||
// switch fseeko() or lseek().
|
// switch fseeko() or lseek().
|
||||||
if (fseek(infile, (long)(strm->seek_pos), SEEK_SET)) {
|
if (fseek(infile, (long)(strm->seek_pos), SEEK_SET)) {
|
||||||
fprintf(stderr, "Error seeking the "
|
fprintf(stderr, "Error seeking the "
|
||||||
"file '%s': %s\n",
|
"file `%s': %s\n",
|
||||||
filename, strerror(errno));
|
filename, strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -132,24 +133,24 @@ print_file_size(lzma_stream *strm, FILE *infile, const char *filename)
|
|||||||
|
|
||||||
case LZMA_FORMAT_ERROR:
|
case LZMA_FORMAT_ERROR:
|
||||||
// .xz magic bytes weren't found.
|
// .xz magic bytes weren't found.
|
||||||
fprintf(stderr, "The file '%s' is not "
|
fprintf(stderr, "The file `%s' is not "
|
||||||
"in the .xz format\n", filename);
|
"in the .xz format\n", filename);
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case LZMA_OPTIONS_ERROR:
|
case LZMA_OPTIONS_ERROR:
|
||||||
fprintf(stderr, "The file '%s' has .xz headers that "
|
fprintf(stderr, "The file `%s' has .xz headers that "
|
||||||
"are not supported by this liblzma "
|
"are not supported by this liblzma "
|
||||||
"version\n", filename);
|
"version\n", filename);
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case LZMA_DATA_ERROR:
|
case LZMA_DATA_ERROR:
|
||||||
fprintf(stderr, "The file '%s' is corrupt\n",
|
fprintf(stderr, "The file `%s' is corrupt\n",
|
||||||
filename);
|
filename);
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case LZMA_MEM_ERROR:
|
case LZMA_MEM_ERROR:
|
||||||
fprintf(stderr, "Memory allocation failed when "
|
fprintf(stderr, "Memory allocation failed when "
|
||||||
"decoding the file '%s'\n", filename);
|
"decoding the file `%s'\n", filename);
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// LZMA_MEMLIMIT_ERROR shouldn't happen because we used
|
// LZMA_MEMLIMIT_ERROR shouldn't happen because we used
|
||||||
@ -182,7 +183,7 @@ main(int argc, char **argv)
|
|||||||
FILE *infile = fopen(argv[i], "rb");
|
FILE *infile = fopen(argv[i], "rb");
|
||||||
|
|
||||||
if (infile == NULL) {
|
if (infile == NULL) {
|
||||||
fprintf(stderr, "Cannot open the file '%s': %s\n",
|
fprintf(stderr, "Cannot open the file `%s': %s\n",
|
||||||
argv[i], strerror(errno));
|
argv[i], strerror(errno));
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
|
#
|
||||||
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
CC = c99
|
CC = c99
|
||||||
CFLAGS = -g
|
CFLAGS = -g
|
||||||
|
|||||||
127
doc/examples_old/xz_pipe_comp.c
Normal file
127
doc/examples_old/xz_pipe_comp.c
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
/*
|
||||||
|
* xz_pipe_comp.c
|
||||||
|
* A simple example of pipe-only xz compressor implementation.
|
||||||
|
* version: 2010-07-12 - by Daniel Mealha Cabrita
|
||||||
|
* Not copyrighted -- provided to the public domain.
|
||||||
|
*
|
||||||
|
* Compiling:
|
||||||
|
* Link with liblzma. GCC example:
|
||||||
|
* $ gcc -llzma xz_pipe_comp.c -o xz_pipe_comp
|
||||||
|
*
|
||||||
|
* Usage example:
|
||||||
|
* $ cat some_file | ./xz_pipe_comp > some_file.xz
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <lzma.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* COMPRESSION SETTINGS */
|
||||||
|
|
||||||
|
/* analogous to xz CLI options: -0 to -9 */
|
||||||
|
#define COMPRESSION_LEVEL 6
|
||||||
|
|
||||||
|
/* boolean setting, analogous to xz CLI option: -e */
|
||||||
|
#define COMPRESSION_EXTREME true
|
||||||
|
|
||||||
|
/* see: /usr/include/lzma/check.h LZMA_CHECK_* */
|
||||||
|
#define INTEGRITY_CHECK LZMA_CHECK_CRC64
|
||||||
|
|
||||||
|
|
||||||
|
/* read/write buffer sizes */
|
||||||
|
#define IN_BUF_MAX 4096
|
||||||
|
#define OUT_BUF_MAX 4096
|
||||||
|
|
||||||
|
/* error codes */
|
||||||
|
#define RET_OK 0
|
||||||
|
#define RET_ERROR_INIT 1
|
||||||
|
#define RET_ERROR_INPUT 2
|
||||||
|
#define RET_ERROR_OUTPUT 3
|
||||||
|
#define RET_ERROR_COMPRESSION 4
|
||||||
|
|
||||||
|
|
||||||
|
/* note: in_file and out_file must be open already */
|
||||||
|
int xz_compress (FILE *in_file, FILE *out_file)
|
||||||
|
{
|
||||||
|
uint32_t preset = COMPRESSION_LEVEL | (COMPRESSION_EXTREME ? LZMA_PRESET_EXTREME : 0);
|
||||||
|
lzma_check check = INTEGRITY_CHECK;
|
||||||
|
lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */
|
||||||
|
uint8_t in_buf [IN_BUF_MAX];
|
||||||
|
uint8_t out_buf [OUT_BUF_MAX];
|
||||||
|
size_t in_len; /* length of useful data in in_buf */
|
||||||
|
size_t out_len; /* length of useful data in out_buf */
|
||||||
|
bool in_finished = false;
|
||||||
|
bool out_finished = false;
|
||||||
|
lzma_action action;
|
||||||
|
lzma_ret ret_xz;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = RET_OK;
|
||||||
|
|
||||||
|
/* initialize xz encoder */
|
||||||
|
ret_xz = lzma_easy_encoder (&strm, preset, check);
|
||||||
|
if (ret_xz != LZMA_OK) {
|
||||||
|
fprintf (stderr, "lzma_easy_encoder error: %d\n", (int) ret_xz);
|
||||||
|
return RET_ERROR_INIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
while ((! in_finished) && (! out_finished)) {
|
||||||
|
/* read incoming data */
|
||||||
|
in_len = fread (in_buf, 1, IN_BUF_MAX, in_file);
|
||||||
|
|
||||||
|
if (feof (in_file)) {
|
||||||
|
in_finished = true;
|
||||||
|
}
|
||||||
|
if (ferror (in_file)) {
|
||||||
|
in_finished = true;
|
||||||
|
ret = RET_ERROR_INPUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
strm.next_in = in_buf;
|
||||||
|
strm.avail_in = in_len;
|
||||||
|
|
||||||
|
/* if no more data from in_buf, flushes the
|
||||||
|
internal xz buffers and closes the xz data
|
||||||
|
with LZMA_FINISH */
|
||||||
|
action = in_finished ? LZMA_FINISH : LZMA_RUN;
|
||||||
|
|
||||||
|
/* loop until there's no pending compressed output */
|
||||||
|
do {
|
||||||
|
/* out_buf is clean at this point */
|
||||||
|
strm.next_out = out_buf;
|
||||||
|
strm.avail_out = OUT_BUF_MAX;
|
||||||
|
|
||||||
|
/* compress data */
|
||||||
|
ret_xz = lzma_code (&strm, action);
|
||||||
|
|
||||||
|
if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) {
|
||||||
|
fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz);
|
||||||
|
out_finished = true;
|
||||||
|
ret = RET_ERROR_COMPRESSION;
|
||||||
|
} else {
|
||||||
|
/* write compressed data */
|
||||||
|
out_len = OUT_BUF_MAX - strm.avail_out;
|
||||||
|
fwrite (out_buf, 1, out_len, out_file);
|
||||||
|
if (ferror (out_file)) {
|
||||||
|
out_finished = true;
|
||||||
|
ret = RET_ERROR_OUTPUT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} while (strm.avail_out == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
lzma_end (&strm);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main ()
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = xz_compress (stdin, stdout);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
123
doc/examples_old/xz_pipe_decomp.c
Normal file
123
doc/examples_old/xz_pipe_decomp.c
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
/*
|
||||||
|
* xz_pipe_decomp.c
|
||||||
|
* A simple example of pipe-only xz decompressor implementation.
|
||||||
|
* version: 2012-06-14 - by Daniel Mealha Cabrita
|
||||||
|
* Not copyrighted -- provided to the public domain.
|
||||||
|
*
|
||||||
|
* Compiling:
|
||||||
|
* Link with liblzma. GCC example:
|
||||||
|
* $ gcc -llzma xz_pipe_decomp.c -o xz_pipe_decomp
|
||||||
|
*
|
||||||
|
* Usage example:
|
||||||
|
* $ cat some_file.xz | ./xz_pipe_decomp > some_file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <lzma.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* read/write buffer sizes */
|
||||||
|
#define IN_BUF_MAX 4096
|
||||||
|
#define OUT_BUF_MAX 4096
|
||||||
|
|
||||||
|
/* error codes */
|
||||||
|
#define RET_OK 0
|
||||||
|
#define RET_ERROR_INIT 1
|
||||||
|
#define RET_ERROR_INPUT 2
|
||||||
|
#define RET_ERROR_OUTPUT 3
|
||||||
|
#define RET_ERROR_DECOMPRESSION 4
|
||||||
|
|
||||||
|
|
||||||
|
/* note: in_file and out_file must be open already */
|
||||||
|
int xz_decompress (FILE *in_file, FILE *out_file)
|
||||||
|
{
|
||||||
|
lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */
|
||||||
|
const uint32_t flags = LZMA_TELL_UNSUPPORTED_CHECK | LZMA_CONCATENATED;
|
||||||
|
const uint64_t memory_limit = UINT64_MAX; /* no memory limit */
|
||||||
|
uint8_t in_buf [IN_BUF_MAX];
|
||||||
|
uint8_t out_buf [OUT_BUF_MAX];
|
||||||
|
size_t in_len; /* length of useful data in in_buf */
|
||||||
|
size_t out_len; /* length of useful data in out_buf */
|
||||||
|
bool in_finished = false;
|
||||||
|
bool out_finished = false;
|
||||||
|
lzma_action action;
|
||||||
|
lzma_ret ret_xz;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = RET_OK;
|
||||||
|
|
||||||
|
/* initialize xz decoder */
|
||||||
|
ret_xz = lzma_stream_decoder (&strm, memory_limit, flags);
|
||||||
|
if (ret_xz != LZMA_OK) {
|
||||||
|
fprintf (stderr, "lzma_stream_decoder error: %d\n", (int) ret_xz);
|
||||||
|
return RET_ERROR_INIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
while ((! in_finished) && (! out_finished)) {
|
||||||
|
/* read incoming data */
|
||||||
|
in_len = fread (in_buf, 1, IN_BUF_MAX, in_file);
|
||||||
|
|
||||||
|
if (feof (in_file)) {
|
||||||
|
in_finished = true;
|
||||||
|
}
|
||||||
|
if (ferror (in_file)) {
|
||||||
|
in_finished = true;
|
||||||
|
ret = RET_ERROR_INPUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
strm.next_in = in_buf;
|
||||||
|
strm.avail_in = in_len;
|
||||||
|
|
||||||
|
/* if no more data from in_buf, flushes the
|
||||||
|
internal xz buffers and closes the decompressed data
|
||||||
|
with LZMA_FINISH */
|
||||||
|
action = in_finished ? LZMA_FINISH : LZMA_RUN;
|
||||||
|
|
||||||
|
/* loop until there's no pending decompressed output */
|
||||||
|
do {
|
||||||
|
/* out_buf is clean at this point */
|
||||||
|
strm.next_out = out_buf;
|
||||||
|
strm.avail_out = OUT_BUF_MAX;
|
||||||
|
|
||||||
|
/* decompress data */
|
||||||
|
ret_xz = lzma_code (&strm, action);
|
||||||
|
|
||||||
|
if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) {
|
||||||
|
fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz);
|
||||||
|
out_finished = true;
|
||||||
|
ret = RET_ERROR_DECOMPRESSION;
|
||||||
|
} else {
|
||||||
|
/* write decompressed data */
|
||||||
|
out_len = OUT_BUF_MAX - strm.avail_out;
|
||||||
|
fwrite (out_buf, 1, out_len, out_file);
|
||||||
|
if (ferror (out_file)) {
|
||||||
|
out_finished = true;
|
||||||
|
ret = RET_ERROR_OUTPUT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} while (strm.avail_out == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Bug fix (2012-06-14): If no errors were detected, check
|
||||||
|
that the last lzma_code() call returned LZMA_STREAM_END.
|
||||||
|
If not, the file is probably truncated. */
|
||||||
|
if ((ret == RET_OK) && (ret_xz != LZMA_STREAM_END)) {
|
||||||
|
fprintf (stderr, "Input truncated or corrupt\n");
|
||||||
|
ret = RET_ERROR_DECOMPRESSION;
|
||||||
|
}
|
||||||
|
|
||||||
|
lzma_end (&strm);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main ()
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = xz_decompress (stdin, stdout);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
@ -40,10 +40,10 @@ The .lzma File Format
|
|||||||
|
|
||||||
0.2. Changes
|
0.2. Changes
|
||||||
|
|
||||||
Last modified: 2024-04-08 17:35+0300
|
Last modified: 2022-07-13 21:00+0300
|
||||||
|
|
||||||
From version 2011-04-12 11:55+0300 to 2022-07-13 21:00+0300:
|
Compared to the previous version (2011-04-12 11:55+0300)
|
||||||
The section 1.1.3 was modified to allow End of Payload Marker
|
the section 1.1.3 was modified to allow End of Payload Marker
|
||||||
with a known Uncompressed Size.
|
with a known Uncompressed Size.
|
||||||
|
|
||||||
|
|
||||||
@ -157,17 +157,17 @@ The .lzma File Format
|
|||||||
2. References
|
2. References
|
||||||
|
|
||||||
LZMA SDK - The original LZMA implementation
|
LZMA SDK - The original LZMA implementation
|
||||||
https://7-zip.org/sdk.html
|
http://7-zip.org/sdk.html
|
||||||
|
|
||||||
7-Zip
|
7-Zip
|
||||||
https://7-zip.org/
|
http://7-zip.org/
|
||||||
|
|
||||||
LZMA Utils - LZMA adapted to POSIX-like systems
|
LZMA Utils - LZMA adapted to POSIX-like systems
|
||||||
https://tukaani.org/lzma/
|
http://tukaani.org/lzma/
|
||||||
|
|
||||||
XZ Utils - The next generation of LZMA Utils
|
XZ Utils - The next generation of LZMA Utils
|
||||||
https://tukaani.org/xz/
|
http://tukaani.org/xz/
|
||||||
|
|
||||||
The .xz file format - The successor of the .lzma format
|
The .xz file format - The successor of the .lzma format
|
||||||
https://tukaani.org/xz/xz-file-format.txt
|
http://tukaani.org/xz/xz-file-format.txt
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
The .xz File Format
|
The .xz File Format
|
||||||
===================
|
===================
|
||||||
|
|
||||||
Version 1.2.1 (2024-04-08)
|
Version 1.1.0 (2022-12-11)
|
||||||
|
|
||||||
|
|
||||||
0. Preface
|
0. Preface
|
||||||
@ -81,26 +81,18 @@ Version 1.2.1 (2024-04-08)
|
|||||||
0.2. Getting the Latest Version
|
0.2. Getting the Latest Version
|
||||||
|
|
||||||
The latest official version of this document can be downloaded
|
The latest official version of this document can be downloaded
|
||||||
from <https://tukaani.org/xz/xz-file-format.txt>.
|
from <http://tukaani.org/xz/xz-file-format.txt>.
|
||||||
|
|
||||||
Specific versions of this document have a filename
|
Specific versions of this document have a filename
|
||||||
xz-file-format-X.Y.Z.txt where X.Y.Z is the version number.
|
xz-file-format-X.Y.Z.txt where X.Y.Z is the version number.
|
||||||
For example, the version 1.0.0 of this document is available
|
For example, the version 1.0.0 of this document is available
|
||||||
at <https://tukaani.org/xz/xz-file-format-1.0.0.txt>.
|
at <http://tukaani.org/xz/xz-file-format-1.0.0.txt>.
|
||||||
|
|
||||||
|
|
||||||
0.3. Version History
|
0.3. Version History
|
||||||
|
|
||||||
Version Date Description
|
Version Date Description
|
||||||
|
|
||||||
1.2.1 2024-04-08 The URLs of this specification and
|
|
||||||
XZ Utils were changed back to the
|
|
||||||
original ones in Sections 0.2 and 7.
|
|
||||||
|
|
||||||
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
|
1.1.0 2022-12-11 Added ARM64 filter and clarified 32-bit
|
||||||
ARM endianness in Section 5.3.2,
|
ARM endianness in Section 5.3.2,
|
||||||
language improvements in Section 5.4
|
language improvements in Section 5.4
|
||||||
@ -931,7 +923,6 @@ Version 1.2.1 (2024-04-08)
|
|||||||
0x08 2 bytes ARM Thumb filter [1]
|
0x08 2 bytes ARM Thumb filter [1]
|
||||||
0x09 4 bytes SPARC filter
|
0x09 4 bytes SPARC filter
|
||||||
0x0A 4 bytes ARM64 filter [2]
|
0x0A 4 bytes ARM64 filter [2]
|
||||||
0x0B 2 bytes RISC-V filter
|
|
||||||
|
|
||||||
[1] These are for little endian instruction encoding.
|
[1] These are for little endian instruction encoding.
|
||||||
This must not be confused with data endianness.
|
This must not be confused with data endianness.
|
||||||
@ -1145,30 +1136,30 @@ Version 1.2.1 (2024-04-08)
|
|||||||
7. References
|
7. References
|
||||||
|
|
||||||
LZMA SDK - The original LZMA implementation
|
LZMA SDK - The original LZMA implementation
|
||||||
https://7-zip.org/sdk.html
|
http://7-zip.org/sdk.html
|
||||||
|
|
||||||
LZMA Utils - LZMA adapted to POSIX-like systems
|
LZMA Utils - LZMA adapted to POSIX-like systems
|
||||||
https://tukaani.org/lzma/
|
http://tukaani.org/lzma/
|
||||||
|
|
||||||
XZ Utils - The next generation of LZMA Utils
|
XZ Utils - The next generation of LZMA Utils
|
||||||
https://tukaani.org/xz/
|
http://tukaani.org/xz/
|
||||||
|
|
||||||
[RFC-1952]
|
[RFC-1952]
|
||||||
GZIP file format specification version 4.3
|
GZIP file format specification version 4.3
|
||||||
https://www.ietf.org/rfc/rfc1952.txt
|
http://www.ietf.org/rfc/rfc1952.txt
|
||||||
- Notation of byte boxes in section "2.1. Overall conventions"
|
- Notation of byte boxes in section "2.1. Overall conventions"
|
||||||
|
|
||||||
[RFC-2119]
|
[RFC-2119]
|
||||||
Key words for use in RFCs to Indicate Requirement Levels
|
Key words for use in RFCs to Indicate Requirement Levels
|
||||||
https://www.ietf.org/rfc/rfc2119.txt
|
http://www.ietf.org/rfc/rfc2119.txt
|
||||||
|
|
||||||
[GNU-tar]
|
[GNU-tar]
|
||||||
GNU tar 1.35 manual
|
GNU tar 1.21 manual
|
||||||
https://www.gnu.org/software/tar/manual/html_node/Blocking-Factor.html
|
http://www.gnu.org/software/tar/manual/html_node/Blocking-Factor.html
|
||||||
- Node 9.4.2 "Blocking Factor", paragraph that begins
|
- Node 9.4.2 "Blocking Factor", paragraph that begins
|
||||||
"gzip will complain about trailing garbage"
|
"gzip will complain about trailing garbage"
|
||||||
- Note that this URL points to the latest version of the
|
- Note that this URL points to the latest version of the
|
||||||
manual, and may some day not contain the note which is in
|
manual, and may some day not contain the note which is in
|
||||||
1.35. For the exact version of the manual, download GNU
|
1.21. For the exact version of the manual, download GNU
|
||||||
tar 1.35: ftp://ftp.gnu.org/pub/gnu/tar/tar-1.35.tar.gz
|
tar 1.21: ftp://ftp.gnu.org/pub/gnu/tar/tar-1.21.tar.gz
|
||||||
|
|
||||||
|
|||||||
11
dos/Makefile
11
dos/Makefile
@ -1,11 +1,12 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Makefile to build XZ Utils using DJGPP
|
# Makefile to build XZ Utils using DJGPP
|
||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# For debugging, set comment "#define NDEBUG 1" from config.h to enable
|
# For debugging, set comment "#define NDEBUG 1" from config.h to enable
|
||||||
@ -45,15 +46,13 @@ SRCS_C = \
|
|||||||
../src/common/tuklib_cpucores.c \
|
../src/common/tuklib_cpucores.c \
|
||||||
../src/common/tuklib_exit.c \
|
../src/common/tuklib_exit.c \
|
||||||
../src/common/tuklib_mbstr_fw.c \
|
../src/common/tuklib_mbstr_fw.c \
|
||||||
../src/common/tuklib_mbstr_nonprint.c \
|
|
||||||
../src/common/tuklib_mbstr_width.c \
|
../src/common/tuklib_mbstr_width.c \
|
||||||
../src/common/tuklib_mbstr_wrap.c \
|
|
||||||
../src/common/tuklib_open_stdxxx.c \
|
../src/common/tuklib_open_stdxxx.c \
|
||||||
../src/common/tuklib_physmem.c \
|
../src/common/tuklib_physmem.c \
|
||||||
../src/common/tuklib_progname.c \
|
../src/common/tuklib_progname.c \
|
||||||
../src/liblzma/check/check.c \
|
../src/liblzma/check/check.c \
|
||||||
../src/liblzma/check/crc32_fast.c \
|
../src/liblzma/check/crc32_table.c \
|
||||||
../src/liblzma/check/crc64_fast.c \
|
../src/liblzma/check/crc64_table.c \
|
||||||
../src/liblzma/check/sha256.c \
|
../src/liblzma/check/sha256.c \
|
||||||
../src/liblzma/common/alone_decoder.c \
|
../src/liblzma/common/alone_decoder.c \
|
||||||
../src/liblzma/common/alone_encoder.c \
|
../src/liblzma/common/alone_encoder.c \
|
||||||
|
|||||||
23
dos/config.h
23
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. */
|
/* How many MiB of RAM to assume if the real amount cannot be determined. */
|
||||||
#define ASSUME_RAM 32
|
#define ASSUME_RAM 32
|
||||||
|
|
||||||
@ -12,9 +10,6 @@
|
|||||||
/* Define to 1 if sha256 integrity check is enabled. */
|
/* Define to 1 if sha256 integrity check is enabled. */
|
||||||
#define HAVE_CHECK_SHA256 1
|
#define HAVE_CHECK_SHA256 1
|
||||||
|
|
||||||
/* Define to 1 if the 32-bit x86 CRC assembly files are used. */
|
|
||||||
#define HAVE_CRC_X86_ASM 1
|
|
||||||
|
|
||||||
/* Define to 1 if any of HAVE_DECODER_foo have been defined. */
|
/* Define to 1 if any of HAVE_DECODER_foo have been defined. */
|
||||||
#define HAVE_DECODERS 1
|
#define HAVE_DECODERS 1
|
||||||
|
|
||||||
@ -84,6 +79,9 @@
|
|||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
#define HAVE_INTTYPES_H 1
|
#define HAVE_INTTYPES_H 1
|
||||||
|
|
||||||
|
/* 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 to 1 if .lz (lzip) decompression support is enabled. */
|
||||||
#define HAVE_LZIP_DECODER 1
|
#define HAVE_LZIP_DECODER 1
|
||||||
|
|
||||||
@ -108,14 +106,23 @@
|
|||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||||||
#define HAVE_STDINT_H 1
|
#define HAVE_STDINT_H 1
|
||||||
|
|
||||||
/* Define to 1 if you have the 'utimes' function. */
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||||
|
#define HAVE_STDLIB_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <string.h> header file. */
|
||||||
|
#define HAVE_STRING_H 1
|
||||||
|
|
||||||
|
/* 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 HAVE_UTIMES 1
|
#define HAVE_UTIMES 1
|
||||||
|
|
||||||
/* Define to 1 or 0, depending whether the compiler supports simple visibility
|
/* Define to 1 or 0, depending whether the compiler supports simple visibility
|
||||||
declarations. */
|
declarations. */
|
||||||
#define HAVE_VISIBILITY 0
|
#define HAVE_VISIBILITY 0
|
||||||
|
|
||||||
/* Define to 1 if the system has the type '_Bool'. */
|
/* Define to 1 if the system has the type `_Bool'. */
|
||||||
#define HAVE__BOOL 1
|
#define HAVE__BOOL 1
|
||||||
|
|
||||||
/* Define to 1 if the GNU C extension __builtin_assume_aligned is supported.
|
/* Define to 1 if the GNU C extension __builtin_assume_aligned is supported.
|
||||||
@ -138,7 +145,7 @@
|
|||||||
/* Define to the home page for this package. */
|
/* Define to the home page for this package. */
|
||||||
#define PACKAGE_URL "https://tukaani.org/xz/"
|
#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 SIZEOF_SIZE_T 4
|
||||||
|
|
||||||
/* Define to 1 if the system supports fast unaligned access to 16-bit and
|
/* Define to 1 if the system supports fast unaligned access to 16-bit and
|
||||||
|
|||||||
2674
doxygen/Doxyfile
2674
doxygen/Doxyfile
File diff suppressed because it is too large
Load Diff
@ -1,86 +1,53 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# SPDX-License-Identifier: 0BSD
|
#
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
#
|
#
|
||||||
# While it's possible to use the Doxyfile as is to generate liblzma API
|
# Updates the Doxygen generated documentation files in the source tree.
|
||||||
# documentation, it is recommended to use this script because this adds
|
# If the doxygen command is not installed, it will exit with an error.
|
||||||
# the XZ Utils version number to the generated HTML.
|
# This script can generate Doxygen documentation for all source files or for
|
||||||
|
# just liblzma API header files.
|
||||||
#
|
#
|
||||||
# Other features:
|
# It is recommended to use this script to update the Doxygen-generated HTML
|
||||||
# - Generate documentation of the XZ Utils internals.
|
# files since this will include the package version in the output and,
|
||||||
# - Set input and output paths for out-of-tree builds.
|
# in case of liblzma API docs, strip JavaScript files from the output.
|
||||||
#
|
#
|
||||||
#############################################################################
|
#############################################################################
|
||||||
#
|
#
|
||||||
# Authors: Jia Tan
|
# Authors: Jia Tan
|
||||||
# Lasse Collin
|
# Lasse Collin
|
||||||
#
|
#
|
||||||
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
show_usage()
|
|
||||||
{
|
|
||||||
echo "Usage: $0 <api|internal> [ABS_TOP_SRCDIR ABS_OUTDIR]"
|
|
||||||
echo
|
|
||||||
echo "Supported modes:"
|
|
||||||
echo " - 'api' (default): liblzma API docs into doc/api"
|
|
||||||
echo " - 'internal': internal docs into doc/internal"
|
|
||||||
echo
|
|
||||||
echo "Absolute source and output dirs may be set" \
|
|
||||||
"to do an out-of-tree build."
|
|
||||||
echo "The output directory must already exist."
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
api|internal)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
show_usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if type doxygen > /dev/null 2>&1; then
|
if type doxygen > /dev/null 2>&1; then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
echo "$0: 'doxygen' command not found" >&2
|
echo "doxygen/update-doxygen: 'doxygen' command not found." >&2
|
||||||
|
echo "doxygen/update-doxygen: Skipping Doxygen docs generation." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $# in
|
if test ! -f Doxyfile; then
|
||||||
1)
|
cd `dirname "$0"` || exit 1
|
||||||
# One argument: Building inside the source tree
|
if test ! -f Doxyfile; then
|
||||||
ABS_TOP_SRCDIR=`dirname "$0"`/..
|
echo "doxygen/update-doxygen: Cannot find Doxyfile" >&2
|
||||||
ABS_OUTDIR=$ABS_TOP_SRCDIR/doc
|
|
||||||
;;
|
|
||||||
3)
|
|
||||||
# Three arguments: Possibly an out of tree build
|
|
||||||
ABS_TOP_SRCDIR=$2
|
|
||||||
ABS_OUTDIR=$3
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
show_usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test ! -f "$ABS_TOP_SRCDIR/doxygen/Doxyfile"; then
|
|
||||||
echo "$0: Source dir '$ABS_TOP_SRCDIR/doxygen/Doxyfile' not found" >&2
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if test ! -d "$ABS_OUTDIR"; then
|
|
||||||
echo "$0: Output dir '$ABS_OUTDIR' not found" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get the package version so that it can be included in the generated docs.
|
# Get the package version so that it can be included in the generated docs.
|
||||||
PACKAGE_VERSION=`cd "$ABS_TOP_SRCDIR" && sh build-aux/version.sh`
|
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
|
case $1 in
|
||||||
api)
|
'' | api)
|
||||||
# Remove old documentation before re-generating the new.
|
# Remove old documentation before re-generating the new.
|
||||||
rm -rf "$ABS_OUTDIR/api"
|
rm -rf ../doc/api
|
||||||
|
|
||||||
# Generate the HTML documentation by preparing the Doxyfile
|
# Generate the HTML documentation by preparing the Doxyfile
|
||||||
# in stdin and piping the result to the doxygen command.
|
# in stdin and piping the result to the doxygen command.
|
||||||
@ -88,27 +55,57 @@ case $1 in
|
|||||||
# override any earlier assignment. So, we can use this
|
# override any earlier assignment. So, we can use this
|
||||||
# feature to override the tags that need to change between
|
# feature to override the tags that need to change between
|
||||||
# "api" and "internal" modes.
|
# "api" and "internal" modes.
|
||||||
ABS_SRCDIR=$ABS_TOP_SRCDIR/src/liblzma/api
|
|
||||||
(
|
(
|
||||||
cat "$ABS_TOP_SRCDIR/doxygen/Doxyfile"
|
cat Doxyfile
|
||||||
echo "PROJECT_NUMBER = $PACKAGE_VERSION"
|
echo "PROJECT_NUMBER = $PACKAGE_VERSION"
|
||||||
echo "OUTPUT_DIRECTORY = $ABS_OUTDIR"
|
) | doxygen -
|
||||||
echo "STRIP_FROM_PATH = $ABS_SRCDIR"
|
|
||||||
echo "INPUT = $ABS_SRCDIR"
|
# As of Doxygen 1.8.0 - 1.9.6 and the Doxyfile options we use,
|
||||||
) | doxygen -q -
|
# 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)
|
internal)
|
||||||
rm -rf "$ABS_OUTDIR/internal"
|
# The docs from internal aren't for distribution so
|
||||||
|
# the JavaScript files aren't an issue here.
|
||||||
|
rm -rf ../doc/internal
|
||||||
(
|
(
|
||||||
cat "$ABS_TOP_SRCDIR/doxygen/Doxyfile"
|
cat Doxyfile
|
||||||
echo 'PROJECT_NAME = "XZ Utils"'
|
|
||||||
echo "PROJECT_NUMBER = $PACKAGE_VERSION"
|
echo "PROJECT_NUMBER = $PACKAGE_VERSION"
|
||||||
echo "OUTPUT_DIRECTORY = $ABS_OUTDIR"
|
echo 'PROJECT_NAME = "XZ Utils"'
|
||||||
echo "STRIP_FROM_PATH = $ABS_TOP_SRCDIR"
|
echo 'STRIP_FROM_PATH = ../src'
|
||||||
echo "INPUT = $ABS_TOP_SRCDIR/src"
|
echo 'INPUT = ../src'
|
||||||
echo 'HTML_OUTPUT = internal'
|
echo 'HTML_OUTPUT = internal'
|
||||||
|
echo 'EXTRACT_PRIVATE = YES'
|
||||||
|
echo 'EXTRACT_STATIC = YES'
|
||||||
|
echo 'EXTRACT_LOCAL_CLASSES = YES'
|
||||||
echo 'SEARCHENGINE = YES'
|
echo 'SEARCHENGINE = YES'
|
||||||
) | doxygen -q -
|
) | 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
|
esac
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# SPDX-License-Identifier: 0BSD
|
#
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
#
|
#
|
||||||
# 7z2lzma.bash is very primitive .7z to .lzma converter. The input file must
|
# 7z2lzma.bash is very primitive .7z to .lzma converter. The input file must
|
||||||
@ -18,6 +17,9 @@
|
|||||||
#
|
#
|
||||||
# Author: Lasse Collin <lasse.collin@tukaani.org>
|
# Author: Lasse Collin <lasse.collin@tukaani.org>
|
||||||
#
|
#
|
||||||
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
# You can use 7z or 7za, both will work.
|
# You can use 7z or 7za, both will work.
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
scanlzma, scan for lzma compressed data in stdin and echo it to stdout.
|
scanlzma, scan for lzma compressed data in stdin and echo it to stdout.
|
||||||
Copyright (C) 2006 Timo Lindfors
|
Copyright (C) 2006 Timo Lindfors
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
## SPDX-License-Identifier: GPL-2.0-or-later
|
|
||||||
|
|
||||||
##
|
##
|
||||||
## Copyright (C) 2004-2007 Free Software Foundation, Inc.
|
## Copyright (C) 2004-2007 Free Software Foundation, Inc.
|
||||||
##
|
##
|
||||||
@ -23,17 +21,7 @@ libgnu_a_SOURCES =
|
|||||||
libgnu_a_DEPENDENCIES = $(LIBOBJS)
|
libgnu_a_DEPENDENCIES = $(LIBOBJS)
|
||||||
libgnu_a_LIBADD = $(LIBOBJS)
|
libgnu_a_LIBADD = $(LIBOBJS)
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = getopt.in.h getopt.c getopt1.c getopt_int.h
|
||||||
getopt.in.h \
|
|
||||||
getopt.c \
|
|
||||||
getopt1.c \
|
|
||||||
getopt_int.h \
|
|
||||||
getopt-cdefs.h \
|
|
||||||
getopt-core.h \
|
|
||||||
getopt-ext.h \
|
|
||||||
getopt-pfx-core.h \
|
|
||||||
getopt-pfx-ext.h
|
|
||||||
|
|
||||||
BUILT_SOURCES = $(GETOPT_H)
|
BUILT_SOURCES = $(GETOPT_H)
|
||||||
MOSTLYCLEANFILES = getopt.h getopt.h-t
|
MOSTLYCLEANFILES = getopt.h getopt.h-t
|
||||||
|
|
||||||
|
|||||||
@ -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 */
|
|
||||||
1128
lib/getopt.c
1128
lib/getopt.c
File diff suppressed because it is too large
Load Diff
226
lib/getopt.in.h
226
lib/getopt.in.h
@ -1,28 +1,27 @@
|
|||||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
||||||
|
|
||||||
/* Declarations for getopt.
|
/* Declarations for getopt.
|
||||||
Copyright (C) 1989-2023 Free Software Foundation, Inc.
|
Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005,2006,2007
|
||||||
This file is part of gnulib.
|
Free Software Foundation, Inc.
|
||||||
Unlike most of the getopt implementation, it is NOT shared
|
This file is part of the GNU C Library.
|
||||||
with the GNU C Library, which supplies a different version of
|
|
||||||
this file.
|
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Lesser General Public License as
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
published by the Free Software Foundation; either version 2.1 of the
|
the Free Software Foundation; either version 2.1, or (at your option)
|
||||||
License, or (at your option) any later version.
|
any later version.
|
||||||
|
|
||||||
This file is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU Lesser General Public License for more details.
|
GNU Lesser General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
You should have received a copy of the GNU Lesser General Public License along
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
with this program; if not, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#ifndef _GETOPT_H
|
#ifndef _GETOPT_H
|
||||||
|
|
||||||
|
#ifndef __need_getopt
|
||||||
# define _GETOPT_H 1
|
# define _GETOPT_H 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Standalone applications should #define __GETOPT_PREFIX to an
|
/* Standalone applications should #define __GETOPT_PREFIX to an
|
||||||
identifier that prefixes the external functions and variables
|
identifier that prefixes the external functions and variables
|
||||||
@ -32,29 +31,196 @@
|
|||||||
identifiers so that they do not collide with the system functions
|
identifiers so that they do not collide with the system functions
|
||||||
and variables. Renaming avoids problems with some compilers and
|
and variables. Renaming avoids problems with some compilers and
|
||||||
linkers. */
|
linkers. */
|
||||||
#if defined __GETOPT_PREFIX
|
#if defined __GETOPT_PREFIX && !defined __need_getopt
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
|
|
||||||
# ifndef _MSC_VER
|
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
# endif
|
# 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
|
#endif
|
||||||
|
|
||||||
/* From Gnulib's lib/arg-nonnull.h: */
|
/* Standalone applications get correct prototypes for getopt_long and
|
||||||
/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
|
getopt_long_only; they declare "char **argv". libc uses prototypes
|
||||||
that the values passed as arguments n, ..., m must be non-NULL pointers.
|
with "char *const *argv" that are incorrect because getopt_long and
|
||||||
n = 1 stands for the first argument, n = 2 for the second argument etc. */
|
getopt_long_only can permute argv; this is required for backward
|
||||||
#ifndef _GL_ARG_NONNULL
|
compatibility (e.g., for LSB 2.0.1).
|
||||||
# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
|
|
||||||
# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
|
This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt',
|
||||||
|
but it caused redefinition warnings if both unistd.h and getopt.h were
|
||||||
|
included, since unistd.h includes getopt.h having previously defined
|
||||||
|
__need_getopt.
|
||||||
|
|
||||||
|
The only place where __getopt_argv_const is used is in definitions
|
||||||
|
of getopt_long and getopt_long_only below, but these are visible
|
||||||
|
only if __need_getopt is not defined, so it is quite safe to rewrite
|
||||||
|
the conditional as follows:
|
||||||
|
*/
|
||||||
|
#if !defined __need_getopt
|
||||||
|
# if defined __GETOPT_PREFIX
|
||||||
|
# define __getopt_argv_const /* empty */
|
||||||
# else
|
# else
|
||||||
# define _GL_ARG_NONNULL(params)
|
# define __getopt_argv_const const
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <getopt-cdefs.h>
|
/* If __GNU_LIBRARY__ is not already defined, either we are being used
|
||||||
#include <getopt-pfx-core.h>
|
standalone, or this is the first header included in the source file.
|
||||||
#include <getopt-pfx-ext.h>
|
If we are being used with glibc, we need to include <features.h>, but
|
||||||
|
that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
|
||||||
|
not defined, include <ctype.h>, which will pull in <features.h> for us
|
||||||
|
if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
|
||||||
|
doesn't flood the namespace with stuff the way some other headers do.) */
|
||||||
|
#if !defined __GNU_LIBRARY__
|
||||||
|
# include <ctype.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _GETOPT_H */
|
#ifndef __THROW
|
||||||
|
# ifndef __GNUC_PREREQ
|
||||||
|
# define __GNUC_PREREQ(maj, min) (0)
|
||||||
|
# endif
|
||||||
|
# if defined __cplusplus && __GNUC_PREREQ (2,8)
|
||||||
|
# define __THROW throw ()
|
||||||
|
# else
|
||||||
|
# define __THROW
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* For communication from `getopt' to the caller.
|
||||||
|
When `getopt' finds an option that takes an argument,
|
||||||
|
the argument value is returned here.
|
||||||
|
Also, when `ordering' is RETURN_IN_ORDER,
|
||||||
|
each non-option ARGV-element is returned here. */
|
||||||
|
|
||||||
|
extern char *optarg;
|
||||||
|
|
||||||
|
/* Index in ARGV of the next element to be scanned.
|
||||||
|
This is used for communication to and from the caller
|
||||||
|
and for communication between successive calls to `getopt'.
|
||||||
|
|
||||||
|
On entry to `getopt', zero means this is the first call; initialize.
|
||||||
|
|
||||||
|
When `getopt' returns -1, this is the index of the first of the
|
||||||
|
non-option elements that the caller should itself scan.
|
||||||
|
|
||||||
|
Otherwise, `optind' communicates from one call to the next
|
||||||
|
how much of ARGV has been scanned so far. */
|
||||||
|
|
||||||
|
extern int optind;
|
||||||
|
|
||||||
|
/* Callers store zero here to inhibit the error message `getopt' prints
|
||||||
|
for unrecognized options. */
|
||||||
|
|
||||||
|
extern int opterr;
|
||||||
|
|
||||||
|
/* Set to an option character which was unrecognized. */
|
||||||
|
|
||||||
|
extern int optopt;
|
||||||
|
|
||||||
|
#ifndef __need_getopt
|
||||||
|
/* Describe the long-named options requested by the application.
|
||||||
|
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
|
||||||
|
of `struct option' terminated by an element containing a name which is
|
||||||
|
zero.
|
||||||
|
|
||||||
|
The field `has_arg' is:
|
||||||
|
no_argument (or 0) if the option does not take an argument,
|
||||||
|
required_argument (or 1) if the option requires an argument,
|
||||||
|
optional_argument (or 2) if the option takes an optional argument.
|
||||||
|
|
||||||
|
If the field `flag' is not NULL, it points to a variable that is set
|
||||||
|
to the value given in the field `val' when the option is found, but
|
||||||
|
left unchanged if the option is not found.
|
||||||
|
|
||||||
|
To have a long-named option do something other than set an `int' to
|
||||||
|
a compiled-in constant, such as set a value from `optarg', set the
|
||||||
|
option's `flag' field to zero and its `val' field to a nonzero
|
||||||
|
value (the equivalent single-letter option character, if there is
|
||||||
|
one). For long options that have a zero `flag' field, `getopt'
|
||||||
|
returns the contents of the `val' field. */
|
||||||
|
|
||||||
|
struct option
|
||||||
|
{
|
||||||
|
const char *name;
|
||||||
|
/* has_arg can't be an enum because some compilers complain about
|
||||||
|
type mismatches in all the code that assumes it is an int. */
|
||||||
|
int has_arg;
|
||||||
|
int *flag;
|
||||||
|
int val;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Names for the values of the `has_arg' field of `struct option'. */
|
||||||
|
|
||||||
|
# define no_argument 0
|
||||||
|
# define required_argument 1
|
||||||
|
# define optional_argument 2
|
||||||
|
#endif /* need getopt */
|
||||||
|
|
||||||
|
|
||||||
|
/* Get definitions and prototypes for functions to process the
|
||||||
|
arguments in ARGV (ARGC of them, minus the program name) for
|
||||||
|
options given in OPTS.
|
||||||
|
|
||||||
|
Return the option character from OPTS just read. Return -1 when
|
||||||
|
there are no more options. For unrecognized options, or options
|
||||||
|
missing arguments, `optopt' is set to the option letter, and '?' is
|
||||||
|
returned.
|
||||||
|
|
||||||
|
The OPTS string is a list of characters which are recognized option
|
||||||
|
letters, optionally followed by colons, specifying that that letter
|
||||||
|
takes an argument, to be placed in `optarg'.
|
||||||
|
|
||||||
|
If a letter in OPTS is followed by two colons, its argument is
|
||||||
|
optional. This behavior is specific to the GNU `getopt'.
|
||||||
|
|
||||||
|
The argument `--' causes premature termination of argument
|
||||||
|
scanning, explicitly telling `getopt' that there are no more
|
||||||
|
options.
|
||||||
|
|
||||||
|
If OPTS begins with `-', then non-option arguments are treated as
|
||||||
|
arguments to the option '\1'. This behavior is specific to the GNU
|
||||||
|
`getopt'. If OPTS begins with `+', or POSIXLY_CORRECT is set in
|
||||||
|
the environment, then do not permute arguments. */
|
||||||
|
|
||||||
|
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
|
||||||
|
__THROW;
|
||||||
|
|
||||||
|
#ifndef __need_getopt
|
||||||
|
extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
|
||||||
|
const char *__shortopts,
|
||||||
|
const struct option *__longopts, int *__longind)
|
||||||
|
__THROW;
|
||||||
|
extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
|
||||||
|
const char *__shortopts,
|
||||||
|
const struct option *__longopts, int *__longind)
|
||||||
|
__THROW;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Make sure we later can get all the definitions and declarations. */
|
||||||
|
#undef __need_getopt
|
||||||
|
|
||||||
|
#endif /* getopt.h */
|
||||||
|
|||||||
@ -1,32 +1,41 @@
|
|||||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
||||||
|
|
||||||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||||
Copyright (C) 1987-2023 Free Software Foundation, Inc.
|
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006
|
||||||
This file is part of the GNU C Library and is also part of gnulib.
|
Free Software Foundation, Inc.
|
||||||
Patches to this file should be submitted to both projects.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or modify
|
||||||
modify it under the terms of the GNU Lesser General Public
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
License as published by the Free Software Foundation; either
|
the Free Software Foundation; either version 2.1, or (at your option)
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
any later version.
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
Lesser General Public License for more details.
|
GNU Lesser General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU Lesser General Public License along
|
||||||
License along with the GNU C Library; if not, see
|
with this program; if not, write to the Free Software Foundation,
|
||||||
<https://www.gnu.org/licenses/>. */
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#ifndef _LIBC
|
#ifdef _LIBC
|
||||||
# ifdef HAVE_CONFIG_H
|
# include <getopt.h>
|
||||||
|
#else
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
|
# include "getopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "getopt_int.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
/* This needs to come after some library #include
|
||||||
|
to get __GNU_LIBRARY__ defined. */
|
||||||
|
#ifdef __GNU_LIBRARY__
|
||||||
|
#include <stdlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "getopt.h"
|
#ifndef NULL
|
||||||
#include "getopt_int.h"
|
#define NULL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
|
getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
|
||||||
@ -42,7 +51,7 @@ _getopt_long_r (int argc, char **argv, const char *options,
|
|||||||
struct _getopt_data *d)
|
struct _getopt_data *d)
|
||||||
{
|
{
|
||||||
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
|
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
|
||||||
0, d, 0);
|
0, 0, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
|
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
|
||||||
@ -65,14 +74,13 @@ _getopt_long_only_r (int argc, char **argv, const char *options,
|
|||||||
struct _getopt_data *d)
|
struct _getopt_data *d)
|
||||||
{
|
{
|
||||||
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
|
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
|
||||||
1, d, 0);
|
1, 0, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
@ -84,7 +92,7 @@ main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int this_option_optind = optind ? optind : 1;
|
int this_option_optind = optind ? optind : 1;
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
static const struct option long_options[] =
|
static struct option long_options[] =
|
||||||
{
|
{
|
||||||
{"add", 1, 0, 0},
|
{"add", 1, 0, 0},
|
||||||
{"append", 0, 0, 0},
|
{"append", 0, 0, 0},
|
||||||
@ -134,11 +142,11 @@ main (int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'c':
|
case 'c':
|
||||||
printf ("option c with value '%s'\n", optarg);
|
printf ("option c with value `%s'\n", optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
printf ("option d with value '%s'\n", optarg);
|
printf ("option d with value `%s'\n", optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '?':
|
case '?':
|
||||||
|
|||||||
109
lib/getopt_int.h
109
lib/getopt_int.h
@ -1,29 +1,25 @@
|
|||||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
||||||
|
|
||||||
/* Internal declarations for getopt.
|
/* Internal declarations for getopt.
|
||||||
Copyright (C) 1989-2023 Free Software Foundation, Inc.
|
Copyright (C) 1989-1994,1996-1999,2001,2003,2004
|
||||||
This file is part of the GNU C Library and is also part of gnulib.
|
Free Software Foundation, Inc.
|
||||||
Patches to this file should be submitted to both projects.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or modify
|
||||||
modify it under the terms of the GNU Lesser General Public
|
it under the terms of the GNU General Public License as published by
|
||||||
License as published by the Free Software Foundation; either
|
the Free Software Foundation; either version 2, or (at your option)
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
any later version.
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
Lesser General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU General Public License along
|
||||||
License along with the GNU C Library; if not, see
|
with this program; if not, write to the Free Software Foundation,
|
||||||
<https://www.gnu.org/licenses/>. */
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#ifndef _GETOPT_INT_H
|
#ifndef _GETOPT_INT_H
|
||||||
#define _GETOPT_INT_H 1
|
#define _GETOPT_INT_H 1
|
||||||
|
|
||||||
#include <getopt.h>
|
|
||||||
|
|
||||||
extern int _getopt_internal (int ___argc, char **___argv,
|
extern int _getopt_internal (int ___argc, char **___argv,
|
||||||
const char *__shortopts,
|
const char *__shortopts,
|
||||||
const struct option *__longopts, int *__longind,
|
const struct option *__longopts, int *__longind,
|
||||||
@ -33,32 +29,6 @@ extern int _getopt_internal (int ___argc, char **___argv,
|
|||||||
/* Reentrant versions which can handle parsing multiple argument
|
/* Reentrant versions which can handle parsing multiple argument
|
||||||
vectors at the same time. */
|
vectors at the same time. */
|
||||||
|
|
||||||
/* Describe how to deal with options that follow non-option ARGV-elements.
|
|
||||||
|
|
||||||
REQUIRE_ORDER means don't recognize them as options; stop option
|
|
||||||
processing when the first non-option is seen. This is what POSIX
|
|
||||||
specifies should happen.
|
|
||||||
|
|
||||||
PERMUTE means permute the contents of ARGV as we scan, so that
|
|
||||||
eventually all the non-options are at the end. This allows options
|
|
||||||
to be given in any order, even with programs that were not written
|
|
||||||
to expect this.
|
|
||||||
|
|
||||||
RETURN_IN_ORDER is an option available to programs that were
|
|
||||||
written to expect options and other ARGV-elements in any order
|
|
||||||
and that care about the ordering of the two. We describe each
|
|
||||||
non-option ARGV-element as if it were the argument of an option
|
|
||||||
with character code 1.
|
|
||||||
|
|
||||||
The special argument '--' forces an end of option-scanning regardless
|
|
||||||
of the value of 'ordering'. In the case of RETURN_IN_ORDER, only
|
|
||||||
'--' can cause 'getopt' to return -1 with 'optind' != ARGC. */
|
|
||||||
|
|
||||||
enum __ord
|
|
||||||
{
|
|
||||||
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Data type for reentrant functions. */
|
/* Data type for reentrant functions. */
|
||||||
struct _getopt_data
|
struct _getopt_data
|
||||||
{
|
{
|
||||||
@ -83,17 +53,58 @@ struct _getopt_data
|
|||||||
by advancing to the next ARGV-element. */
|
by advancing to the next ARGV-element. */
|
||||||
char *__nextchar;
|
char *__nextchar;
|
||||||
|
|
||||||
/* See __ord above. */
|
/* Describe how to deal with options that follow non-option ARGV-elements.
|
||||||
enum __ord __ordering;
|
|
||||||
|
If the caller did not specify anything,
|
||||||
|
the default is REQUIRE_ORDER if the environment variable
|
||||||
|
POSIXLY_CORRECT is defined, PERMUTE otherwise.
|
||||||
|
|
||||||
|
REQUIRE_ORDER means don't recognize them as options;
|
||||||
|
stop option processing when the first non-option is seen.
|
||||||
|
This is what Unix does.
|
||||||
|
This mode of operation is selected by either setting the environment
|
||||||
|
variable POSIXLY_CORRECT, or using `+' as the first character
|
||||||
|
of the list of option characters, or by calling getopt.
|
||||||
|
|
||||||
|
PERMUTE is the default. We permute the contents of ARGV as we
|
||||||
|
scan, so that eventually all the non-options are at the end.
|
||||||
|
This allows options to be given in any order, even with programs
|
||||||
|
that were not written to expect this.
|
||||||
|
|
||||||
|
RETURN_IN_ORDER is an option available to programs that were
|
||||||
|
written to expect options and other ARGV-elements in any order
|
||||||
|
and that care about the ordering of the two. We describe each
|
||||||
|
non-option ARGV-element as if it were the argument of an option
|
||||||
|
with character code 1. Using `-' as the first character of the
|
||||||
|
list of option characters selects this mode of operation.
|
||||||
|
|
||||||
|
The special argument `--' forces an end of option-scanning regardless
|
||||||
|
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
|
||||||
|
`--' can cause `getopt' to return -1 with `optind' != ARGC. */
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
|
||||||
|
} __ordering;
|
||||||
|
|
||||||
|
/* If the POSIXLY_CORRECT environment variable is set
|
||||||
|
or getopt was called. */
|
||||||
|
int __posixly_correct;
|
||||||
|
|
||||||
|
|
||||||
/* Handle permutation of arguments. */
|
/* Handle permutation of arguments. */
|
||||||
|
|
||||||
/* Describe the part of ARGV that contains non-options that have
|
/* Describe the part of ARGV that contains non-options that have
|
||||||
been skipped. 'first_nonopt' is the index in ARGV of the first
|
been skipped. `first_nonopt' is the index in ARGV of the first
|
||||||
of them; 'last_nonopt' is the index after the last of them. */
|
of them; `last_nonopt' is the index after the last of them. */
|
||||||
|
|
||||||
int __first_nonopt;
|
int __first_nonopt;
|
||||||
int __last_nonopt;
|
int __last_nonopt;
|
||||||
|
|
||||||
|
#if defined _LIBC && defined USE_NONOPTION_FLAGS
|
||||||
|
int __nonoption_flags_max_len;
|
||||||
|
int __nonoption_flags_len;
|
||||||
|
# endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/* The initializer is necessary to set OPTIND and OPTERR to their
|
/* The initializer is necessary to set OPTIND and OPTERR to their
|
||||||
@ -103,8 +114,8 @@ struct _getopt_data
|
|||||||
extern int _getopt_internal_r (int ___argc, char **___argv,
|
extern int _getopt_internal_r (int ___argc, char **___argv,
|
||||||
const char *__shortopts,
|
const char *__shortopts,
|
||||||
const struct option *__longopts, int *__longind,
|
const struct option *__longopts, int *__longind,
|
||||||
int __long_only, struct _getopt_data *__data,
|
int __long_only, int __posixly_correct,
|
||||||
int __posixly_correct);
|
struct _getopt_data *__data);
|
||||||
|
|
||||||
extern int _getopt_long_r (int ___argc, char **___argv,
|
extern int _getopt_long_r (int ___argc, char **___argv,
|
||||||
const char *__shortopts,
|
const char *__shortopts,
|
||||||
|
|||||||
1
m4/.gitignore
vendored
1
m4/.gitignore
vendored
@ -1,4 +1,3 @@
|
|||||||
build-to-host.m4
|
|
||||||
codeset.m4
|
codeset.m4
|
||||||
extern-inline.m4
|
extern-inline.m4
|
||||||
fcntl-o.m4
|
fcntl-o.m4
|
||||||
|
|||||||
85
m4/ax_check_capsicum.m4
Normal file
85
m4/ax_check_capsicum.m4
Normal file
@ -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
|
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
|
|||||||
79
m4/getopt.m4
79
m4/getopt.m4
@ -1,70 +1,71 @@
|
|||||||
dnl SPDX-License-Identifier: FSFULLR
|
# getopt.m4 serial 14 (modified version)
|
||||||
|
dnl Copyright (C) 2002-2006, 2008 Free Software Foundation, Inc.
|
||||||
# getopt.m4 serial 49 (modified version)
|
|
||||||
dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc.
|
|
||||||
dnl This file is free software; the Free Software Foundation
|
dnl This file is free software; the Free Software Foundation
|
||||||
dnl gives unlimited permission to copy and/or distribute it,
|
dnl gives unlimited permission to copy and/or distribute it,
|
||||||
dnl with or without modifications, as long as this notice is preserved.
|
dnl with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
# This version has been modified to reduce complexity since we only need
|
# The getopt module assume you want GNU getopt, with getopt_long etc,
|
||||||
# GNU getopt_long and do not care about replacing getopt.
|
# rather than vanilla POSIX getopt. This means your code should
|
||||||
#
|
# always include <getopt.h> for the getopt prototypes.
|
||||||
# Pass gl_replace_getopt=yes (or any non-empty value instead of "yes") as
|
|
||||||
# an argument to configure to force the use of the getopt_long replacement.
|
|
||||||
|
|
||||||
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
|
AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
|
||||||
gl_GETOPT_SUBSTITUTE
|
[
|
||||||
fi
|
GETOPT_H=getopt.h
|
||||||
|
AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
|
||||||
|
[Define to rpl_ if the getopt replacement functions and variables
|
||||||
|
should be used.])
|
||||||
|
AC_SUBST([GETOPT_H])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
|
AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
|
||||||
[
|
[
|
||||||
if test -z "$gl_replace_getopt"; then
|
if test -z "$GETOPT_H"; then
|
||||||
AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes])
|
AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -z "$gl_replace_getopt"; then
|
if test -z "$GETOPT_H"; then
|
||||||
AC_CHECK_FUNCS([getopt_long], [], [gl_replace_getopt=yes])
|
AC_CHECK_FUNCS([getopt_long], [], [GETOPT_H=getopt.h])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl BSD getopt_long uses a way to reset option processing, that is different
|
dnl BSD getopt_long uses a way to reset option processing, that is different
|
||||||
dnl from GNU and Solaris (which copied the GNU behavior). We support both
|
dnl from GNU and Solaris (which copied the GNU behavior). We support both
|
||||||
dnl GNU and BSD style resetting of getopt_long(), so there's no need to use
|
dnl GNU and BSD style resetting of getopt_long(), so there's no need to use
|
||||||
dnl GNU getopt_long() on BSD due to different resetting style.
|
dnl GNU getopt_long() on BSD due to different resetting style.
|
||||||
if test -z "$gl_replace_getopt"; then
|
dnl
|
||||||
|
dnl With getopt_long(), some BSD versions have a bug in handling optional
|
||||||
|
dnl arguments. This bug appears only if the environment variable
|
||||||
|
dnl POSIXLY_CORRECT has been set, so it shouldn't be too bad in most
|
||||||
|
dnl cases; probably most don't have that variable set. But if we actually
|
||||||
|
dnl hit this bug, it is a real problem due to our heavy use of optional
|
||||||
|
dnl arguments.
|
||||||
|
dnl
|
||||||
|
dnl According to CVS logs, the bug was introduced in OpenBSD in 2003-09-22
|
||||||
|
dnl and copied to FreeBSD in 2004-02-24. It was fixed in both in 2006-09-22,
|
||||||
|
dnl so the affected versions shouldn't be popular anymore anyway. NetBSD
|
||||||
|
dnl never had this bug. TODO: What about Darwin and others?
|
||||||
|
if test -z "$GETOPT_H"; then
|
||||||
AC_CHECK_DECL([optreset],
|
AC_CHECK_DECL([optreset],
|
||||||
[AC_DEFINE([HAVE_OPTRESET], 1,
|
[AC_DEFINE([HAVE_OPTRESET], 1,
|
||||||
[Define to 1 if getopt.h declares extern int optreset.])],
|
[Define to 1 if getopt.h declares extern int optreset.])],
|
||||||
[], [#include <getopt.h>])
|
[], [#include <getopt.h>])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl POSIX 2008 does not specify leading '+' behavior, but see
|
dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
|
||||||
dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
|
dnl option string (as of 2005-05-05). We don't use that feature, so this
|
||||||
dnl the next version of POSIX. We don't use that feature, so this
|
|
||||||
dnl is not a problem for us. Thus, the respective test was removed here.
|
dnl is not a problem for us. Thus, the respective test was removed here.
|
||||||
|
|
||||||
dnl Checks for getopt handling '-' as a leading character in an option
|
|
||||||
dnl string were removed, since we also don't use that feature.
|
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([gl_GETOPT_SUBSTITUTE],
|
AC_DEFUN([gl_GETOPT_IFELSE],
|
||||||
[
|
[
|
||||||
AC_LIBOBJ([getopt])
|
AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
|
||||||
AC_LIBOBJ([getopt1])
|
AS_IF([test -n "$GETOPT_H"], [$1], [$2])
|
||||||
|
|
||||||
AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
|
|
||||||
|
|
||||||
AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
|
|
||||||
[Define to rpl_ if the getopt replacement functions and variables
|
|
||||||
should be used.])
|
|
||||||
|
|
||||||
GETOPT_H=getopt.h
|
|
||||||
AC_SUBST([GETOPT_H])
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([gl_GETOPT], [gl_FUNC_GETOPT_GNU])
|
AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])])
|
||||||
|
|||||||
@ -1,14 +1,11 @@
|
|||||||
dnl SPDX-License-Identifier: FSFULLR
|
|
||||||
|
|
||||||
# posix-shell.m4
|
|
||||||
# serial 1
|
|
||||||
dnl Copyright (C) 2007-2024 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.
|
|
||||||
|
|
||||||
# Find a POSIX-conforming shell.
|
# Find a POSIX-conforming shell.
|
||||||
|
|
||||||
|
# Copyright (C) 2007-2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This file is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
# Written by Paul Eggert.
|
# Written by Paul Eggert.
|
||||||
|
|
||||||
# If a POSIX-conforming shell can be found, set POSIX_SHELL and
|
# If a POSIX-conforming shell can be found, set POSIX_SHELL and
|
||||||
|
|||||||
@ -1,6 +1,3 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
#
|
#
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
#
|
#
|
||||||
@ -10,11 +7,13 @@
|
|||||||
#
|
#
|
||||||
# Common checks for tuklib.
|
# Common checks for tuklib.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# COPYING
|
||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
#############################################################################
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
AC_DEFUN_ONCE([TUKLIB_COMMON], [
|
AC_DEFUN_ONCE([TUKLIB_COMMON], [
|
||||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||||
|
|||||||
@ -1,6 +1,3 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
#
|
#
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
#
|
#
|
||||||
@ -20,11 +17,13 @@
|
|||||||
# GetSystemInfo() is used on Cygwin)
|
# GetSystemInfo() is used on Cygwin)
|
||||||
# - pstat_getdynamic(): HP-UX
|
# - pstat_getdynamic(): HP-UX
|
||||||
#
|
#
|
||||||
#############################################################################
|
# COPYING
|
||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
#############################################################################
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
AC_DEFUN_ONCE([TUKLIB_CPUCORES], [
|
AC_DEFUN_ONCE([TUKLIB_CPUCORES], [
|
||||||
AC_REQUIRE([TUKLIB_COMMON])
|
AC_REQUIRE([TUKLIB_COMMON])
|
||||||
@ -71,7 +70,7 @@ main(void)
|
|||||||
# -lfreebsd-glue when linking and thus in the current form this would
|
# -lfreebsd-glue when linking and thus in the current form this would
|
||||||
# fail on GNU/kFreeBSD. The above test for sched_getaffinity() matches
|
# fail on GNU/kFreeBSD. The above test for sched_getaffinity() matches
|
||||||
# on GNU/kFreeBSD so the test below should never run on that OS.
|
# on GNU/kFreeBSD so the test below should never run on that OS.
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/cpuset.h>
|
#include <sys/cpuset.h>
|
||||||
|
|
||||||
@ -92,7 +91,7 @@ main(void)
|
|||||||
#
|
#
|
||||||
# We test sysctl() first and intentionally break the sysctl() test on QNX
|
# We test sysctl() first and intentionally break the sysctl() test on QNX
|
||||||
# so that sysctl() is never used on QNX.
|
# so that sysctl() is never used on QNX.
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#ifdef __QNX__
|
#ifdef __QNX__
|
||||||
compile error
|
compile error
|
||||||
#endif
|
#endif
|
||||||
@ -116,7 +115,7 @@ main(void)
|
|||||||
}
|
}
|
||||||
]])], [tuklib_cv_cpucores_method=sysctl], [
|
]])], [tuklib_cv_cpucores_method=sysctl], [
|
||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
@ -133,7 +132,7 @@ main(void)
|
|||||||
}
|
}
|
||||||
]])], [tuklib_cv_cpucores_method=sysconf], [
|
]])], [tuklib_cv_cpucores_method=sysconf], [
|
||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/pstat.h>
|
#include <sys/pstat.h>
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,3 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
#
|
#
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
#
|
#
|
||||||
@ -14,11 +11,13 @@
|
|||||||
# - Does the hardware support fast unaligned access to 16-bit, 32-bit,
|
# - Does the hardware support fast unaligned access to 16-bit, 32-bit,
|
||||||
# and 64-bit integers
|
# and 64-bit integers
|
||||||
#
|
#
|
||||||
#############################################################################
|
# COPYING
|
||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
#############################################################################
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
AC_DEFUN_ONCE([TUKLIB_INTEGER], [
|
AC_DEFUN_ONCE([TUKLIB_INTEGER], [
|
||||||
AC_REQUIRE([TUKLIB_COMMON])
|
AC_REQUIRE([TUKLIB_COMMON])
|
||||||
@ -62,158 +61,30 @@ main(void)
|
|||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
# On archs that we use tuklib_integer_strict_align() (see below), we need
|
|
||||||
# objdump to detect support for unaligned access. (Libtool needs objdump
|
|
||||||
# too, so Libtool does this same tool check as well.)
|
|
||||||
AC_CHECK_TOOL([OBJDUMP], [objdump], [false])
|
|
||||||
|
|
||||||
# An internal helper that attempts to detect if -mstrict-align or
|
|
||||||
# -mno-strict-align is in effect. This sets enable_unaligned_access=yes
|
|
||||||
# if compilation succeeds and the regex passed as an argument does *not*
|
|
||||||
# match the objdump output of a check program. Otherwise this sets
|
|
||||||
# enable_unaligned_access=no.
|
|
||||||
tuklib_integer_strict_align ()
|
|
||||||
{
|
|
||||||
# First guess no.
|
|
||||||
enable_unaligned_access=no
|
|
||||||
|
|
||||||
# Force -O2 because without optimizations the memcpy()
|
|
||||||
# won't be optimized out.
|
|
||||||
tuklib_integer_saved_CFLAGS=$CFLAGS
|
|
||||||
CFLAGS="$CFLAGS -O2"
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
|
||||||
#include <string.h>
|
|
||||||
unsigned int check_strict_align(const void *p)
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
memcpy(&i, p, sizeof(i));
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
]])], [
|
|
||||||
# Disassemble the test function from the object file.
|
|
||||||
if $OBJDUMP -d conftest.$ac_objext > conftest.s ; then
|
|
||||||
# This function should be passed a regex that
|
|
||||||
# matches if there are instructions that load
|
|
||||||
# unsigned bytes. Such instructions indicate
|
|
||||||
# that -mstrict-align is in effect.
|
|
||||||
#
|
|
||||||
# NOTE: Use braces to avoid M4 parameter
|
|
||||||
# expansion.
|
|
||||||
if grep -- "${1}" conftest.s > /dev/null ; then
|
|
||||||
:
|
|
||||||
else
|
|
||||||
# No single-byte unsigned load
|
|
||||||
# instructions were found,
|
|
||||||
# so it seems that -mno-strict-align
|
|
||||||
# is in effect.
|
|
||||||
# Override our earlier guess.
|
|
||||||
enable_unaligned_access=yes
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
CFLAGS=$tuklib_integer_saved_CFLAGS
|
|
||||||
}
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([if unaligned memory access should be used])
|
AC_MSG_CHECKING([if unaligned memory access should be used])
|
||||||
AC_ARG_ENABLE([unaligned-access], AS_HELP_STRING([--enable-unaligned-access],
|
AC_ARG_ENABLE([unaligned-access], AS_HELP_STRING([--enable-unaligned-access],
|
||||||
[Enable if the system supports *fast* unaligned memory access
|
[Enable if the system supports *fast* unaligned memory access
|
||||||
with 16-bit, 32-bit, and 64-bit integers. By default,
|
with 16-bit, 32-bit, and 64-bit integers. By default,
|
||||||
this is enabled on x86, x86-64,
|
this is enabled only on x86, x86_64, big endian PowerPC,
|
||||||
32/64-bit big endian PowerPC,
|
and some ARM systems.]),
|
||||||
64-bit little endian PowerPC,
|
|
||||||
and some ARM, ARM64, and RISC-V systems.]),
|
|
||||||
[], [enable_unaligned_access=auto])
|
[], [enable_unaligned_access=auto])
|
||||||
if test "x$enable_unaligned_access" = xauto ; then
|
if test "x$enable_unaligned_access" = xauto ; then
|
||||||
# NOTE: There might be other architectures on which unaligned access
|
# TODO: There may be other architectures, on which unaligned access
|
||||||
# is fast.
|
# is OK.
|
||||||
case $host_cpu in
|
case $host_cpu in
|
||||||
i?86|x86_64|powerpc|powerpc64|powerpc64le)
|
i?86|x86_64|powerpc|powerpc64)
|
||||||
enable_unaligned_access=yes
|
enable_unaligned_access=yes
|
||||||
;;
|
;;
|
||||||
arm*|riscv*)
|
arm*|aarch64*)
|
||||||
# On 32-bit ARM, GCC and Clang
|
# On 32-bit and 64-bit ARM, GCC and Clang
|
||||||
# #define __ARM_FEATURE_UNALIGNED
|
# #define __ARM_FEATURE_UNALIGNED if
|
||||||
# if and only if unaligned access is supported.
|
# unaligned access is supported.
|
||||||
#
|
|
||||||
# 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-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([
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||||
#if !defined(__ARM_FEATURE_UNALIGNED) \
|
#ifndef __ARM_FEATURE_UNALIGNED
|
||||||
&& !defined(__riscv_misaligned_fast) \
|
|
||||||
&& !defined(_MSC_VER)
|
|
||||||
compile error
|
compile error
|
||||||
#endif
|
#endif
|
||||||
int main(void) { return 0; }
|
int main(void) { return 0; }
|
||||||
])],
|
])], [enable_unaligned_access=yes], [enable_unaligned_access=no])
|
||||||
[enable_unaligned_access=yes],
|
|
||||||
[enable_unaligned_access=no])
|
|
||||||
;;
|
|
||||||
aarch64*)
|
|
||||||
# On ARM64, Clang defines __ARM_FEATURE_UNALIGNED
|
|
||||||
# if and only if unaligned access is supported.
|
|
||||||
# However, GCC (at least up to 15.2.0) defines it
|
|
||||||
# even when using -mstrict-align, so autodetection
|
|
||||||
# with this macro doesn't work with GCC on ARM64.
|
|
||||||
# (It does work on 32-bit ARM.) See:
|
|
||||||
#
|
|
||||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111555
|
|
||||||
#
|
|
||||||
# We need three checks:
|
|
||||||
#
|
|
||||||
# 1. If __ARM_FEATURE_UNALIGNED is defined and the
|
|
||||||
# compiler isn't GCC, unaligned access is enabled.
|
|
||||||
# If the compiler is MSVC, unaligned access is
|
|
||||||
# enabled even without __ARM_FEATURE_UNALIGNED.
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
|
||||||
#if defined(__ARM_FEATURE_UNALIGNED) \
|
|
||||||
&& (!defined(__GNUC__) \
|
|
||||||
|| defined(__clang__))
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
#else
|
|
||||||
compile error
|
|
||||||
#endif
|
|
||||||
int main(void) { return 0; }
|
|
||||||
])], [enable_unaligned_access=yes])
|
|
||||||
|
|
||||||
# 2. If __ARM_FEATURE_UNALIGNED is not defined,
|
|
||||||
# unaligned access is disabled.
|
|
||||||
if test "x$enable_unaligned_access" = xauto ; then
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
|
||||||
#ifdef __ARM_FEATURE_UNALIGNED
|
|
||||||
compile error
|
|
||||||
#endif
|
|
||||||
int main(void) { return 0; }
|
|
||||||
])], [enable_unaligned_access=no])
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 3. Use heuristics to detect if -mstrict-align is
|
|
||||||
# in effect when building with GCC.
|
|
||||||
if test "x$enable_unaligned_access" = xauto ; then
|
|
||||||
[tuklib_integer_strict_align \
|
|
||||||
'[[:blank:]]ldrb[[:blank:]]']
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
loongarch*)
|
|
||||||
# See sections 7.4, 8.1, and 8.2:
|
|
||||||
# https://github.com/loongson/la-softdev-convention/blob/v0.2/la-softdev-convention.adoc
|
|
||||||
#
|
|
||||||
# That is, desktop and server processors likely support
|
|
||||||
# unaligned access in hardware but embedded processors
|
|
||||||
# might not. GCC defaults to -mno-strict-align and so
|
|
||||||
# do majority of GNU/Linux distributions. As of
|
|
||||||
# GCC 15.2, there is no predefined macro to detect
|
|
||||||
# if -mstrict-align or -mno-strict-align is in effect.
|
|
||||||
# Use heuristics based on compiler output.
|
|
||||||
[
|
|
||||||
tuklib_integer_strict_align \
|
|
||||||
'[[:blank:]]ld\.bu[[:blank:]]'
|
|
||||||
]
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
enable_unaligned_access=no
|
enable_unaligned_access=no
|
||||||
|
|||||||
@ -1,6 +1,3 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
#
|
#
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
#
|
#
|
||||||
@ -18,14 +15,16 @@
|
|||||||
# functions, but each function is put into a separate .c file so
|
# functions, but each function is put into a separate .c file so
|
||||||
# that it is possible to pick only what is strictly needed.
|
# that it is possible to pick only what is strictly needed.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# COPYING
|
||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
#############################################################################
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
AC_DEFUN_ONCE([TUKLIB_MBSTR], [
|
AC_DEFUN_ONCE([TUKLIB_MBSTR], [
|
||||||
AC_REQUIRE([TUKLIB_COMMON])
|
AC_REQUIRE([TUKLIB_COMMON])
|
||||||
AC_FUNC_MBRTOWC
|
AC_FUNC_MBRTOWC
|
||||||
AC_CHECK_FUNCS([wcwidth vasprintf])
|
AC_CHECK_FUNCS([wcwidth])
|
||||||
])dnl
|
])dnl
|
||||||
|
|||||||
@ -1,6 +1,3 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
#
|
#
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
#
|
#
|
||||||
@ -32,11 +29,13 @@
|
|||||||
# - sysinfo() works on Linux/dietlibc and probably on other Linux
|
# - sysinfo() works on Linux/dietlibc and probably on other Linux
|
||||||
# systems whose libc may lack sysconf().
|
# systems whose libc may lack sysconf().
|
||||||
#
|
#
|
||||||
#############################################################################
|
# COPYING
|
||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
#############################################################################
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
AC_DEFUN_ONCE([TUKLIB_PHYSMEM], [
|
AC_DEFUN_ONCE([TUKLIB_PHYSMEM], [
|
||||||
AC_REQUIRE([TUKLIB_COMMON])
|
AC_REQUIRE([TUKLIB_COMMON])
|
||||||
@ -65,11 +64,6 @@ compile error
|
|||||||
# Look for AIX-specific solution before sysconf(), because the test
|
# Look for AIX-specific solution before sysconf(), because the test
|
||||||
# for sysconf() will pass on AIX but won't actually work
|
# for sysconf() will pass on AIX but won't actually work
|
||||||
# (sysconf(_SC_PHYS_PAGES) compiles but always returns -1 on AIX).
|
# (sysconf(_SC_PHYS_PAGES) compiles but always returns -1 on AIX).
|
||||||
#
|
|
||||||
# NOTE: There is no need to link the check program because it's not calling
|
|
||||||
# any functions and thus implicit function declarations aren't a problem.
|
|
||||||
# The unused reference to _system_configuration.physmem might get optimized
|
|
||||||
# away, and thus the linker might not see that symbol anyway.
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <sys/systemcfg.h>
|
#include <sys/systemcfg.h>
|
||||||
|
|
||||||
@ -81,7 +75,7 @@ main(void)
|
|||||||
}
|
}
|
||||||
]])], [tuklib_cv_physmem_method=aix], [
|
]])], [tuklib_cv_physmem_method=aix], [
|
||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
@ -93,7 +87,7 @@ main(void)
|
|||||||
}
|
}
|
||||||
]])], [tuklib_cv_physmem_method=sysconf], [
|
]])], [tuklib_cv_physmem_method=sysconf], [
|
||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#ifdef HAVE_SYS_PARAM_H
|
#ifdef HAVE_SYS_PARAM_H
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
#endif
|
#endif
|
||||||
@ -109,7 +103,7 @@ main(void)
|
|||||||
}
|
}
|
||||||
]])], [tuklib_cv_physmem_method=sysctl], [
|
]])], [tuklib_cv_physmem_method=sysctl], [
|
||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <sys/sysinfo.h>
|
#include <sys/sysinfo.h>
|
||||||
#include <machine/hal_sysinfo.h>
|
#include <machine/hal_sysinfo.h>
|
||||||
|
|
||||||
@ -123,7 +117,7 @@ main(void)
|
|||||||
}
|
}
|
||||||
]])], [tuklib_cv_physmem_method=getsysinfo],[
|
]])], [tuklib_cv_physmem_method=getsysinfo],[
|
||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/pstat.h>
|
#include <sys/pstat.h>
|
||||||
|
|
||||||
@ -138,7 +132,7 @@ main(void)
|
|||||||
}
|
}
|
||||||
]])], [tuklib_cv_physmem_method=pstat_getstatic],[
|
]])], [tuklib_cv_physmem_method=pstat_getstatic],[
|
||||||
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <invent.h>
|
#include <invent.h>
|
||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
@ -155,7 +149,7 @@ main(void)
|
|||||||
# different sysinfo() so we must check $host_os.
|
# different sysinfo() so we must check $host_os.
|
||||||
case $host_os in
|
case $host_os in
|
||||||
linux*)
|
linux*)
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <sys/sysinfo.h>
|
#include <sys/sysinfo.h>
|
||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
|
|||||||
@ -1,6 +1,3 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
#
|
#
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
#
|
#
|
||||||
@ -14,16 +11,18 @@
|
|||||||
# This .m4 file is needed allow this module to use glibc's
|
# This .m4 file is needed allow this module to use glibc's
|
||||||
# program_invocation_name.
|
# program_invocation_name.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# COPYING
|
||||||
#
|
#
|
||||||
# Author: Lasse Collin
|
# Author: Lasse Collin
|
||||||
#
|
#
|
||||||
#############################################################################
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
AC_DEFUN_ONCE([TUKLIB_PROGNAME], [
|
AC_DEFUN_ONCE([TUKLIB_PROGNAME], [
|
||||||
AC_REQUIRE([TUKLIB_COMMON])
|
AC_REQUIRE([TUKLIB_COMMON])
|
||||||
AC_CHECK_DECL([program_invocation_name], [AC_DEFINE(
|
AC_CHECK_DECL([program_invocation_name], [AC_DEFINE(
|
||||||
[HAVE_PROGRAM_INVOCATION_NAME], [1],
|
[HAVE_PROGRAM_INVOCATION_NAME], [1],
|
||||||
[Define to 1 if 'program_invocation_name' is declared in <errno.h>.])],
|
[Define to 1 if `program_invocation_name' is declared in <errno.h>.])],
|
||||||
[], [#include <errno.h>])
|
[], [#include <errno.h>])
|
||||||
])dnl
|
])dnl
|
||||||
|
|||||||
@ -1,8 +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 9
|
|
||||||
dnl Copyright (C) 2005, 2008, 2010-2024 Free Software Foundation, Inc.
|
|
||||||
dnl This file is free software; the Free Software Foundation
|
dnl This file is free software; the Free Software Foundation
|
||||||
dnl gives unlimited permission to copy and/or distribute it,
|
dnl gives unlimited permission to copy and/or distribute it,
|
||||||
dnl with or without modifications, as long as this notice is preserved.
|
dnl with or without modifications, as long as this notice is preserved.
|
||||||
@ -34,18 +31,18 @@ AC_DEFUN([gl_VISIBILITY],
|
|||||||
dnl user has put into $CC $CFLAGS $CPPFLAGS.
|
dnl user has put into $CC $CFLAGS $CPPFLAGS.
|
||||||
AC_CACHE_CHECK([whether the -Werror option is usable],
|
AC_CACHE_CHECK([whether the -Werror option is usable],
|
||||||
[gl_cv_cc_vis_werror],
|
[gl_cv_cc_vis_werror],
|
||||||
[gl_saved_CFLAGS="$CFLAGS"
|
[gl_save_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CFLAGS -Werror"
|
CFLAGS="$CFLAGS -Werror"
|
||||||
AC_COMPILE_IFELSE(
|
AC_COMPILE_IFELSE(
|
||||||
[AC_LANG_PROGRAM([[]], [[]])],
|
[AC_LANG_PROGRAM([[]], [[]])],
|
||||||
[gl_cv_cc_vis_werror=yes],
|
[gl_cv_cc_vis_werror=yes],
|
||||||
[gl_cv_cc_vis_werror=no])
|
[gl_cv_cc_vis_werror=no])
|
||||||
CFLAGS="$gl_saved_CFLAGS"
|
CFLAGS="$gl_save_CFLAGS"
|
||||||
])
|
])
|
||||||
dnl Now check whether visibility declarations are supported.
|
dnl Now check whether visibility declarations are supported.
|
||||||
AC_CACHE_CHECK([for simple visibility declarations],
|
AC_CACHE_CHECK([for simple visibility declarations],
|
||||||
[gl_cv_cc_visibility],
|
[gl_cv_cc_visibility],
|
||||||
[gl_saved_CFLAGS="$CFLAGS"
|
[gl_save_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CFLAGS -fvisibility=hidden"
|
CFLAGS="$CFLAGS -fvisibility=hidden"
|
||||||
dnl We use the option -Werror and a function dummyfunc, because on some
|
dnl We use the option -Werror and a function dummyfunc, because on some
|
||||||
dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
|
dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
|
||||||
@ -71,7 +68,7 @@ AC_DEFUN([gl_VISIBILITY],
|
|||||||
[[]])],
|
[[]])],
|
||||||
[gl_cv_cc_visibility=yes],
|
[gl_cv_cc_visibility=yes],
|
||||||
[gl_cv_cc_visibility=no])
|
[gl_cv_cc_visibility=no])
|
||||||
CFLAGS="$gl_saved_CFLAGS"
|
CFLAGS="$gl_save_CFLAGS"
|
||||||
])
|
])
|
||||||
if test $gl_cv_cc_visibility = yes; then
|
if test $gl_cv_cc_visibility = yes; then
|
||||||
CFLAG_VISIBILITY="-fvisibility=hidden"
|
CFLAG_VISIBILITY="-fvisibility=hidden"
|
||||||
|
|||||||
113
macosx/build.sh
Executable file
113
macosx/build.sh
Executable file
@ -0,0 +1,113 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Author: Anders F Björklund <afb@users.sourceforge.net>
|
||||||
|
#
|
||||||
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
mkdir -p Root
|
||||||
|
mkdir -p Resources
|
||||||
|
|
||||||
|
# Abort immediately if something goes wrong.
|
||||||
|
set -e
|
||||||
|
|
||||||
|
GCC="gcc-4.2"
|
||||||
|
SDK="/Developer/SDKs/MacOSX10.5.sdk"
|
||||||
|
MDT="10.5"
|
||||||
|
GTT=i686-apple-darwin9
|
||||||
|
|
||||||
|
ARCHES1="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
|
||||||
|
ARCHES2="-arch ppc -arch i386"
|
||||||
|
PKGFORMAT="10.5" # xar
|
||||||
|
|
||||||
|
# avoid "unknown required load command: 0x80000022" from linking on Snow Leopard
|
||||||
|
uname -r | grep ^1 >/dev/null && LDFLAGS="$LDFLAGS -Wl,-no_compact_linkedit"
|
||||||
|
|
||||||
|
# Clean up if it was already configured.
|
||||||
|
[ -f Makefile ] && make distclean
|
||||||
|
|
||||||
|
# Build the regular fat program
|
||||||
|
|
||||||
|
CC="$GCC" \
|
||||||
|
CFLAGS="-O2 -g $ARCHES1 -isysroot $SDK -mmacosx-version-min=$MDT" \
|
||||||
|
../configure --disable-dependency-tracking --disable-xzdec --disable-lzmadec $GTT
|
||||||
|
|
||||||
|
make
|
||||||
|
|
||||||
|
make check
|
||||||
|
|
||||||
|
make DESTDIR=`pwd`/Root install
|
||||||
|
|
||||||
|
make distclean
|
||||||
|
|
||||||
|
# Build the size-optimized program
|
||||||
|
|
||||||
|
CC="$GCC" \
|
||||||
|
CFLAGS="-Os -g $ARCHES2 -isysroot $SDK -mmacosx-version-min=$MDT" \
|
||||||
|
../configure --disable-dependency-tracking --disable-shared --disable-nls --disable-encoders --enable-small --disable-threads $GTT
|
||||||
|
|
||||||
|
make -C src/liblzma
|
||||||
|
make -C src/xzdec
|
||||||
|
make -C src/xzdec DESTDIR=`pwd`/Root install
|
||||||
|
|
||||||
|
cp -a ../extra Root/usr/local/share/doc/xz
|
||||||
|
|
||||||
|
make distclean
|
||||||
|
|
||||||
|
# Move development files to different package
|
||||||
|
|
||||||
|
test -d liblzma && rm -r liblzma
|
||||||
|
mkdir -p liblzma/usr/local
|
||||||
|
|
||||||
|
mv Root/usr/local/include liblzma/usr/local
|
||||||
|
mv Root/usr/local/lib liblzma/usr/local
|
||||||
|
|
||||||
|
mkdir -p Root/usr/local/lib
|
||||||
|
cp -p liblzma/usr/local/lib/liblzma.5.dylib Root/usr/local/lib
|
||||||
|
mkdir -p liblzma/usr/local/share/doc/xz
|
||||||
|
mv Root/usr/local/share/doc/xz/examples* liblzma/usr/local/share/doc/xz
|
||||||
|
|
||||||
|
# Strip debugging symbols and make relocatable
|
||||||
|
|
||||||
|
for bin in xz lzmainfo xzdec lzmadec; do
|
||||||
|
strip -S Root/usr/local/bin/$bin
|
||||||
|
install_name_tool -change /usr/local/lib/liblzma.5.dylib @executable_path/../lib/liblzma.5.dylib Root/usr/local/bin/$bin
|
||||||
|
done
|
||||||
|
|
||||||
|
for lib in liblzma.5.dylib; do
|
||||||
|
strip -S Root/usr/local/lib/$lib
|
||||||
|
install_name_tool -id @executable_path/../lib/liblzma.5.dylib Root/usr/local/lib/$lib
|
||||||
|
done
|
||||||
|
|
||||||
|
# Create tarball, but without the HFS+ attrib
|
||||||
|
|
||||||
|
rmdir debug lib po src/liblzma/api src/liblzma src/lzmainfo src/scripts src/xz src/xzdec src tests
|
||||||
|
|
||||||
|
( cd Root/usr/local; COPY_EXTENDED_ATTRIBUTES_DISABLE=true COPYFILE_DISABLE=true tar cvjf ../../../XZ.tbz * )
|
||||||
|
( cd liblzma; COPY_EXTENDED_ATTRIBUTES_DISABLE=true COPYFILE_DISABLE=true tar cvjf ../liblzma.tbz ./usr/local )
|
||||||
|
|
||||||
|
# Include documentation files for package
|
||||||
|
|
||||||
|
cp -p ../README Resources/ReadMe.txt
|
||||||
|
cp -p ../COPYING Resources/License.txt
|
||||||
|
|
||||||
|
# Make an Installer.app package
|
||||||
|
|
||||||
|
ID="org.tukaani.xz"
|
||||||
|
VERSION=`cd ..; sh build-aux/version.sh`
|
||||||
|
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
|
||||||
|
$PACKAGEMAKER -r Root/usr/local -l /usr/local -e Resources -i $ID -n $VERSION -t XZ -o XZ.pkg -g $PKGFORMAT --verbose
|
||||||
|
$PACKAGEMAKER -r liblzma -w -k -i $ID.liblzma -n $VERSION -o liblzma.pkg -g $PKGFORMAT --verbose
|
||||||
|
|
||||||
|
# Put the package in a disk image
|
||||||
|
|
||||||
|
if [ "$PKGFORMAT" != "10.5" ]; then
|
||||||
|
hdiutil create -fs HFS+ -format UDZO -quiet -srcfolder XZ.pkg -ov XZ.dmg
|
||||||
|
hdiutil internet-enable -yes -quiet XZ.dmg
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Build completed successfully."
|
||||||
|
echo
|
||||||
1
po/.gitignore
vendored
1
po/.gitignore
vendored
@ -5,7 +5,6 @@ Rules-quot
|
|||||||
boldquot.sed
|
boldquot.sed
|
||||||
en@boldquot.header
|
en@boldquot.header
|
||||||
en@quot.header
|
en@quot.header
|
||||||
insert-header.sed
|
|
||||||
insert-header.sin
|
insert-header.sin
|
||||||
quot.sed
|
quot.sed
|
||||||
remove-potcdate.sin
|
remove-potcdate.sin
|
||||||
|
|||||||
@ -9,9 +9,7 @@ fr
|
|||||||
hr
|
hr
|
||||||
hu
|
hu
|
||||||
it
|
it
|
||||||
ka
|
|
||||||
ko
|
ko
|
||||||
nl
|
|
||||||
pl
|
pl
|
||||||
pt
|
pt
|
||||||
pt_BR
|
pt_BR
|
||||||
|
|||||||
57
po/Makevars
57
po/Makevars
@ -1,10 +1,4 @@
|
|||||||
# SPDX-License-Identifier: FSFUL
|
|
||||||
|
|
||||||
# Makefile variables for PO directory in any package using GNU gettext.
|
# Makefile variables for PO directory in any package using GNU gettext.
|
||||||
#
|
|
||||||
# Copyright (C) 2003-2019 Free Software Foundation, Inc.
|
|
||||||
# This file is free software; the Free Software Foundation gives
|
|
||||||
# unlimited permission to use, copy, distribute, and modify it.
|
|
||||||
|
|
||||||
# Usually the message domain is the same as the package name.
|
# Usually the message domain is the same as the package name.
|
||||||
DOMAIN = $(PACKAGE)
|
DOMAIN = $(PACKAGE)
|
||||||
@ -14,7 +8,7 @@ subdir = po
|
|||||||
top_builddir = ..
|
top_builddir = ..
|
||||||
|
|
||||||
# These options get passed to xgettext.
|
# These options get passed to xgettext.
|
||||||
XGETTEXT_OPTIONS = --add-location=file --no-wrap --keyword=_ --keyword=N_ '--keyword=W_:1,"This is word wrapped at spaces. The Unicode character U+00A0 works as a non-breaking space. Tab (\t) is interpret as a zero-width space (the tab itself is not displayed); U+200B is NOT supported. Manual word wrapping with \n is supported but requires care."'
|
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
|
||||||
|
|
||||||
# This is the copyright holder that gets inserted into the header of the
|
# This is the copyright holder that gets inserted into the header of the
|
||||||
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
|
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
|
||||||
@ -24,14 +18,7 @@ XGETTEXT_OPTIONS = --add-location=file --no-wrap --keyword=_ --keyword=N_ '--key
|
|||||||
# or entity, or to disclaim their copyright. The empty string stands for
|
# or entity, or to disclaim their copyright. The empty string stands for
|
||||||
# the public domain; in this case the translators are expected to disclaim
|
# the public domain; in this case the translators are expected to disclaim
|
||||||
# their copyright.
|
# their copyright.
|
||||||
COPYRIGHT_HOLDER = The XZ Utils authors and contributors
|
COPYRIGHT_HOLDER =
|
||||||
|
|
||||||
# This tells whether or not to prepend "GNU " prefix to the package
|
|
||||||
# name that gets inserted into the header of the $(DOMAIN).pot file.
|
|
||||||
# Possible values are "yes", "no", or empty. If it is empty, try to
|
|
||||||
# detect it automatically by scanning the files in $(top_srcdir) for
|
|
||||||
# "GNU packagename" string.
|
|
||||||
PACKAGE_GNU = no
|
|
||||||
|
|
||||||
# This is the email address or URL to which the translators shall report
|
# This is the email address or URL to which the translators shall report
|
||||||
# bugs in the untranslated strings:
|
# bugs in the untranslated strings:
|
||||||
@ -53,39 +40,7 @@ MSGID_BUGS_ADDRESS =
|
|||||||
# message catalogs shall be used. It is usually empty.
|
# message catalogs shall be used. It is usually empty.
|
||||||
EXTRA_LOCALE_CATEGORIES =
|
EXTRA_LOCALE_CATEGORIES =
|
||||||
|
|
||||||
# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
|
# Although you may need slightly wider terminal than 80 chars, it is
|
||||||
# context. Possible values are "yes" and "no". Set this to yes if the
|
# much nicer to edit the output of --help when this is set.
|
||||||
# package uses functions taking also a message context, like pgettext(), or
|
XGETTEXT_OPTIONS += --no-wrap
|
||||||
# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
|
MSGMERGE += --no-wrap
|
||||||
USE_MSGCTXT = no
|
|
||||||
|
|
||||||
# These options get passed to msgmerge.
|
|
||||||
# Useful options are in particular:
|
|
||||||
# --previous to keep previous msgids of translated messages,
|
|
||||||
# --quiet to reduce the verbosity.
|
|
||||||
MSGMERGE_OPTIONS = --add-location=file --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.
|
|
||||||
#
|
|
||||||
# NOTE: The the custom "mydist" target in ../Makefile.am updates xz.pot.
|
|
||||||
# An updated xz.pot will cause the .po files to be updated too but
|
|
||||||
# only when updating would change more than the POT-Creation-Date line.
|
|
||||||
DIST_DEPENDS_ON_UPDATE_PO = no
|
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
# SPDX-License-Identifier: 0BSD
|
|
||||||
|
|
||||||
# List of source files which contain translatable strings.
|
# List of source files which contain translatable strings.
|
||||||
src/xz/args.c
|
src/xz/args.c
|
||||||
src/xz/coder.c
|
src/xz/coder.c
|
||||||
@ -8,12 +6,8 @@ src/xz/hardware.c
|
|||||||
src/xz/list.c
|
src/xz/list.c
|
||||||
src/xz/main.c
|
src/xz/main.c
|
||||||
src/xz/message.c
|
src/xz/message.c
|
||||||
src/xz/mytime.c
|
|
||||||
src/xz/options.c
|
src/xz/options.c
|
||||||
src/xz/sandbox.c
|
|
||||||
src/xz/signals.c
|
src/xz/signals.c
|
||||||
src/xz/suffix.c
|
src/xz/suffix.c
|
||||||
src/xz/util.c
|
src/xz/util.c
|
||||||
src/lzmainfo/lzmainfo.c
|
|
||||||
src/common/tuklib_exit.c
|
src/common/tuklib_exit.c
|
||||||
src/liblzma/common/string_conversion.c
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user