extlz4 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/Rakefile +21 -3
- data/contrib/lz4/CODING_STYLE +57 -0
- data/contrib/lz4/LICENSE +1 -1
- data/contrib/lz4/Makefile.inc +17 -15
- data/contrib/lz4/NEWS +25 -0
- data/contrib/lz4/README.md +16 -5
- data/contrib/lz4/SECURITY.md +17 -0
- data/contrib/lz4/build/README.md +4 -15
- data/contrib/lz4/build/VS2022/_build.bat +39 -0
- data/contrib/lz4/build/VS2022/_setup.bat +35 -0
- data/contrib/lz4/build/VS2022/_test.bat +38 -0
- data/contrib/lz4/build/VS2022/build-and-test-win32-debug.bat +26 -0
- data/contrib/lz4/build/VS2022/build-and-test-win32-release.bat +26 -0
- data/contrib/lz4/build/VS2022/build-and-test-x64-debug.bat +26 -0
- data/contrib/lz4/build/VS2022/build-and-test-x64-release.bat +26 -0
- data/contrib/lz4/build/VS2022/datagen/datagen.vcxproj +7 -3
- data/contrib/lz4/build/{VS2017 → VS2022}/lz4/lz4.vcxproj +21 -7
- data/contrib/lz4/build/VS2022/lz4.sln +5 -2
- data/contrib/lz4/build/cmake/CMakeLists.txt +95 -100
- data/contrib/lz4/build/meson/GetLz4LibraryVersion.py +39 -0
- data/contrib/lz4/build/meson/README.md +34 -0
- data/contrib/lz4/build/meson/meson/contrib/gen_manual/meson.build +42 -0
- data/contrib/lz4/build/meson/meson/contrib/meson.build +11 -0
- data/contrib/lz4/build/meson/meson/examples/meson.build +32 -0
- data/contrib/lz4/build/meson/meson/lib/meson.build +87 -0
- data/contrib/lz4/build/meson/meson/meson.build +135 -0
- data/contrib/lz4/build/meson/meson/ossfuzz/meson.build +35 -0
- data/contrib/lz4/build/meson/meson/programs/meson.build +91 -0
- data/contrib/lz4/build/meson/meson/tests/meson.build +162 -0
- data/contrib/lz4/build/meson/meson.build +31 -0
- data/contrib/lz4/build/meson/meson_options.txt +44 -0
- data/contrib/lz4/build/visual/README.md +5 -0
- data/contrib/lz4/build/visual/generate_solution.cmd +55 -0
- data/contrib/lz4/build/visual/generate_vs2015.cmd +3 -0
- data/contrib/lz4/build/visual/generate_vs2017.cmd +3 -0
- data/contrib/lz4/build/visual/generate_vs2019.cmd +3 -0
- data/contrib/lz4/build/visual/generate_vs2022.cmd +3 -0
- data/contrib/lz4/lib/README.md +25 -1
- data/contrib/lz4/lib/lz4.c +206 -99
- data/contrib/lz4/lib/lz4.h +111 -69
- data/contrib/lz4/lib/lz4file.c +111 -81
- data/contrib/lz4/lib/lz4file.h +2 -2
- data/contrib/lz4/lib/lz4frame.c +179 -121
- data/contrib/lz4/lib/lz4frame.h +162 -103
- data/contrib/lz4/lib/lz4hc.c +943 -382
- data/contrib/lz4/lib/lz4hc.h +43 -42
- data/contrib/lz4/lib/xxhash.c +21 -21
- data/contrib/lz4/ossfuzz/decompress_fuzzer.c +1 -1
- data/contrib/lz4/ossfuzz/fuzz_helpers.h +1 -1
- data/ext/blockapi.c +11 -11
- data/ext/frameapi.c +23 -23
- metadata +34 -28
- data/contrib/lz4/build/VS2010/datagen/datagen.vcxproj +0 -169
- data/contrib/lz4/build/VS2010/frametest/frametest.vcxproj +0 -176
- data/contrib/lz4/build/VS2010/fullbench/fullbench.vcxproj +0 -176
- data/contrib/lz4/build/VS2010/fullbench-dll/fullbench-dll.vcxproj +0 -180
- data/contrib/lz4/build/VS2010/fuzzer/fuzzer.vcxproj +0 -173
- data/contrib/lz4/build/VS2010/liblz4/liblz4.vcxproj +0 -175
- data/contrib/lz4/build/VS2010/liblz4-dll/liblz4-dll.rc +0 -51
- data/contrib/lz4/build/VS2010/liblz4-dll/liblz4-dll.vcxproj +0 -179
- data/contrib/lz4/build/VS2010/lz4/lz4.vcxproj +0 -189
- data/contrib/lz4/build/VS2010/lz4.sln +0 -98
- data/contrib/lz4/build/VS2017/datagen/datagen.vcxproj +0 -173
- data/contrib/lz4/build/VS2017/frametest/frametest.vcxproj +0 -180
- data/contrib/lz4/build/VS2017/fullbench/fullbench.vcxproj +0 -180
- data/contrib/lz4/build/VS2017/fullbench-dll/fullbench-dll.vcxproj +0 -184
- data/contrib/lz4/build/VS2017/fuzzer/fuzzer.vcxproj +0 -177
- data/contrib/lz4/build/VS2017/liblz4/liblz4.vcxproj +0 -179
- data/contrib/lz4/build/VS2017/liblz4-dll/liblz4-dll.rc +0 -51
- data/contrib/lz4/build/VS2017/liblz4-dll/liblz4-dll.vcxproj +0 -183
- data/contrib/lz4/build/VS2017/lz4/lz4.rc +0 -51
- data/contrib/lz4/build/VS2017/lz4.sln +0 -103
- /data/contrib/lz4/build/{VS2010 → VS2022}/lz4/lz4.rc +0 -0
@@ -0,0 +1,135 @@
|
|
1
|
+
# #############################################################################
|
2
|
+
# Copyright (c) 2018-present lzutao <taolzu(at)gmail.com>
|
3
|
+
# Copyright (c) 2022-present Tristan Partin <tristan(at)partin.io>
|
4
|
+
# All rights reserved.
|
5
|
+
#
|
6
|
+
# This source code is licensed under both the BSD-style license (found in the
|
7
|
+
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
8
|
+
# in the COPYING file in the root directory of this source tree).
|
9
|
+
# #############################################################################
|
10
|
+
|
11
|
+
cc = meson.get_compiler('c')
|
12
|
+
|
13
|
+
fs = import('fs')
|
14
|
+
pkgconfig = import('pkgconfig')
|
15
|
+
|
16
|
+
lz4_source_root = '../../..'
|
17
|
+
|
18
|
+
add_project_arguments('-DXXH_NAMESPACE=LZ4_', language: 'c')
|
19
|
+
|
20
|
+
if get_option('debug')
|
21
|
+
add_project_arguments(cc.get_supported_arguments(
|
22
|
+
'-Wcast-qual',
|
23
|
+
'-Wcast-align',
|
24
|
+
'-Wshadow',
|
25
|
+
'-Wswitch-enum',
|
26
|
+
'-Wdeclaration-after-statement',
|
27
|
+
'-Wstrict-prototypes',
|
28
|
+
'-Wundef',
|
29
|
+
'-Wpointer-arith',
|
30
|
+
'-Wstrict-aliasing=1',
|
31
|
+
'-DLZ4_DEBUG=@0@'.format(get_option('debug-level'))
|
32
|
+
),
|
33
|
+
language: 'c'
|
34
|
+
)
|
35
|
+
endif
|
36
|
+
|
37
|
+
compile_args = []
|
38
|
+
|
39
|
+
if not get_option('align-test')
|
40
|
+
add_project_arguments('-DLZ4_ALIGN_TEST=0', language: 'c')
|
41
|
+
endif
|
42
|
+
|
43
|
+
if get_option('disable-memory-allocation')
|
44
|
+
if get_option('default_library') != 'static'
|
45
|
+
error('Memory allocation can only be disabled in static builds')
|
46
|
+
endif
|
47
|
+
|
48
|
+
add_project_arguments('-DLZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION')
|
49
|
+
compile_args += '-DLZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION'
|
50
|
+
endif
|
51
|
+
|
52
|
+
add_project_arguments(
|
53
|
+
'-DLZ4_DISTANCE_MAX=@0@'.format(get_option('distance-max')),
|
54
|
+
language: 'c'
|
55
|
+
)
|
56
|
+
compile_args += '-DLZ4_DISTANCE_MAX=@0@'.format(get_option('distance-max'))
|
57
|
+
|
58
|
+
if not get_option('fast-dec-loop').auto()
|
59
|
+
add_project_arguments(
|
60
|
+
'-DLZ4_FAST_DEC_LOOP=@0@'.format(
|
61
|
+
get_option('fast-dec-loop').enabled() ? 1 : 0
|
62
|
+
),
|
63
|
+
language: 'c'
|
64
|
+
)
|
65
|
+
endif
|
66
|
+
|
67
|
+
if get_option('force-sw-bitcount')
|
68
|
+
add_project_arguments('-DLZ4_FORCE_SW_BITCOUNT', language: 'c')
|
69
|
+
endif
|
70
|
+
|
71
|
+
if get_option('freestanding')
|
72
|
+
add_project_arguments('-DLZ4_FREESTANDING=1', language: 'c')
|
73
|
+
compile_args += '-DLZ4_FREESTANDING=1'
|
74
|
+
endif
|
75
|
+
|
76
|
+
if get_option('memory-usage') > 0
|
77
|
+
add_project_arguments(
|
78
|
+
'-DLZ4_MEMORY_USAGE=@0@'.format(get_option('memory-usage')),
|
79
|
+
language: 'c'
|
80
|
+
)
|
81
|
+
compile_args += '-DLZ4_MEMORY_USAGE=@0@'.format(get_option('memory-usage'))
|
82
|
+
endif
|
83
|
+
|
84
|
+
if get_option('endianness-independent-output')
|
85
|
+
if get_option('default_library') != 'static'
|
86
|
+
error('Endianness-independent output can only be enabled in static builds')
|
87
|
+
endif
|
88
|
+
|
89
|
+
add_project_arguments('-DLZ4_STATIC_LINKING_ONLY_ENDIANNESS_INDEPENDENT_OUTPUT')
|
90
|
+
compile_args += '-DLZ4_STATIC_LINKING_ONLY_ENDIANNESS_INDEPENDENT_OUTPUT'
|
91
|
+
endif
|
92
|
+
|
93
|
+
if get_option('unstable')
|
94
|
+
add_project_arguments('-DLZ4_STATIC_LINKING_ONLY', language: 'c')
|
95
|
+
compile_args += '-DLZ4_STATIC_LINKING_ONLY'
|
96
|
+
if get_option('default_library') != 'static'
|
97
|
+
add_project_arguments('-DLZ4_PUBLISH_STATIC_FUNCTIONS', language: 'c')
|
98
|
+
compile_args += '-DLZ4_PUBLISH_STATIC_FUNCTIONS'
|
99
|
+
|
100
|
+
add_project_arguments('-DLZ4F_PUBLISH_STATIC_FUNCTIONS', language: 'c')
|
101
|
+
compile_args += '-DLZ4F_PUBLISH_STATIC_FUNCTIONS'
|
102
|
+
endif
|
103
|
+
endif
|
104
|
+
|
105
|
+
if get_option('user-memory-functions')
|
106
|
+
add_project_arguments('-DLZ4_USER_MEMORY_FUNCTIONS', language: 'c')
|
107
|
+
endif
|
108
|
+
|
109
|
+
run_env = environment()
|
110
|
+
|
111
|
+
subdir('lib')
|
112
|
+
|
113
|
+
if get_option('programs')
|
114
|
+
subdir('programs')
|
115
|
+
else
|
116
|
+
lz4 = disabler()
|
117
|
+
lz4cat = disabler()
|
118
|
+
unlz4 = disabler()
|
119
|
+
endif
|
120
|
+
|
121
|
+
if get_option('tests')
|
122
|
+
subdir('tests')
|
123
|
+
endif
|
124
|
+
|
125
|
+
if get_option('contrib')
|
126
|
+
subdir('contrib')
|
127
|
+
endif
|
128
|
+
|
129
|
+
if get_option('examples')
|
130
|
+
subdir('examples')
|
131
|
+
endif
|
132
|
+
|
133
|
+
if get_option('ossfuzz')
|
134
|
+
subdir('ossfuzz')
|
135
|
+
endif
|
@@ -0,0 +1,35 @@
|
|
1
|
+
fuzzers = [
|
2
|
+
'compress_frame_fuzzer',
|
3
|
+
'compress_fuzzer',
|
4
|
+
'compress_hc_fuzzer',
|
5
|
+
'decompress_frame_fuzzer',
|
6
|
+
'decompress_fuzzer',
|
7
|
+
'round_trip_frame_uncompressed_fuzzer',
|
8
|
+
'round_trip_fuzzer',
|
9
|
+
'round_trip_hc_fuzzer',
|
10
|
+
'round_trip_stream_fuzzer'
|
11
|
+
]
|
12
|
+
|
13
|
+
c_args = cc.get_supported_arguments(
|
14
|
+
'-Wno-unused-function',
|
15
|
+
'-Wno-sign-compare',
|
16
|
+
'-Wno-declaration-after-statement'
|
17
|
+
)
|
18
|
+
|
19
|
+
foreach f : fuzzers
|
20
|
+
lib = static_library(
|
21
|
+
f,
|
22
|
+
lz4_source_root / 'ossfuzz/@0@.c'.format(f),
|
23
|
+
lz4_source_root / 'ossfuzz/lz4_helpers.c',
|
24
|
+
lz4_source_root / 'ossfuzz/fuzz_data_producer.c',
|
25
|
+
c_args: c_args,
|
26
|
+
dependencies: [liblz4_internal_dep]
|
27
|
+
)
|
28
|
+
|
29
|
+
executable(
|
30
|
+
f,
|
31
|
+
lz4_source_root / 'ossfuzz/standaloneengine.c',
|
32
|
+
link_with: lib,
|
33
|
+
dependencies: [liblz4_internal_dep]
|
34
|
+
)
|
35
|
+
endforeach
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# #############################################################################
|
2
|
+
# Copyright (c) 2018-present lzutao <taolzu(at)gmail.com>
|
3
|
+
# Copyright (c) 2022-present Tristan Partin <tristan(at)partin.io>
|
4
|
+
# All rights reserved.
|
5
|
+
#
|
6
|
+
# This source code is licensed under both the BSD-style license (found in the
|
7
|
+
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
8
|
+
# in the COPYING file in the root directory of this source tree).
|
9
|
+
# #############################################################################
|
10
|
+
|
11
|
+
lz4_source_root = '../../../..'
|
12
|
+
|
13
|
+
# note:
|
14
|
+
# it would be preferable to use some kind of glob or wildcard expansion here...
|
15
|
+
sources = files(
|
16
|
+
lz4_source_root / 'programs/bench.c',
|
17
|
+
lz4_source_root / 'programs/lorem.c',
|
18
|
+
lz4_source_root / 'programs/lz4cli.c',
|
19
|
+
lz4_source_root / 'programs/lz4io.c',
|
20
|
+
lz4_source_root / 'programs/util.c',
|
21
|
+
lz4_source_root / 'programs/threadpool.c',
|
22
|
+
lz4_source_root / 'programs/timefn.c',
|
23
|
+
)
|
24
|
+
|
25
|
+
# Initialize an empty list for extra dependencies
|
26
|
+
extra_deps = []
|
27
|
+
|
28
|
+
if get_option('enable_multithread')
|
29
|
+
pthread_dep = dependency('threads', required : true)
|
30
|
+
extra_deps += [pthread_dep]
|
31
|
+
multithread_args = ['-DLZ4IO_MULTITHREAD']
|
32
|
+
else
|
33
|
+
multithread_args = []
|
34
|
+
endif
|
35
|
+
|
36
|
+
lz4 = executable(
|
37
|
+
'lz4',
|
38
|
+
sources,
|
39
|
+
include_directories: include_directories(lz4_source_root / 'programs'),
|
40
|
+
dependencies: [liblz4_internal_dep] + extra_deps,
|
41
|
+
c_args: multithread_args,
|
42
|
+
export_dynamic: get_option('debug') and host_machine.system() == 'windows',
|
43
|
+
install: true
|
44
|
+
)
|
45
|
+
|
46
|
+
lz4cat = custom_target(
|
47
|
+
'lz4cat',
|
48
|
+
input: lz4,
|
49
|
+
output: 'lz4cat',
|
50
|
+
command: [
|
51
|
+
'ln',
|
52
|
+
'--symbolic',
|
53
|
+
'--force',
|
54
|
+
fs.name(lz4.full_path()),
|
55
|
+
'@OUTPUT@'
|
56
|
+
]
|
57
|
+
)
|
58
|
+
|
59
|
+
unlz4 = custom_target(
|
60
|
+
'unlz4',
|
61
|
+
input: lz4,
|
62
|
+
output: 'unlz4',
|
63
|
+
command: [
|
64
|
+
'ln',
|
65
|
+
'--symbolic',
|
66
|
+
'--force',
|
67
|
+
fs.name(lz4.full_path()),
|
68
|
+
'@OUTPUT@'
|
69
|
+
]
|
70
|
+
)
|
71
|
+
|
72
|
+
meson.override_find_program('lz4', lz4)
|
73
|
+
|
74
|
+
run_env.prepend('PATH', meson.current_build_dir())
|
75
|
+
|
76
|
+
install_man(lz4_source_root / 'programs/lz4.1')
|
77
|
+
|
78
|
+
if meson.version().version_compare('>=0.61.0')
|
79
|
+
foreach alias : ['lz4c', 'lz4cat', 'unlz4']
|
80
|
+
install_symlink(
|
81
|
+
alias,
|
82
|
+
install_dir: get_option('bindir'),
|
83
|
+
pointing_to: 'lz4'
|
84
|
+
)
|
85
|
+
install_symlink(
|
86
|
+
'@0@.1'.format(alias),
|
87
|
+
install_dir: get_option('mandir') / 'man1',
|
88
|
+
pointing_to: 'lz4.1'
|
89
|
+
)
|
90
|
+
endforeach
|
91
|
+
endif
|
@@ -0,0 +1,162 @@
|
|
1
|
+
# #############################################################################
|
2
|
+
# Copyright (c) 2018-present lzutao <taolzu(at)gmail.com>
|
3
|
+
# Copyright (c) 2022-present Tristan Partin <tristan(at)partin.io>
|
4
|
+
# All rights reserved.
|
5
|
+
#
|
6
|
+
# This source code is licensed under both the BSD-style license (found in the
|
7
|
+
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
8
|
+
# in the COPYING file in the root directory of this source tree).
|
9
|
+
# #############################################################################
|
10
|
+
|
11
|
+
lz4_source_root = '../../../..'
|
12
|
+
|
13
|
+
fuzzer_time = 90
|
14
|
+
test_exes = {
|
15
|
+
'abiTest': {
|
16
|
+
'sources': files(lz4_source_root / 'tests/abiTest.c'),
|
17
|
+
'test': false,
|
18
|
+
},
|
19
|
+
'checkFrame': {
|
20
|
+
'sources': files(lz4_source_root / 'tests/checkFrame.c'),
|
21
|
+
'include_directories': include_directories(lz4_source_root / 'programs'),
|
22
|
+
},
|
23
|
+
'checkTag': {
|
24
|
+
'sources': files(lz4_source_root / 'tests/checkTag.c'),
|
25
|
+
'test': false,
|
26
|
+
},
|
27
|
+
'datagen': {
|
28
|
+
'sources': files(
|
29
|
+
lz4_source_root / 'programs/lorem.c',
|
30
|
+
lz4_source_root / 'tests/datagencli.c',
|
31
|
+
lz4_source_root / 'tests/datagen.c',
|
32
|
+
lz4_source_root / 'tests/loremOut.c',
|
33
|
+
),
|
34
|
+
'include_directories': include_directories(lz4_source_root / 'programs'),
|
35
|
+
},
|
36
|
+
'decompress-partial-usingDict.c': {
|
37
|
+
'sources': files(lz4_source_root / 'tests/decompress-partial-usingDict.c'),
|
38
|
+
},
|
39
|
+
'decompress-partial.c': {
|
40
|
+
'sources': files(lz4_source_root / 'tests/decompress-partial.c'),
|
41
|
+
},
|
42
|
+
'frametest': {
|
43
|
+
'sources': files(lz4_source_root / 'tests/frametest.c'),
|
44
|
+
'include_directories': include_directories(lz4_source_root / 'programs'),
|
45
|
+
'args': ['-v', '-T@0@s'.format(fuzzer_time)],
|
46
|
+
'test': false,
|
47
|
+
},
|
48
|
+
'freestanding': {
|
49
|
+
'sources': files(lz4_source_root / 'tests/freestanding.c'),
|
50
|
+
'c_args': ['-ffreestanding', '-Wno-unused-parameter', '-Wno-declaration-after-statement'],
|
51
|
+
'link_args': ['-nostdlib'],
|
52
|
+
'build': cc.get_id() in ['gcc', 'clang'] and
|
53
|
+
host_machine.system() == 'linux' and host_machine.cpu_family() == 'x86_64',
|
54
|
+
'override_options': ['optimization=1'],
|
55
|
+
},
|
56
|
+
'fullbench': {
|
57
|
+
'sources': files(lz4_source_root / 'tests/fullbench.c'),
|
58
|
+
'include_directories': include_directories(lz4_source_root / 'programs'),
|
59
|
+
'args': ['--no-prompt', '-i1', files(lz4_source_root / 'tests/COPYING')],
|
60
|
+
'test': false,
|
61
|
+
},
|
62
|
+
'fuzzer': {
|
63
|
+
'sources': files(lz4_source_root / 'tests/fuzzer.c'),
|
64
|
+
'include_directories': include_directories(lz4_source_root / 'programs'),
|
65
|
+
'args': ['-T@0@s'.format(fuzzer_time)],
|
66
|
+
'test': false,
|
67
|
+
},
|
68
|
+
'roundTripTest': {
|
69
|
+
'sources': files(lz4_source_root / 'tests/roundTripTest.c'),
|
70
|
+
'test': false,
|
71
|
+
},
|
72
|
+
}
|
73
|
+
|
74
|
+
targets = {}
|
75
|
+
|
76
|
+
foreach e, attrs : test_exes
|
77
|
+
if not attrs.get('build', true)
|
78
|
+
targets += {e: disabler()}
|
79
|
+
continue
|
80
|
+
endif
|
81
|
+
|
82
|
+
t = executable(
|
83
|
+
e,
|
84
|
+
attrs.get('sources'),
|
85
|
+
c_args: attrs.get('c_args', []),
|
86
|
+
link_args: attrs.get('link_args', []),
|
87
|
+
objects: attrs.get('objects', []),
|
88
|
+
dependencies: [liblz4_internal_dep],
|
89
|
+
include_directories: attrs.get('include_directories', []),
|
90
|
+
install: false,
|
91
|
+
override_options: attrs.get('override_options', [])
|
92
|
+
)
|
93
|
+
|
94
|
+
targets += {e: t}
|
95
|
+
|
96
|
+
if not attrs.get('test', true)
|
97
|
+
continue
|
98
|
+
endif
|
99
|
+
|
100
|
+
test(
|
101
|
+
e,
|
102
|
+
t,
|
103
|
+
args: attrs.get('params', []),
|
104
|
+
timeout: 120
|
105
|
+
)
|
106
|
+
endforeach
|
107
|
+
|
108
|
+
fs = import('fs')
|
109
|
+
|
110
|
+
run_env.prepend('PATH', meson.current_build_dir())
|
111
|
+
|
112
|
+
test_scripts = {
|
113
|
+
'lz4-basic': {
|
114
|
+
'depends': [lz4, lz4cat, unlz4, targets['datagen']],
|
115
|
+
},
|
116
|
+
'lz4-dict': {
|
117
|
+
'depends': [lz4, targets['datagen']],
|
118
|
+
},
|
119
|
+
'lz4-contentSize': {
|
120
|
+
'depends': [lz4, targets['datagen']],
|
121
|
+
},
|
122
|
+
'lz4-fast-hugefile': {
|
123
|
+
'depends': [lz4, targets['datagen']],
|
124
|
+
},
|
125
|
+
'lz4-frame-concatenation': {
|
126
|
+
'depends': [lz4, targets['datagen']],
|
127
|
+
},
|
128
|
+
'lz4-multiple': {
|
129
|
+
'depends': [lz4, targets['datagen']],
|
130
|
+
},
|
131
|
+
'lz4-multiple-legacy': {
|
132
|
+
'depends': [lz4, targets['datagen']],
|
133
|
+
},
|
134
|
+
'lz4-opt-parser': {
|
135
|
+
'depends': [lz4, targets['datagen']],
|
136
|
+
},
|
137
|
+
'lz4-skippable': {
|
138
|
+
'depends': [lz4],
|
139
|
+
},
|
140
|
+
'lz4-sparse': {
|
141
|
+
'depends': [lz4, targets['datagen']],
|
142
|
+
},
|
143
|
+
'lz4-testmode': {
|
144
|
+
'depends': [lz4, targets['datagen']],
|
145
|
+
},
|
146
|
+
'lz4hc-hugefile': {
|
147
|
+
'depends': [lz4, targets['datagen']],
|
148
|
+
},
|
149
|
+
}
|
150
|
+
|
151
|
+
foreach s, attrs : test_scripts
|
152
|
+
script = find_program(lz4_source_root / 'tests/test-@0@.sh'.format(s))
|
153
|
+
|
154
|
+
test(
|
155
|
+
'@0@'.format(s),
|
156
|
+
script,
|
157
|
+
depends: attrs.get('depends', []),
|
158
|
+
workdir: fs.parent(script.full_path()),
|
159
|
+
env: run_env,
|
160
|
+
timeout: 360
|
161
|
+
)
|
162
|
+
endforeach
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# #############################################################################
|
2
|
+
# Copyright (c) 2018-present lzutao <taolzu(at)gmail.com>
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# This source code is licensed under both the BSD-style license (found in the
|
6
|
+
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
7
|
+
# in the COPYING file in the root directory of this source tree).
|
8
|
+
# #############################################################################
|
9
|
+
|
10
|
+
# This is a dummy meson file.
|
11
|
+
# The intention is that it can be easily moved to the root of the project
|
12
|
+
# (together with meson_options.txt) and packaged for wrapdb.
|
13
|
+
|
14
|
+
project(
|
15
|
+
'lz4',
|
16
|
+
'c',
|
17
|
+
license: 'BSD-2-Clause-Patent AND GPL-2.0-or-later',
|
18
|
+
default_options: [
|
19
|
+
'c_std=c99',
|
20
|
+
'buildtype=release',
|
21
|
+
'warning_level=3'
|
22
|
+
],
|
23
|
+
version: run_command(
|
24
|
+
find_program('GetLz4LibraryVersion.py'),
|
25
|
+
'../../lib/lz4.h',
|
26
|
+
check: true
|
27
|
+
).stdout().strip(),
|
28
|
+
meson_version: '>=0.58.0'
|
29
|
+
)
|
30
|
+
|
31
|
+
subdir('meson')
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# #############################################################################
|
2
|
+
# Copyright (c) 2018-present lzutao <taolzu(at)gmail.com>
|
3
|
+
# Copyright (c) 2022-present Tristan Partin <tristan(at)partin.io>
|
4
|
+
# All rights reserved.
|
5
|
+
#
|
6
|
+
# This source code is licensed under both the BSD-style license (found in the
|
7
|
+
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
8
|
+
# in the COPYING file in the root directory of this source tree).
|
9
|
+
# #############################################################################
|
10
|
+
|
11
|
+
option('enable_multithread', type: 'boolean', value: true,
|
12
|
+
description: 'Enable multi-threading support')
|
13
|
+
option('align-test', type: 'boolean', value: true,
|
14
|
+
description: 'See LZ4_ALIGN_TEST')
|
15
|
+
option('contrib', type: 'boolean', value: false,
|
16
|
+
description: 'Enable contrib')
|
17
|
+
option('debug-level', type: 'integer', min: 0, max: 7, value: 1,
|
18
|
+
description: 'Enable run-time debug. See lib/lz4hc.c')
|
19
|
+
option('disable-memory-allocation', type: 'boolean', value: false,
|
20
|
+
description: 'See LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION. Static builds only')
|
21
|
+
option('distance-max', type: 'integer', min: 0, max: 65535, value: 65535,
|
22
|
+
description: 'See LZ4_DISTANCE_MAX')
|
23
|
+
option('endianness-independent-output', type: 'boolean', value: false,
|
24
|
+
description: 'See LZ4_STATIC_LINKING_ONLY_ENDIANNESS_INDEPENDENT_OUTPUT. Static builds only')
|
25
|
+
option('examples', type: 'boolean', value: false,
|
26
|
+
description: 'Enable examples')
|
27
|
+
option('fast-dec-loop', type: 'feature', value: 'auto',
|
28
|
+
description: 'See LZ4_FAST_DEC_LOOP')
|
29
|
+
option('force-sw-bitcount', type: 'boolean', value: false,
|
30
|
+
description: 'See LZ4_FORCE_SW_BITCOUNT')
|
31
|
+
option('freestanding', type: 'boolean', value: false,
|
32
|
+
description: 'See LZ4_FREESTANDING')
|
33
|
+
option('memory-usage', type: 'integer', min: 0, max: 20, value: 0,
|
34
|
+
description: 'See LZ4_MEMORY_USAGE. 0 means use the LZ4 default')
|
35
|
+
option('ossfuzz', type: 'boolean', value: true,
|
36
|
+
description: 'Enable ossfuzz')
|
37
|
+
option('programs', type: 'boolean', value: false,
|
38
|
+
description: 'Enable programs')
|
39
|
+
option('tests', type: 'boolean', value: false,
|
40
|
+
description: 'Enable tests')
|
41
|
+
option('unstable', type: 'boolean', value: false,
|
42
|
+
description: 'Expose unstable interfaces')
|
43
|
+
option('user-memory-functions', type: 'boolean', value: false,
|
44
|
+
description: 'See LZ4_USER_MEMORY_FUNCTIONS')
|
@@ -0,0 +1,5 @@
|
|
1
|
+
These scripts will generate Visual Studio Solutions for a selected set of supported versions of MS Visual.
|
2
|
+
|
3
|
+
For these scripts to work, both `cmake` and the relevant Visual Studio version must be locally installed on the system where the script is run.
|
4
|
+
|
5
|
+
If `cmake` is installed into a non-standard directory, or user wants to test a specific version of `cmake`, the target `cmake` directory can be provided via the environment variable `CMAKE_PATH`.
|
@@ -0,0 +1,55 @@
|
|
1
|
+
:: Requires 1 parameter == GENERATOR
|
2
|
+
@echo off
|
3
|
+
setlocal
|
4
|
+
|
5
|
+
:: Set path
|
6
|
+
set "BUILD_BASE_DIR=%~dp0" :: Use the directory where the script is located
|
7
|
+
set "CMAKELIST_DIR=..\..\cmake"
|
8
|
+
|
9
|
+
if "%~1"=="" (
|
10
|
+
echo No generator specified as first parameter
|
11
|
+
exit /b 1
|
12
|
+
)
|
13
|
+
set "GENERATOR=%~1"
|
14
|
+
|
15
|
+
:: Check if a user-defined CMAKE_PATH is set and prioritize it
|
16
|
+
if defined CMAKE_PATH (
|
17
|
+
set "CMAKE_EXECUTABLE=%CMAKE_PATH%\cmake.exe"
|
18
|
+
echo Using user-defined cmake at %CMAKE_PATH%
|
19
|
+
) else (
|
20
|
+
:: Attempt to find cmake in the system PATH
|
21
|
+
where cmake >nul 2>&1
|
22
|
+
if %ERRORLEVEL% neq 0 (
|
23
|
+
:: Use the default standard cmake installation directory if not found in PATH
|
24
|
+
set "CMAKE_PATH=C:\Program Files\CMake\bin"
|
25
|
+
echo CMake not in system PATH => using default CMAKE_PATH=%CMAKE_PATH%
|
26
|
+
set "CMAKE_EXECUTABLE=%CMAKE_PATH%\cmake.exe"
|
27
|
+
) else (
|
28
|
+
set "CMAKE_EXECUTABLE=cmake"
|
29
|
+
echo CMake found in system PATH.
|
30
|
+
)
|
31
|
+
)
|
32
|
+
|
33
|
+
:: Set the build directory to a subdirectory named after the generator
|
34
|
+
set "BUILD_DIR=%BUILD_BASE_DIR%\%GENERATOR%"
|
35
|
+
|
36
|
+
:: Create the build directory if it doesn't exist
|
37
|
+
if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"
|
38
|
+
|
39
|
+
:: Run CMake to configure the project and generate the solution
|
40
|
+
pushd "%BUILD_DIR%"
|
41
|
+
"%CMAKE_EXECUTABLE%" -G "%GENERATOR%" "%CMAKELIST_DIR%"
|
42
|
+
if %ERRORLEVEL% neq 0 goto :error
|
43
|
+
|
44
|
+
:: If successful, end script
|
45
|
+
echo Build configuration successful for %GENERATOR%.
|
46
|
+
goto :end
|
47
|
+
|
48
|
+
:error
|
49
|
+
echo Failed to configure build for %GENERATOR%.
|
50
|
+
exit /b 1
|
51
|
+
|
52
|
+
:end
|
53
|
+
popd
|
54
|
+
endlocal
|
55
|
+
@echo on
|
data/contrib/lz4/lib/README.md
CHANGED
@@ -100,7 +100,7 @@ The following build macro can be selected to adjust source code behavior at comp
|
|
100
100
|
passed as argument to become a compression state is suitably aligned.
|
101
101
|
This test can be disabled if it proves flaky, by setting this value to 0.
|
102
102
|
|
103
|
-
- `LZ4_USER_MEMORY_FUNCTIONS` : replace calls to `<stdlib
|
103
|
+
- `LZ4_USER_MEMORY_FUNCTIONS` : replace calls to `<stdlib.h>`'s `malloc()`, `calloc()` and `free()`
|
104
104
|
by user-defined functions, which must be named `LZ4_malloc()`, `LZ4_calloc()` and `LZ4_free()`.
|
105
105
|
User functions must be available at link time.
|
106
106
|
|
@@ -108,6 +108,12 @@ The following build macro can be selected to adjust source code behavior at comp
|
|
108
108
|
Remove support of dynamic memory allocation.
|
109
109
|
For more details, see description of this macro in `lib/lz4.c`.
|
110
110
|
|
111
|
+
- `LZ4_STATIC_LINKING_ONLY_ENDIANNESS_INDEPENDENT_OUTPUT` : experimental feature aimed at producing the same
|
112
|
+
compressed output on platforms of different endianness (i.e. little-endian and big-endian).
|
113
|
+
Output on little-endian platforms shall remain unchanged, while big-endian platforms will start producing
|
114
|
+
the same output as little-endian ones. This isn't expected to impact backward- and forward-compatibility
|
115
|
+
in any way.
|
116
|
+
|
111
117
|
- `LZ4_FREESTANDING` : by setting this build macro to 1,
|
112
118
|
LZ4/HC removes dependencies on the C standard library,
|
113
119
|
including allocation functions and `memmove()`, `memcpy()`, and `memset()`.
|
@@ -115,6 +121,24 @@ The following build macro can be selected to adjust source code behavior at comp
|
|
115
121
|
(embedded, bootloader, etc).
|
116
122
|
For more details, see description of this macro in `lib/lz4.h`.
|
117
123
|
|
124
|
+
- `LZ4_HEAPMODE` : Select how stateless compression functions like `LZ4_compress_default()`
|
125
|
+
allocate memory for their hash table,
|
126
|
+
in memory stack (0:default, fastest), or in memory heap (1:requires malloc()).
|
127
|
+
|
128
|
+
- `LZ4HC_HEAPMODE` : Select how stateless HC compression functions like `LZ4_compress_HC()`
|
129
|
+
allocate memory for their workspace:
|
130
|
+
in stack (0), or in heap (1:default).
|
131
|
+
Since workspace is rather large, stack can be inconvenient, hence heap mode is recommended.
|
132
|
+
|
133
|
+
- `LZ4F_HEAPMODE` : selects how `LZ4F_compressFrame()` allocates the compression state,
|
134
|
+
either on stack (default, value 0) or using heap memory (value 1).
|
135
|
+
|
136
|
+
|
137
|
+
#### Makefile variables
|
138
|
+
|
139
|
+
The following `Makefile` variables can be selected to alter the profile of produced binaries :
|
140
|
+
- `BUILD_SHARED` : generate `liblz4` dynamic library (enabled by default)
|
141
|
+
- `BUILD_STATIC` : generate `liblz4` static library (enabled by default)
|
118
142
|
|
119
143
|
|
120
144
|
#### Amalgamation
|