zstd-ruby 1.4.4.0 → 1.5.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/README.md +78 -5
  4. data/Rakefile +8 -2
  5. data/ext/zstdruby/common.h +15 -0
  6. data/ext/zstdruby/extconf.rb +3 -2
  7. data/ext/zstdruby/libzstd/common/allocations.h +55 -0
  8. data/ext/zstdruby/libzstd/common/bits.h +200 -0
  9. data/ext/zstdruby/libzstd/common/bitstream.h +74 -97
  10. data/ext/zstdruby/libzstd/common/compiler.h +219 -20
  11. data/ext/zstdruby/libzstd/common/cpu.h +1 -3
  12. data/ext/zstdruby/libzstd/common/debug.c +11 -31
  13. data/ext/zstdruby/libzstd/common/debug.h +22 -49
  14. data/ext/zstdruby/libzstd/common/entropy_common.c +184 -80
  15. data/ext/zstdruby/libzstd/common/error_private.c +11 -2
  16. data/ext/zstdruby/libzstd/common/error_private.h +87 -4
  17. data/ext/zstdruby/libzstd/common/fse.h +47 -116
  18. data/ext/zstdruby/libzstd/common/fse_decompress.c +127 -127
  19. data/ext/zstdruby/libzstd/common/huf.h +112 -197
  20. data/ext/zstdruby/libzstd/common/mem.h +124 -142
  21. data/ext/zstdruby/libzstd/common/pool.c +54 -27
  22. data/ext/zstdruby/libzstd/common/pool.h +11 -5
  23. data/ext/zstdruby/libzstd/common/portability_macros.h +156 -0
  24. data/ext/zstdruby/libzstd/common/threading.c +78 -22
  25. data/ext/zstdruby/libzstd/common/threading.h +9 -13
  26. data/ext/zstdruby/libzstd/common/xxhash.c +15 -873
  27. data/ext/zstdruby/libzstd/common/xxhash.h +5572 -191
  28. data/ext/zstdruby/libzstd/common/zstd_common.c +2 -37
  29. data/ext/zstdruby/libzstd/common/zstd_deps.h +111 -0
  30. data/ext/zstdruby/libzstd/common/zstd_internal.h +186 -144
  31. data/ext/zstdruby/libzstd/common/zstd_trace.h +163 -0
  32. data/ext/zstdruby/libzstd/compress/clevels.h +134 -0
  33. data/ext/zstdruby/libzstd/compress/fse_compress.c +99 -196
  34. data/ext/zstdruby/libzstd/compress/hist.c +41 -63
  35. data/ext/zstdruby/libzstd/compress/hist.h +13 -33
  36. data/ext/zstdruby/libzstd/compress/huf_compress.c +968 -331
  37. data/ext/zstdruby/libzstd/compress/zstd_compress.c +4120 -1191
  38. data/ext/zstdruby/libzstd/compress/zstd_compress_internal.h +688 -159
  39. data/ext/zstdruby/libzstd/compress/zstd_compress_literals.c +121 -40
  40. data/ext/zstdruby/libzstd/compress/zstd_compress_literals.h +16 -6
  41. data/ext/zstdruby/libzstd/compress/zstd_compress_sequences.c +62 -35
  42. data/ext/zstdruby/libzstd/compress/zstd_compress_sequences.h +10 -3
  43. data/ext/zstdruby/libzstd/compress/zstd_compress_superblock.c +577 -0
  44. data/ext/zstdruby/libzstd/compress/zstd_compress_superblock.h +32 -0
  45. data/ext/zstdruby/libzstd/compress/zstd_cwksp.h +322 -115
  46. data/ext/zstdruby/libzstd/compress/zstd_double_fast.c +394 -154
  47. data/ext/zstdruby/libzstd/compress/zstd_double_fast.h +4 -3
  48. data/ext/zstdruby/libzstd/compress/zstd_fast.c +729 -253
  49. data/ext/zstdruby/libzstd/compress/zstd_fast.h +4 -3
  50. data/ext/zstdruby/libzstd/compress/zstd_lazy.c +1289 -247
  51. data/ext/zstdruby/libzstd/compress/zstd_lazy.h +61 -1
  52. data/ext/zstdruby/libzstd/compress/zstd_ldm.c +339 -212
  53. data/ext/zstdruby/libzstd/compress/zstd_ldm.h +15 -3
  54. data/ext/zstdruby/libzstd/compress/zstd_ldm_geartab.h +106 -0
  55. data/ext/zstdruby/libzstd/compress/zstd_opt.c +508 -282
  56. data/ext/zstdruby/libzstd/compress/zstd_opt.h +1 -1
  57. data/ext/zstdruby/libzstd/compress/zstdmt_compress.c +217 -466
  58. data/ext/zstdruby/libzstd/compress/zstdmt_compress.h +35 -114
  59. data/ext/zstdruby/libzstd/decompress/huf_decompress.c +1220 -572
  60. data/ext/zstdruby/libzstd/decompress/huf_decompress_amd64.S +576 -0
  61. data/ext/zstdruby/libzstd/decompress/zstd_ddict.c +23 -19
  62. data/ext/zstdruby/libzstd/decompress/zstd_ddict.h +3 -3
  63. data/ext/zstdruby/libzstd/decompress/zstd_decompress.c +859 -273
  64. data/ext/zstdruby/libzstd/decompress/zstd_decompress_block.c +1244 -375
  65. data/ext/zstdruby/libzstd/decompress/zstd_decompress_block.h +21 -7
  66. data/ext/zstdruby/libzstd/decompress/zstd_decompress_internal.h +74 -11
  67. data/ext/zstdruby/libzstd/dictBuilder/cover.c +75 -54
  68. data/ext/zstdruby/libzstd/dictBuilder/cover.h +20 -9
  69. data/ext/zstdruby/libzstd/dictBuilder/divsufsort.c +1 -1
  70. data/ext/zstdruby/libzstd/dictBuilder/fastcover.c +55 -36
  71. data/ext/zstdruby/libzstd/dictBuilder/zdict.c +126 -110
  72. data/ext/zstdruby/libzstd/{dictBuilder/zdict.h → zdict.h} +248 -56
  73. data/ext/zstdruby/libzstd/zstd.h +1277 -306
  74. data/ext/zstdruby/libzstd/{common/zstd_errors.h → zstd_errors.h} +29 -8
  75. data/ext/zstdruby/main.c +20 -0
  76. data/ext/zstdruby/skippable_frame.c +63 -0
  77. data/ext/zstdruby/streaming_compress.c +177 -0
  78. data/ext/zstdruby/streaming_compress.h +5 -0
  79. data/ext/zstdruby/streaming_decompress.c +123 -0
  80. data/ext/zstdruby/zstdruby.c +114 -32
  81. data/lib/zstd-ruby/version.rb +1 -1
  82. data/lib/zstd-ruby.rb +0 -1
  83. data/zstd-ruby.gemspec +1 -1
  84. metadata +24 -39
  85. data/.travis.yml +0 -14
  86. data/ext/zstdruby/libzstd/.gitignore +0 -3
  87. data/ext/zstdruby/libzstd/BUCK +0 -234
  88. data/ext/zstdruby/libzstd/Makefile +0 -289
  89. data/ext/zstdruby/libzstd/README.md +0 -159
  90. data/ext/zstdruby/libzstd/deprecated/zbuff.h +0 -214
  91. data/ext/zstdruby/libzstd/deprecated/zbuff_common.c +0 -26
  92. data/ext/zstdruby/libzstd/deprecated/zbuff_compress.c +0 -147
  93. data/ext/zstdruby/libzstd/deprecated/zbuff_decompress.c +0 -75
  94. data/ext/zstdruby/libzstd/dll/example/Makefile +0 -47
  95. data/ext/zstdruby/libzstd/dll/example/README.md +0 -69
  96. data/ext/zstdruby/libzstd/dll/example/build_package.bat +0 -20
  97. data/ext/zstdruby/libzstd/dll/example/fullbench-dll.sln +0 -25
  98. data/ext/zstdruby/libzstd/dll/example/fullbench-dll.vcxproj +0 -181
  99. data/ext/zstdruby/libzstd/legacy/zstd_legacy.h +0 -415
  100. data/ext/zstdruby/libzstd/legacy/zstd_v01.c +0 -2152
  101. data/ext/zstdruby/libzstd/legacy/zstd_v01.h +0 -94
  102. data/ext/zstdruby/libzstd/legacy/zstd_v02.c +0 -3514
  103. data/ext/zstdruby/libzstd/legacy/zstd_v02.h +0 -93
  104. data/ext/zstdruby/libzstd/legacy/zstd_v03.c +0 -3156
  105. data/ext/zstdruby/libzstd/legacy/zstd_v03.h +0 -93
  106. data/ext/zstdruby/libzstd/legacy/zstd_v04.c +0 -3641
  107. data/ext/zstdruby/libzstd/legacy/zstd_v04.h +0 -142
  108. data/ext/zstdruby/libzstd/legacy/zstd_v05.c +0 -4046
  109. data/ext/zstdruby/libzstd/legacy/zstd_v05.h +0 -162
  110. data/ext/zstdruby/libzstd/legacy/zstd_v06.c +0 -4150
  111. data/ext/zstdruby/libzstd/legacy/zstd_v06.h +0 -172
  112. data/ext/zstdruby/libzstd/legacy/zstd_v07.c +0 -4533
  113. data/ext/zstdruby/libzstd/legacy/zstd_v07.h +0 -187
  114. data/ext/zstdruby/libzstd/libzstd.pc.in +0 -15
  115. data/ext/zstdruby/zstdruby.h +0 -6
