1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
|
project(
'7-zip',
[
'c',
'cpp',
],
version: '22.00',
default_options: [
'warning_level=2',
'werror=true',
],
license: 'LGPL',
)
uasm = find_program('uasm', required: true)
uasm_src = [
'Asm/x86/7zCrcOpt.asm',
'Asm/x86/AesOpt.asm',
'Asm/x86/LzFindOpt.asm',
'Asm/x86/LzmaDecOpt.asm',
'Asm/x86/Sha1Opt.asm',
'Asm/x86/Sha256Opt.asm',
'Asm/x86/XzCrc64Opt.asm',
]
uasm_gen = generator(uasm,
output: '@BASENAME@.o',
arguments: [
'-q',
'-elf64',
'-DABI_LINUX',
'-Fo@OUTPUT@',
'@INPUT@'
],
)
uasm_files = uasm_gen.process(uasm_src)
c_files = [
'C/7zBuf2.c',
'C/7zCrc.c',
'C/7zStream.c',
'C/Aes.c',
'C/Alloc.c',
'C/Bcj2.c',
'C/Bcj2Enc.c',
'C/Blake2s.c',
'C/Bra.c',
'C/Bra86.c',
'C/BraIA64.c',
'C/BwtSort.c',
'C/CpuArch.c',
'C/Delta.c',
'C/HuffEnc.c',
'C/LzFind.c',
'C/LzFindMt.c',
'C/Lzma2Dec.c',
'C/Lzma2DecMt.c',
'C/Lzma2Enc.c',
'C/LzmaDec.c',
'C/LzmaEnc.c',
'C/MtCoder.c',
'C/MtDec.c',
'C/Ppmd7.c',
'C/Ppmd7Dec.c',
'C/Ppmd7Enc.c',
'C/Ppmd7aDec.c',
'C/Ppmd8.c',
'C/Ppmd8Dec.c',
'C/Ppmd8Enc.c',
'C/Sha1.c',
'C/Sha256.c',
'C/Sort.c',
'C/Threads.c',
'C/Xz.c',
'C/XzCrc64.c',
'C/XzDec.c',
'C/XzEnc.c',
'C/XzIn.c',
]
cpp_files = [
'CPP/7zip/Archive/7z/7zCompressionMode.cpp',
'CPP/7zip/Archive/7z/7zDecode.cpp',
'CPP/7zip/Archive/7z/7zEncode.cpp',
'CPP/7zip/Archive/7z/7zExtract.cpp',
'CPP/7zip/Archive/7z/7zFolderInStream.cpp',
'CPP/7zip/Archive/7z/7zHandler.cpp',
'CPP/7zip/Archive/7z/7zHandlerOut.cpp',
'CPP/7zip/Archive/7z/7zHeader.cpp',
'CPP/7zip/Archive/7z/7zIn.cpp',
'CPP/7zip/Archive/7z/7zOut.cpp',
'CPP/7zip/Archive/7z/7zProperties.cpp',
'CPP/7zip/Archive/7z/7zRegister.cpp',
'CPP/7zip/Archive/7z/7zSpecStream.cpp',
'CPP/7zip/Archive/7z/7zUpdate.cpp',
'CPP/7zip/Archive/ApfsHandler.cpp',
'CPP/7zip/Archive/ApmHandler.cpp',
'CPP/7zip/Archive/ArHandler.cpp',
'CPP/7zip/Archive/ArjHandler.cpp',
'CPP/7zip/Archive/Base64Handler.cpp',
'CPP/7zip/Archive/Bz2Handler.cpp',
'CPP/7zip/Archive/Cab/CabBlockInStream.cpp',
'CPP/7zip/Archive/Cab/CabHandler.cpp',
'CPP/7zip/Archive/Cab/CabHeader.cpp',
'CPP/7zip/Archive/Cab/CabIn.cpp',
'CPP/7zip/Archive/Cab/CabRegister.cpp',
'CPP/7zip/Archive/Chm/ChmHandler.cpp',
'CPP/7zip/Archive/Chm/ChmIn.cpp',
'CPP/7zip/Archive/ComHandler.cpp',
'CPP/7zip/Archive/Common/CoderMixer2.cpp',
'CPP/7zip/Archive/Common/DummyOutStream.cpp',
'CPP/7zip/Archive/Common/FindSignature.cpp',
'CPP/7zip/Archive/Common/HandlerOut.cpp',
'CPP/7zip/Archive/Common/InStreamWithCRC.cpp',
'CPP/7zip/Archive/Common/ItemNameUtils.cpp',
'CPP/7zip/Archive/Common/MultiStream.cpp',
'CPP/7zip/Archive/Common/OutStreamWithCRC.cpp',
'CPP/7zip/Archive/Common/OutStreamWithSha1.cpp',
'CPP/7zip/Archive/Common/ParseProperties.cpp',
'CPP/7zip/Archive/CpioHandler.cpp',
'CPP/7zip/Archive/CramfsHandler.cpp',
'CPP/7zip/Archive/DeflateProps.cpp',
'CPP/7zip/Archive/DmgHandler.cpp',
'CPP/7zip/Archive/ElfHandler.cpp',
'CPP/7zip/Archive/ExtHandler.cpp',
'CPP/7zip/Archive/FatHandler.cpp',
'CPP/7zip/Archive/FlvHandler.cpp',
'CPP/7zip/Archive/GptHandler.cpp',
'CPP/7zip/Archive/GzHandler.cpp',
'CPP/7zip/Archive/HandlerCont.cpp',
'CPP/7zip/Archive/HfsHandler.cpp',
'CPP/7zip/Archive/IhexHandler.cpp',
'CPP/7zip/Archive/Iso/IsoHandler.cpp',
'CPP/7zip/Archive/Iso/IsoHeader.cpp',
'CPP/7zip/Archive/Iso/IsoIn.cpp',
'CPP/7zip/Archive/Iso/IsoRegister.cpp',
'CPP/7zip/Archive/LpHandler.cpp',
'CPP/7zip/Archive/LzhHandler.cpp',
'CPP/7zip/Archive/LzmaHandler.cpp',
'CPP/7zip/Archive/MachoHandler.cpp',
'CPP/7zip/Archive/MbrHandler.cpp',
'CPP/7zip/Archive/MslzHandler.cpp',
'CPP/7zip/Archive/MubHandler.cpp',
'CPP/7zip/Archive/Nsis/NsisDecode.cpp',
'CPP/7zip/Archive/Nsis/NsisHandler.cpp',
'CPP/7zip/Archive/Nsis/NsisIn.cpp',
'CPP/7zip/Archive/Nsis/NsisRegister.cpp',
'CPP/7zip/Archive/NtfsHandler.cpp',
'CPP/7zip/Archive/PeHandler.cpp',
'CPP/7zip/Archive/PpmdHandler.cpp',
'CPP/7zip/Archive/QcowHandler.cpp',
'CPP/7zip/Archive/Rar/Rar5Handler.cpp',
'CPP/7zip/Archive/Rar/RarHandler.cpp',
'CPP/7zip/Archive/RpmHandler.cpp',
'CPP/7zip/Archive/SparseHandler.cpp',
'CPP/7zip/Archive/SplitHandler.cpp',
'CPP/7zip/Archive/SquashfsHandler.cpp',
'CPP/7zip/Archive/SwfHandler.cpp',
'CPP/7zip/Archive/Tar/TarHandler.cpp',
'CPP/7zip/Archive/Tar/TarHandlerOut.cpp',
'CPP/7zip/Archive/Tar/TarHeader.cpp',
'CPP/7zip/Archive/Tar/TarIn.cpp',
'CPP/7zip/Archive/Tar/TarOut.cpp',
'CPP/7zip/Archive/Tar/TarRegister.cpp',
'CPP/7zip/Archive/Tar/TarUpdate.cpp',
'CPP/7zip/Archive/Udf/UdfHandler.cpp',
'CPP/7zip/Archive/Udf/UdfIn.cpp',
'CPP/7zip/Archive/UefiHandler.cpp',
'CPP/7zip/Archive/VdiHandler.cpp',
'CPP/7zip/Archive/VhdHandler.cpp',
'CPP/7zip/Archive/VhdxHandler.cpp',
'CPP/7zip/Archive/VmdkHandler.cpp',
'CPP/7zip/Archive/Wim/WimHandler.cpp',
'CPP/7zip/Archive/Wim/WimHandlerOut.cpp',
'CPP/7zip/Archive/Wim/WimIn.cpp',
'CPP/7zip/Archive/Wim/WimRegister.cpp',
'CPP/7zip/Archive/XarHandler.cpp',
'CPP/7zip/Archive/XzHandler.cpp',
'CPP/7zip/Archive/ZHandler.cpp',
'CPP/7zip/Archive/Zip/ZipAddCommon.cpp',
'CPP/7zip/Archive/Zip/ZipHandler.cpp',
'CPP/7zip/Archive/Zip/ZipHandlerOut.cpp',
'CPP/7zip/Archive/Zip/ZipIn.cpp',
'CPP/7zip/Archive/Zip/ZipItem.cpp',
'CPP/7zip/Archive/Zip/ZipOut.cpp',
'CPP/7zip/Archive/Zip/ZipRegister.cpp',
'CPP/7zip/Archive/Zip/ZipUpdate.cpp',
'CPP/7zip/Common/CWrappers.cpp',
'CPP/7zip/Common/CreateCoder.cpp',
'CPP/7zip/Common/FilePathAutoRename.cpp',
'CPP/7zip/Common/FileStreams.cpp',
'CPP/7zip/Common/FilterCoder.cpp',
'CPP/7zip/Common/InBuffer.cpp',
'CPP/7zip/Common/InOutTempBuffer.cpp',
'CPP/7zip/Common/LimitedStreams.cpp',
'CPP/7zip/Common/LockedStream.cpp',
'CPP/7zip/Common/MemBlocks.cpp',
'CPP/7zip/Common/MethodId.cpp',
'CPP/7zip/Common/MethodProps.cpp',
'CPP/7zip/Common/OffsetStream.cpp',
'CPP/7zip/Common/OutBuffer.cpp',
'CPP/7zip/Common/OutMemStream.cpp',
'CPP/7zip/Common/ProgressMt.cpp',
'CPP/7zip/Common/ProgressUtils.cpp',
'CPP/7zip/Common/PropId.cpp',
'CPP/7zip/Common/StreamBinder.cpp',
'CPP/7zip/Common/StreamObjects.cpp',
'CPP/7zip/Common/StreamUtils.cpp',
'CPP/7zip/Common/UniqBlocks.cpp',
'CPP/7zip/Common/VirtThread.cpp',
'CPP/7zip/Compress/BZip2Crc.cpp',
'CPP/7zip/Compress/BZip2Decoder.cpp',
'CPP/7zip/Compress/BZip2Encoder.cpp',
'CPP/7zip/Compress/BZip2Register.cpp',
'CPP/7zip/Compress/Bcj2Coder.cpp',
'CPP/7zip/Compress/Bcj2Register.cpp',
'CPP/7zip/Compress/BcjCoder.cpp',
'CPP/7zip/Compress/BcjRegister.cpp',
'CPP/7zip/Compress/BitlDecoder.cpp',
'CPP/7zip/Compress/BranchMisc.cpp',
'CPP/7zip/Compress/BranchRegister.cpp',
'CPP/7zip/Compress/ByteSwap.cpp',
'CPP/7zip/Compress/CopyCoder.cpp',
'CPP/7zip/Compress/CopyRegister.cpp',
'CPP/7zip/Compress/Deflate64Register.cpp',
'CPP/7zip/Compress/DeflateDecoder.cpp',
'CPP/7zip/Compress/DeflateEncoder.cpp',
'CPP/7zip/Compress/DeflateRegister.cpp',
'CPP/7zip/Compress/DeltaFilter.cpp',
'CPP/7zip/Compress/ImplodeDecoder.cpp',
'CPP/7zip/Compress/LzOutWindow.cpp',
'CPP/7zip/Compress/LzfseDecoder.cpp',
'CPP/7zip/Compress/LzhDecoder.cpp',
'CPP/7zip/Compress/Lzma2Decoder.cpp',
'CPP/7zip/Compress/Lzma2Encoder.cpp',
'CPP/7zip/Compress/Lzma2Register.cpp',
'CPP/7zip/Compress/LzmaDecoder.cpp',
'CPP/7zip/Compress/LzmaEncoder.cpp',
'CPP/7zip/Compress/LzmaRegister.cpp',
'CPP/7zip/Compress/LzmsDecoder.cpp',
'CPP/7zip/Compress/LzxDecoder.cpp',
'CPP/7zip/Compress/PpmdDecoder.cpp',
'CPP/7zip/Compress/PpmdEncoder.cpp',
'CPP/7zip/Compress/PpmdRegister.cpp',
'CPP/7zip/Compress/PpmdZip.cpp',
'CPP/7zip/Compress/QuantumDecoder.cpp',
'CPP/7zip/Compress/Rar1Decoder.cpp',
'CPP/7zip/Compress/Rar2Decoder.cpp',
'CPP/7zip/Compress/Rar3Decoder.cpp',
'CPP/7zip/Compress/Rar3Vm.cpp',
'CPP/7zip/Compress/Rar5Decoder.cpp',
'CPP/7zip/Compress/RarCodecsRegister.cpp',
'CPP/7zip/Compress/ShrinkDecoder.cpp',
'CPP/7zip/Compress/XpressDecoder.cpp',
'CPP/7zip/Compress/XzDecoder.cpp',
'CPP/7zip/Compress/XzEncoder.cpp',
'CPP/7zip/Compress/ZDecoder.cpp',
'CPP/7zip/Compress/ZlibDecoder.cpp',
'CPP/7zip/Compress/ZlibEncoder.cpp',
'CPP/7zip/Crypto/7zAes.cpp',
'CPP/7zip/Crypto/7zAesRegister.cpp',
'CPP/7zip/Crypto/HmacSha1.cpp',
'CPP/7zip/Crypto/HmacSha256.cpp',
'CPP/7zip/Crypto/MyAes.cpp',
'CPP/7zip/Crypto/MyAesReg.cpp',
'CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp',
'CPP/7zip/Crypto/RandGen.cpp',
'CPP/7zip/Crypto/Rar20Crypto.cpp',
'CPP/7zip/Crypto/Rar5Aes.cpp',
'CPP/7zip/Crypto/RarAes.cpp',
'CPP/7zip/Crypto/WzAes.cpp',
'CPP/7zip/Crypto/ZipCrypto.cpp',
'CPP/7zip/Crypto/ZipStrong.cpp',
'CPP/7zip/UI/Common/ArchiveCommandLine.cpp',
'CPP/7zip/UI/Common/ArchiveExtractCallback.cpp',
'CPP/7zip/UI/Common/ArchiveOpenCallback.cpp',
'CPP/7zip/UI/Common/Bench.cpp',
'CPP/7zip/UI/Common/DefaultName.cpp',
'CPP/7zip/UI/Common/EnumDirItems.cpp',
'CPP/7zip/UI/Common/Extract.cpp',
'CPP/7zip/UI/Common/ExtractingFilePath.cpp',
'CPP/7zip/UI/Common/HashCalc.cpp',
'CPP/7zip/UI/Common/LoadCodecs.cpp',
'CPP/7zip/UI/Common/OpenArchive.cpp',
'CPP/7zip/UI/Common/PropIDUtils.cpp',
'CPP/7zip/UI/Common/SetProperties.cpp',
'CPP/7zip/UI/Common/SortUtils.cpp',
'CPP/7zip/UI/Common/TempFiles.cpp',
'CPP/7zip/UI/Common/Update.cpp',
'CPP/7zip/UI/Common/UpdateAction.cpp',
'CPP/7zip/UI/Common/UpdateCallback.cpp',
'CPP/7zip/UI/Common/UpdatePair.cpp',
'CPP/7zip/UI/Common/UpdateProduce.cpp',
'CPP/7zip/UI/Console/BenchCon.cpp',
'CPP/7zip/UI/Console/ConsoleClose.cpp',
'CPP/7zip/UI/Console/ExtractCallbackConsole.cpp',
'CPP/7zip/UI/Console/HashCon.cpp',
'CPP/7zip/UI/Console/List.cpp',
'CPP/7zip/UI/Console/Main.cpp',
'CPP/7zip/UI/Console/MainAr.cpp',
'CPP/7zip/UI/Console/OpenCallbackConsole.cpp',
'CPP/7zip/UI/Console/PercentPrinter.cpp',
'CPP/7zip/UI/Console/UpdateCallbackConsole.cpp',
'CPP/7zip/UI/Console/UserInputUtils.cpp',
'CPP/Common/CRC.cpp',
'CPP/Common/CommandLineParser.cpp',
'CPP/Common/CrcReg.cpp',
'CPP/Common/DynLimBuf.cpp',
'CPP/Common/IntToString.cpp',
'CPP/Common/ListFileUtils.cpp',
'CPP/Common/LzFindPrepare.cpp',
'CPP/Common/MyMap.cpp',
'CPP/Common/MyString.cpp',
'CPP/Common/MyVector.cpp',
'CPP/Common/MyWindows.cpp',
'CPP/Common/MyXml.cpp',
'CPP/Common/NewHandler.cpp',
'CPP/Common/Sha1Prepare.cpp',
'CPP/Common/Sha1Reg.cpp',
'CPP/Common/Sha256Prepare.cpp',
'CPP/Common/Sha256Reg.cpp',
'CPP/Common/StdInStream.cpp',
'CPP/Common/StdOutStream.cpp',
'CPP/Common/StringConvert.cpp',
'CPP/Common/StringToInt.cpp',
'CPP/Common/UTFConvert.cpp',
'CPP/Common/Wildcard.cpp',
'CPP/Common/XzCrc64Init.cpp',
'CPP/Common/XzCrc64Reg.cpp',
'CPP/Windows/ErrorMsg.cpp',
'CPP/Windows/FileDir.cpp',
'CPP/Windows/FileFind.cpp',
'CPP/Windows/FileIO.cpp',
'CPP/Windows/FileLink.cpp',
'CPP/Windows/FileName.cpp',
'CPP/Windows/PropVariant.cpp',
'CPP/Windows/PropVariantConv.cpp',
'CPP/Windows/PropVariantUtils.cpp',
'CPP/Windows/Synchronization.cpp',
'CPP/Windows/System.cpp',
'CPP/Windows/SystemInfo.cpp',
'CPP/Windows/TimeUtils.cpp',
]
cpp = meson.get_compiler('cpp')
m_dep = cpp.find_library('m', required: true)
dl_dep = cpp.find_library('dl', required: true)
project_dependencies = [
m_dep,
dl_dep,
]
add_project_arguments(
[
'-D_LZMA_DEC_OPT',
'-DPROG_VARIANT_Z',
'-D_7ZIP_ASM',
'-Waddress',
'-Waddress-of-packed-member',
'-Waggressive-loop-optimizations',
'-Wattributes',
'-Wbool-compare',
'-Wbool-operation',
'-Wcast-align',
'-Wcast-align=strict',
'-Wcomment',
'-Wconversion',
'-Wdangling-else',
'-Wdiv-by-zero',
'-Wduplicated-branches',
'-Wduplicated-cond',
'-Wformat-contains-nul',
'-Wimplicit-fallthrough=5',
'-Winit-self',
'-Wint-in-bool-context',
'-Wint-to-pointer-cast',
'-Wunused',
'-Wunused-macros',
],
language: [
'c',
'cpp',
],
)
add_project_arguments(
[
'-Wno-non-virtual-dtor',
],
language: [
'cpp',
],
)
project_target = executable('7zz',
[
uasm_files,
c_files,
cpp_files,
],
dependencies: project_dependencies,
install: true,
link_args: '-Wl,-z,noexecstack',
)
install_data(
[
'DOC/License.txt',
'DOC/unRarLicense.txt',
],
install_dir: '/usr/share/licenses/' + meson.project_name(),
)
install_data(
[
'DOC/7zC.txt',
'DOC/7zFormat.txt',
'DOC/lzma.txt',
'DOC/Methods.txt',
'DOC/readme.txt',
'DOC/src-history.txt',
],
install_dir: '/usr/share/doc/' + meson.project_name(),
)
|