data/zstd-ruby.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  #end
25
25
 
26
26
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
- f.match(%r{^(test|spec|features|benchmarks|zstd)/})
27
+ f.match(%r{^(test|spec|features|benchmarks|zstd|.github)/})
28
28
  end
29
29
  spec.bindir = "exe"
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zstd-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4.0
4
+ version: 1.5.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SpringMT
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-06 00:00:00.000000000 Z
11
+ date: 2023-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -78,7 +78,6 @@ files:
78
78
  - ".gitignore"
79
79
  - ".gitmodules"
80
80
  - ".rspec"
81
- - ".travis.yml"
82
81
  - CODE_OF_CONDUCT.md
83
82
  - Gemfile
84
83
  - LICENSE.txt
@@ -86,11 +85,10 @@ files:
86
85
  - Rakefile
87
86
  - bin/console
88
87
  - bin/setup
88
+ - ext/zstdruby/common.h
89
89
  - ext/zstdruby/extconf.rb
90
- - ext/zstdruby/libzstd/.gitignore
91
- - ext/zstdruby/libzstd/BUCK
92
- - ext/zstdruby/libzstd/Makefile
93
- - ext/zstdruby/libzstd/README.md
90
+ - ext/zstdruby/libzstd/common/allocations.h
91
+ - ext/zstdruby/libzstd/common/bits.h
94
92
  - ext/zstdruby/libzstd/common/bitstream.h
95
93
  - ext/zstdruby/libzstd/common/compiler.h
96
94
  - ext/zstdruby/libzstd/common/cpu.h
@@ -105,13 +103,16 @@ files:
105
103
  - ext/zstdruby/libzstd/common/mem.h
106
104
  - ext/zstdruby/libzstd/common/pool.c
107
105
  - ext/zstdruby/libzstd/common/pool.h
106
+ - ext/zstdruby/libzstd/common/portability_macros.h
108
107
  - ext/zstdruby/libzstd/common/threading.c
109
108
  - ext/zstdruby/libzstd/common/threading.h
110
109
  - ext/zstdruby/libzstd/common/xxhash.c
111
110
  - ext/zstdruby/libzstd/common/xxhash.h
112
111
  - ext/zstdruby/libzstd/common/zstd_common.c
113
- - ext/zstdruby/libzstd/common/zstd_errors.h
112
+ - ext/zstdruby/libzstd/common/zstd_deps.h
114
113
  - ext/zstdruby/libzstd/common/zstd_internal.h
114
+ - ext/zstdruby/libzstd/common/zstd_trace.h
115
+ - ext/zstdruby/libzstd/compress/clevels.h
115
116
  - ext/zstdruby/libzstd/compress/fse_compress.c
116
117
  - ext/zstdruby/libzstd/compress/hist.c
117
118
  - ext/zstdruby/libzstd/compress/hist.h
@@ -122,6 +123,8 @@ files:
122
123
  - ext/zstdruby/libzstd/compress/zstd_compress_literals.h
123
124
  - ext/zstdruby/libzstd/compress/zstd_compress_sequences.c
124
125
  - ext/zstdruby/libzstd/compress/zstd_compress_sequences.h
126
+ - ext/zstdruby/libzstd/compress/zstd_compress_superblock.c
127
+ - ext/zstdruby/libzstd/compress/zstd_compress_superblock.h
125
128
  - ext/zstdruby/libzstd/compress/zstd_cwksp.h
126
129
  - ext/zstdruby/libzstd/compress/zstd_double_fast.c
127
130
  - ext/zstdruby/libzstd/compress/zstd_double_fast.h
@@ -131,52 +134,34 @@ files:
131
134
  - ext/zstdruby/libzstd/compress/zstd_lazy.h
132
135
  - ext/zstdruby/libzstd/compress/zstd_ldm.c
133
136
  - ext/zstdruby/libzstd/compress/zstd_ldm.h
137
+ - ext/zstdruby/libzstd/compress/zstd_ldm_geartab.h
134
138
  - ext/zstdruby/libzstd/compress/zstd_opt.c
135
139
  - ext/zstdruby/libzstd/compress/zstd_opt.h
136
140
  - ext/zstdruby/libzstd/compress/zstdmt_compress.c
137
141
  - ext/zstdruby/libzstd/compress/zstdmt_compress.h
138
142
  - ext/zstdruby/libzstd/decompress/huf_decompress.c
143
+ - ext/zstdruby/libzstd/decompress/huf_decompress_amd64.S
139
144
  - ext/zstdruby/libzstd/decompress/zstd_ddict.c
140
145
  - ext/zstdruby/libzstd/decompress/zstd_ddict.h
141
146
  - ext/zstdruby/libzstd/decompress/zstd_decompress.c
142
147
  - ext/zstdruby/libzstd/decompress/zstd_decompress_block.c
143
148
  - ext/zstdruby/libzstd/decompress/zstd_decompress_block.h
144
149
  - ext/zstdruby/libzstd/decompress/zstd_decompress_internal.h
145
- - ext/zstdruby/libzstd/deprecated/zbuff.h
146
- - ext/zstdruby/libzstd/deprecated/zbuff_common.c
147
- - ext/zstdruby/libzstd/deprecated/zbuff_compress.c
148
- - ext/zstdruby/libzstd/deprecated/zbuff_decompress.c
149
150
  - ext/zstdruby/libzstd/dictBuilder/cover.c
150
151
  - ext/zstdruby/libzstd/dictBuilder/cover.h
151
152
  - ext/zstdruby/libzstd/dictBuilder/divsufsort.c
152
153
  - ext/zstdruby/libzstd/dictBuilder/divsufsort.h
153
154
  - ext/zstdruby/libzstd/dictBuilder/fastcover.c
154
155
  - ext/zstdruby/libzstd/dictBuilder/zdict.c
155
- - ext/zstdruby/libzstd/dictBuilder/zdict.h
156
- - ext/zstdruby/libzstd/dll/example/Makefile
157
- - ext/zstdruby/libzstd/dll/example/README.md
158
- - ext/zstdruby/libzstd/dll/example/build_package.bat
159
- - ext/zstdruby/libzstd/dll/example/fullbench-dll.sln
160
- - ext/zstdruby/libzstd/dll/example/fullbench-dll.vcxproj
161
- - ext/zstdruby/libzstd/legacy/zstd_legacy.h
162
- - ext/zstdruby/libzstd/legacy/zstd_v01.c
163
- - ext/zstdruby/libzstd/legacy/zstd_v01.h
164
- - ext/zstdruby/libzstd/legacy/zstd_v02.c
165
- - ext/zstdruby/libzstd/legacy/zstd_v02.h
166
- - ext/zstdruby/libzstd/legacy/zstd_v03.c
167
- - ext/zstdruby/libzstd/legacy/zstd_v03.h
168
- - ext/zstdruby/libzstd/legacy/zstd_v04.c
169
- - ext/zstdruby/libzstd/legacy/zstd_v04.h
170
- - ext/zstdruby/libzstd/legacy/zstd_v05.c
171
- - ext/zstdruby/libzstd/legacy/zstd_v05.h
172
- - ext/zstdruby/libzstd/legacy/zstd_v06.c
173
- - ext/zstdruby/libzstd/legacy/zstd_v06.h
174
- - ext/zstdruby/libzstd/legacy/zstd_v07.c
175
- - ext/zstdruby/libzstd/legacy/zstd_v07.h
176
- - ext/zstdruby/libzstd/libzstd.pc.in
156
+ - ext/zstdruby/libzstd/zdict.h
177
157
  - ext/zstdruby/libzstd/zstd.h
158
+ - ext/zstdruby/libzstd/zstd_errors.h
159
+ - ext/zstdruby/main.c
160
+ - ext/zstdruby/skippable_frame.c
161
+ - ext/zstdruby/streaming_compress.c
162
+ - ext/zstdruby/streaming_compress.h
163
+ - ext/zstdruby/streaming_decompress.c
178
164
  - ext/zstdruby/zstdruby.c
179
- - ext/zstdruby/zstdruby.h
180
165
  - lib/zstd-ruby.rb
181
166
  - lib/zstd-ruby/version.rb
182
167
  - zstd-ruby.gemspec
@@ -184,7 +169,7 @@ homepage: https://github.com/SpringMT/zstd-ruby
184
169
  licenses:
185
170
  - MIT
186
171
  metadata: {}
187
- post_install_message:
172
+ post_install_message:
188
173
  rdoc_options: []
189
174
  require_paths:
190
175
  - lib
@@ -199,8 +184,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
184
  - !ruby/object:Gem::Version
200
185
  version: '0'
201
186
  requirements: []
202
- rubygems_version: 3.0.3
203
- signing_key:
187
+ rubygems_version: 3.3.26
188
+ signing_key:
204
189
  specification_version: 4
205
190
  summary: Ruby binding for zstd(Zstandard - Fast real-time compression algorithm)
206
191
  test_files: []
data/.travis.yml DELETED
@@ -1,14 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.6
5
- - 2.5
6
- - 2.4
7
- - 2.3
8
- - 2.2
9
-
10
- before_install:
11
- - gem install bundler -v 1.14.3
12
-
13
- before_script:
14
- - bundle exec rake compile
@@ -1,3 +0,0 @@
1
- # make install artefact
2
- libzstd.pc
3
- libzstd-nomt
@@ -1,234 +0,0 @@
1
- cxx_library(
2
- name='zstd',
3
- header_namespace='',
4
- exported_headers=['zstd.h'],
5
- visibility=['PUBLIC'],
6
- deps=[
7
- ':common',
8
- ':compress',
9
- ':decompress',
10
- ':deprecated',
11
- ],
12
- )
13
-
14
- cxx_library(
15
- name='compress',
16
- header_namespace='',
17
- visibility=['PUBLIC'],
18
- exported_headers=subdir_glob([
19
- ('compress', 'zstd*.h'),
20
- ]),
21
- srcs=glob(['compress/zstd*.c', 'compress/hist.c']),
22
- deps=[':common'],
23
- )
24
-
25
- cxx_library(
26
- name='decompress',
27
- header_namespace='',
28
- visibility=['PUBLIC'],
29
- headers=subdir_glob([
30
- ('decompress', '*_impl.h'),
31
- ]),
32
- srcs=glob(['decompress/zstd*.c']),
33
- deps=[
34
- ':common',
35
- ':legacy',
36
- ],
37
- )
38
-
39
- cxx_library(
40
- name='deprecated',
41
- header_namespace='',
42
- visibility=['PUBLIC'],
43
- exported_headers=subdir_glob([
44
- ('deprecated', '*.h'),
45
- ]),
46
- srcs=glob(['deprecated/*.c']),
47
- deps=[':common'],
48
- )
49
-
50
- cxx_library(
51
- name='legacy',
52
- header_namespace='',
53
- visibility=['PUBLIC'],
54
- exported_headers=subdir_glob([
55
- ('legacy', '*.h'),
56
- ]),
57
- srcs=glob(['legacy/*.c']),
58
- deps=[':common'],
59
- exported_preprocessor_flags=[
60
- '-DZSTD_LEGACY_SUPPORT=4',
61
- ],
62
- )
63
-
64
- cxx_library(
65
- name='zdict',
66
- header_namespace='',
67
- visibility=['PUBLIC'],
68
- exported_headers=subdir_glob([
69
- ('dictBuilder', 'zdict.h'),
70
- ]),
71
- headers=subdir_glob([
72
- ('dictBuilder', 'divsufsort.h'),
73
- ('dictBuilder', 'cover.h'),
74
- ]),
75
- srcs=glob(['dictBuilder/*.c']),
76
- deps=[':common'],
77
- )
78
-
79
- cxx_library(
80
- name='compiler',
81
- header_namespace='',
82
- visibility=['PUBLIC'],
83
- exported_headers=subdir_glob([
84
- ('common', 'compiler.h'),
85
- ]),
86
- )
87
-
88
- cxx_library(
89
- name='cpu',
90
- header_namespace='',
91
- visibility=['PUBLIC'],
92
- exported_headers=subdir_glob([
93
- ('common', 'cpu.h'),
94
- ]),
95
- )
96
-
97
- cxx_library(
98
- name='bitstream',
99
- header_namespace='',
100
- visibility=['PUBLIC'],
101
- exported_headers=subdir_glob([
102
- ('common', 'bitstream.h'),
103
- ]),
104
- )
105
-
106
- cxx_library(
107
- name='entropy',
108
- header_namespace='',
109
- visibility=['PUBLIC'],
110
- exported_headers=subdir_glob([
111
- ('common', 'fse.h'),
112
- ('common', 'huf.h'),
113
- ]),
114
- srcs=[
115
- 'common/entropy_common.c',
116
- 'common/fse_decompress.c',
117
- 'compress/fse_compress.c',
118
- 'compress/huf_compress.c',
119
- 'decompress/huf_decompress.c',
120
- ],
121
- deps=[
122
- ':debug',
123
- ':bitstream',
124
- ':compiler',
125
- ':errors',
126
- ':mem',
127
- ],
128
- )
129
-
130
- cxx_library(
131
- name='errors',
132
- header_namespace='',
133
- visibility=['PUBLIC'],
134
- exported_headers=subdir_glob([
135
- ('common', 'error_private.h'),
136
- ('common', 'zstd_errors.h'),
137
- ]),
138
- srcs=['common/error_private.c'],
139
- )
140
-
141
- cxx_library(
142
- name='mem',
143
- header_namespace='',
144
- visibility=['PUBLIC'],
145
- exported_headers=subdir_glob([
146
- ('common', 'mem.h'),
147
- ]),
148
- )
149
-
150
- cxx_library(
151
- name='pool',
152
- header_namespace='',
153
- visibility=['PUBLIC'],
154
- exported_headers=subdir_glob([
155
- ('common', 'pool.h'),
156
- ]),
157
- srcs=['common/pool.c'],
158
- deps=[
159
- ':threading',
160
- ':zstd_common',
161
- ],
162
- )
163
-
164
- cxx_library(
165
- name='threading',
166
- header_namespace='',
167
- visibility=['PUBLIC'],
168
- exported_headers=subdir_glob([
169
- ('common', 'threading.h'),
170
- ]),
171
- srcs=['common/threading.c'],
172
- exported_preprocessor_flags=[
173
- '-DZSTD_MULTITHREAD',
174
- ],
175
- exported_linker_flags=[
176
- '-pthread',
177
- ],
178
- )
179
-
180
- cxx_library(
181
- name='xxhash',
182
- header_namespace='',
183
- visibility=['PUBLIC'],
184
- exported_headers=subdir_glob([
185
- ('common', 'xxhash.h'),
186
- ]),
187
- srcs=['common/xxhash.c'],
188
- exported_preprocessor_flags=[
189
- '-DXXH_NAMESPACE=ZSTD_',
190
- ],
191
- )
192
-
193
- cxx_library(
194
- name='zstd_common',
195
- header_namespace='',
196
- visibility=['PUBLIC'],
197
- exported_headers=subdir_glob([
198
- ('', 'zstd.h'),
199
- ('common', 'zstd_internal.h'),
200
- ]),
201
- srcs=['common/zstd_common.c'],
202
- deps=[
203
- ':compiler',
204
- ':errors',
205
- ':mem',
206
- ],
207
- )
208
-
209
- cxx_library(
210
- name='debug',
211
- header_namespace='',
212
- visibility=['PUBLIC'],
213
- exported_headers=subdir_glob([
214
- ('common', 'debug.h'),
215
- ]),
216
- srcs=['common/debug.c'],
217
- )
218
-
219
- cxx_library(
220
- name='common',
221
- deps=[
222
- ':debug',
223
- ':bitstream',
224
- ':compiler',
225
- ':cpu',
226
- ':entropy',
227
- ':errors',
228
- ':mem',
229
- ':pool',
230
- ':threading',
231
- ':xxhash',
232
- ':zstd_common',
233
- ]
234
- )
@@ -1,289 +0,0 @@
1
- # ################################################################
2
- # Copyright (c) 2015-present, Yann Collet, Facebook, Inc.
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
- # Version numbers
11
- LIBVER_MAJOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./zstd.h`
12
- LIBVER_MINOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./zstd.h`
13
- LIBVER_PATCH_SCRIPT:=`sed -n '/define ZSTD_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./zstd.h`
14
- LIBVER_SCRIPT:= $(LIBVER_MAJOR_SCRIPT).$(LIBVER_MINOR_SCRIPT).$(LIBVER_PATCH_SCRIPT)
15
- LIBVER_MAJOR := $(shell echo $(LIBVER_MAJOR_SCRIPT))
16
- LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT))
17
- LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT))
18
- LIBVER := $(shell echo $(LIBVER_SCRIPT))
19
- VERSION?= $(LIBVER)
20
- CCVER := $(shell $(CC) --version)
21
-
22
- CPPFLAGS+= -I. -I./common -DXXH_NAMESPACE=ZSTD_
23
- ifeq ($(OS),Windows_NT) # MinGW assumed
24
- CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting
25
- endif
26
- CFLAGS ?= -O3
27
- DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
28
- -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
29
- -Wstrict-prototypes -Wundef -Wpointer-arith \
30
- -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
31
- -Wredundant-decls -Wmissing-prototypes -Wc++-compat
32
- CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
33
- FLAGS = $(CPPFLAGS) $(CFLAGS)
34
-
35
- HAVE_COLORNEVER = $(shell echo a | grep --color=never a > /dev/null 2> /dev/null && echo 1 || echo 0)
36
- GREP_OPTIONS ?=
37
- ifeq ($HAVE_COLORNEVER, 1)
38
- GREP_OPTIONS += --color=never
39
- endif
40
- GREP = grep $(GREP_OPTIONS)
41
-
42
- ZSTDCOMMON_FILES := $(sort $(wildcard common/*.c))
43
- ZSTDCOMP_FILES := $(sort $(wildcard compress/*.c))
44
- ZSTDDECOMP_FILES := $(sort $(wildcard decompress/*.c))
45
- ZDICT_FILES := $(sort $(wildcard dictBuilder/*.c))
46
- ZDEPR_FILES := $(sort $(wildcard deprecated/*.c))
47
- ZSTD_FILES := $(ZSTDCOMMON_FILES)
48
-
49
- ifeq ($(findstring GCC,$(CCVER)),GCC)
50
- decompress/zstd_decompress_block.o : CFLAGS+=-fno-tree-vectorize
51
- endif
52
-
53
- ZSTD_LEGACY_SUPPORT ?= 5
54
- ZSTD_LIB_COMPRESSION ?= 1
55
- ZSTD_LIB_DECOMPRESSION ?= 1
56
- ZSTD_LIB_DICTBUILDER ?= 1
57
- ZSTD_LIB_DEPRECATED ?= 1
58
- HUF_FORCE_DECOMPRESS_X1 ?= 0
59
- HUF_FORCE_DECOMPRESS_X2 ?= 0
60
- ZSTD_FORCE_DECOMPRESS_SHORT ?= 0
61
- ZSTD_FORCE_DECOMPRESS_LONG ?= 0
62
- ZSTD_NO_INLINE ?= 0
63
- ZSTD_STRIP_ERROR_STRINGS ?= 0
64
- ZSTD_LEGACY_MULTITHREADED_API ?= 0
65
-
66
- ifeq ($(ZSTD_LIB_COMPRESSION), 0)
67
- ZSTD_LIB_DICTBUILDER = 0
68
- ZSTD_LIB_DEPRECATED = 0
69
- endif
70
-
71
- ifeq ($(ZSTD_LIB_DECOMPRESSION), 0)
72
- ZSTD_LEGACY_SUPPORT = 0
73
- ZSTD_LIB_DEPRECATED = 0
74
- endif
75
-
76
- ifneq ($(ZSTD_LIB_COMPRESSION), 0)
77
- ZSTD_FILES += $(ZSTDCOMP_FILES)
78
- endif
79
-
80
- ifneq ($(ZSTD_LIB_DECOMPRESSION), 0)
81
- ZSTD_FILES += $(ZSTDDECOMP_FILES)
82
- endif
83
-
84
- ifneq ($(ZSTD_LIB_DEPRECATED), 0)
85
- ZSTD_FILES += $(ZDEPR_FILES)
86
- endif
87
-
88
- ifneq ($(ZSTD_LIB_DICTBUILDER), 0)
89
- ZSTD_FILES += $(ZDICT_FILES)
90
- endif
91
-
92
- ifneq ($(HUF_FORCE_DECOMPRESS_X1), 0)
93
- CFLAGS += -DHUF_FORCE_DECOMPRESS_X1
94
- endif
95
-
96
- ifneq ($(HUF_FORCE_DECOMPRESS_X2), 0)
97
- CFLAGS += -DHUF_FORCE_DECOMPRESS_X2
98
- endif
99
-
100
- ifneq ($(ZSTD_FORCE_DECOMPRESS_SHORT), 0)
101
- CFLAGS += -DZSTD_FORCE_DECOMPRESS_SHORT
102
- endif
103
-
104
- ifneq ($(ZSTD_FORCE_DECOMPRESS_LONG), 0)
105
- CFLAGS += -DZSTD_FORCE_DECOMPRESS_LONG
106
- endif
107
-
108
- ifneq ($(ZSTD_NO_INLINE), 0)
109
- CFLAGS += -DZSTD_NO_INLINE
110
- endif
111
-
112
- ifneq ($(ZSTD_STRIP_ERROR_STRINGS), 0)
113
- CFLAGS += -DZSTD_STRIP_ERROR_STRINGS
114
- endif
115
-
116
- ifneq ($(ZSTD_LEGACY_MULTITHREADED_API), 0)
117
- CFLAGS += -DZSTD_LEGACY_MULTITHREADED_API
118
- endif
119
-
120
- ifneq ($(ZSTD_LEGACY_SUPPORT), 0)
121
- ifeq ($(shell test $(ZSTD_LEGACY_SUPPORT) -lt 8; echo $$?), 0)
122
- ZSTD_FILES += $(shell ls legacy/*.c | $(GREP) 'v0[$(ZSTD_LEGACY_SUPPORT)-7]')
123
- endif
124
- CPPFLAGS += -I./legacy
125
- endif
126
- CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT)
127
-
128
- ZSTD_OBJ := $(patsubst %.c,%.o,$(ZSTD_FILES))
129
-
130
- # macOS linker doesn't support -soname, and use different extension
131
- # see : https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html
132
- ifeq ($(shell uname), Darwin)
133
- SHARED_EXT = dylib
134
- SHARED_EXT_MAJOR = $(LIBVER_MAJOR).$(SHARED_EXT)
135
- SHARED_EXT_VER = $(LIBVER).$(SHARED_EXT)
136
- SONAME_FLAGS = -install_name $(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR) -compatibility_version $(LIBVER_MAJOR) -current_version $(LIBVER)
137
- else
138
- SONAME_FLAGS = -Wl,-soname=libzstd.$(SHARED_EXT).$(LIBVER_MAJOR)
139
- SHARED_EXT = so
140
- SHARED_EXT_MAJOR = $(SHARED_EXT).$(LIBVER_MAJOR)
141
- SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER)
142
- endif
143
-
144
-
145
- .PHONY: default all clean install uninstall
146
-
147
- default: lib-release
148
-
149
- all: lib
150
-
151
- libzstd.a: ARFLAGS = rcs
152
- libzstd.a: $(ZSTD_OBJ)
153
- @echo compiling static library
154
- @$(AR) $(ARFLAGS) $@ $^
155
-
156
- libzstd.a-mt: CPPFLAGS += -DZSTD_MULTITHREAD
157
- libzstd.a-mt: libzstd.a
158
-
159
- ifneq (,$(filter Windows%,$(OS)))
160
-
161
- LIBZSTD = dll\libzstd.dll
162
- $(LIBZSTD): $(ZSTD_FILES)
163
- @echo compiling dynamic library $(LIBVER)
164
- $(CC) $(FLAGS) -DZSTD_DLL_EXPORT=1 -Wl,--out-implib,dll\libzstd.lib -shared $^ -o $@
165
-
166
- else
167
-
168
- LIBZSTD = libzstd.$(SHARED_EXT_VER)
169
- $(LIBZSTD): LDFLAGS += -shared -fPIC -fvisibility=hidden
170
- $(LIBZSTD): $(ZSTD_FILES)
171
- @echo compiling dynamic library $(LIBVER)
172
- @$(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS) -o $@
173
- @echo creating versioned links
174
- @ln -sf $@ libzstd.$(SHARED_EXT_MAJOR)
175
- @ln -sf $@ libzstd.$(SHARED_EXT)
176
-
177
- endif
178
-
179
-
180
- libzstd : $(LIBZSTD)
181
-
182
- libzstd-mt : CPPFLAGS += -DZSTD_MULTITHREAD
183
- libzstd-mt : libzstd
184
-
185
- lib: libzstd.a libzstd
186
-
187
- lib-mt: CPPFLAGS += -DZSTD_MULTITHREAD
188
- lib-mt: lib
189
-
190
- lib-release lib-release-mt: DEBUGFLAGS :=
191
- lib-release: lib
192
- lib-release-mt: lib-mt
193
-
194
- # Special case : building library in single-thread mode _and_ without zstdmt_compress.c
195
- ZSTDMT_FILES = compress/zstdmt_compress.c
196
- ZSTD_NOMT_FILES = $(filter-out $(ZSTDMT_FILES),$(ZSTD_FILES))
197
- libzstd-nomt: LDFLAGS += -shared -fPIC -fvisibility=hidden
198
- libzstd-nomt: $(ZSTD_NOMT_FILES)
199
- @echo compiling single-thread dynamic library $(LIBVER)
200
- @echo files : $(ZSTD_NOMT_FILES)
201
- @$(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS) -o $@
202
-
203
- clean:
204
- @$(RM) -r *.dSYM # macOS-specific
205
- @$(RM) core *.o *.a *.gcda *.$(SHARED_EXT) *.$(SHARED_EXT).* libzstd.pc
206
- @$(RM) dll/libzstd.dll dll/libzstd.lib libzstd-nomt*
207
- @$(RM) common/*.o compress/*.o decompress/*.o dictBuilder/*.o legacy/*.o deprecated/*.o
208
- @echo Cleaning library completed
209
-
210
- #-----------------------------------------------------------------------------
211
- # make install is validated only for Linux, macOS, BSD, Hurd and Solaris targets
212
- #-----------------------------------------------------------------------------
213
- ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku))
214
-
215
- DESTDIR ?=
216
- # directory variables : GNU conventions prefer lowercase
217
- # see https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html
218
- # support both lower and uppercase (BSD), use uppercase in script
219
- prefix ?= /usr/local
220
- PREFIX ?= $(prefix)
221
- exec_prefix ?= $(PREFIX)
222
- libdir ?= $(exec_prefix)/lib
223
- LIBDIR ?= $(libdir)
224
- includedir ?= $(PREFIX)/include
225
- INCLUDEDIR ?= $(includedir)
226
-
227
- ifneq (,$(filter $(shell uname),FreeBSD NetBSD DragonFly))
228
- PKGCONFIGDIR ?= $(PREFIX)/libdata/pkgconfig
229
- else
230
- PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig
231
- endif
232
-
233
- ifneq (,$(filter $(shell uname),SunOS))
234
- INSTALL ?= ginstall
235
- else
236
- INSTALL ?= install
237
- endif
238
-
239
- INSTALL_PROGRAM ?= $(INSTALL)
240
- INSTALL_DATA ?= $(INSTALL) -m 644
241
-
242
-
243
- libzstd.pc:
244
- libzstd.pc: libzstd.pc.in
245
- @echo creating pkgconfig
246
- @sed -e 's|@PREFIX@|$(PREFIX)|' \
247
- -e 's|@VERSION@|$(VERSION)|' \
248
- $< >$@
249
-
250
- install: install-pc install-static install-shared install-includes
251
- @echo zstd static and shared library installed
252
-
253
- install-pc: libzstd.pc
254
- @$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/
255
- @$(INSTALL_DATA) libzstd.pc $(DESTDIR)$(PKGCONFIGDIR)/
256
-
257
- install-static: libzstd.a
258
- @echo Installing static library
259
- @$(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/
260
- @$(INSTALL_DATA) libzstd.a $(DESTDIR)$(LIBDIR)
261
-
262
- install-shared: libzstd
263
- @echo Installing shared library
264
- @$(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/
265
- @$(INSTALL_PROGRAM) $(LIBZSTD) $(DESTDIR)$(LIBDIR)
266
- @ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR)
267
- @ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT)
268
-
269
- install-includes:
270
- @echo Installing includes
271
- @$(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR)/
272
- @$(INSTALL_DATA) zstd.h $(DESTDIR)$(INCLUDEDIR)
273
- @$(INSTALL_DATA) common/zstd_errors.h $(DESTDIR)$(INCLUDEDIR)
274
- @$(INSTALL_DATA) deprecated/zbuff.h $(DESTDIR)$(INCLUDEDIR) # prototypes generate deprecation warnings
275
- @$(INSTALL_DATA) dictBuilder/zdict.h $(DESTDIR)$(INCLUDEDIR)
276
-
277
- uninstall:
278
- @$(RM) $(DESTDIR)$(LIBDIR)/libzstd.a
279
- @$(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT)
280
- @$(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR)
281
- @$(RM) $(DESTDIR)$(LIBDIR)/$(LIBZSTD)
282
- @$(RM) $(DESTDIR)$(PKGCONFIGDIR)/libzstd.pc
283
- @$(RM) $(DESTDIR)$(INCLUDEDIR)/zstd.h
284
- @$(RM) $(DESTDIR)$(INCLUDEDIR)/zstd_errors.h
285
- @$(RM) $(DESTDIR)$(INCLUDEDIR)/zbuff.h # Deprecated streaming functions
286
- @$(RM) $(DESTDIR)$(INCLUDEDIR)/zdict.h
287
- @echo zstd libraries successfully uninstalled
288
-
289
- endif