1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
7 # Configuration. Ordinarily, all of these features are enabled, and
8 # "small" is disabled. For Chromium's purposes, enable "small" and disable
9 # nearly everything else to save about 36kB in the lzma_decompress
10 # library, which will be distributed with updates. This also translates to
11 # a 25kB savings in the compressed disk image that will contain the
20 'coder_bcj_armthumb': 0,
22 'coder_bcj_powerpc': 0,
27 'lzma_common_defines': [
30 'lzma_decompress_defines': [
32 'lzma_compress_defines': [
35 'lzma_include_dirs': [
39 'xz/src/liblzma/check',
40 'xz/src/liblzma/common',
41 'xz/src/liblzma/delta',
43 'xz/src/liblzma/lzma',
44 'xz/src/liblzma/rangecoder',
45 'xz/src/liblzma/simple',
48 'lzma_common_source_files': [
49 'xz/src/common/tuklib_physmem.c',
50 'xz/src/liblzma/check/check.c',
51 'xz/src/liblzma/common/block_util.c',
52 'xz/src/liblzma/common/common.c',
53 'xz/src/liblzma/common/easy_preset.c',
54 'xz/src/liblzma/common/filter_common.c',
55 'xz/src/liblzma/common/hardware_physmem.c',
56 'xz/src/liblzma/common/index.c',
57 'xz/src/liblzma/common/stream_flags_common.c',
58 'xz/src/liblzma/common/vli_size.c',
59 'xz/src/liblzma/lzma/lzma_encoder_presets.c',
60 'xz/src/liblzma/rangecoder/price_table.c',
62 'lzma_decompress_source_files': [
63 'xz/src/liblzma/common/alone_decoder.c',
64 'xz/src/liblzma/common/auto_decoder.c',
65 'xz/src/liblzma/common/block_buffer_decoder.c',
66 'xz/src/liblzma/common/block_decoder.c',
67 'xz/src/liblzma/common/block_header_decoder.c',
68 'xz/src/liblzma/common/easy_decoder_memusage.c',
69 'xz/src/liblzma/common/filter_buffer_decoder.c',
70 'xz/src/liblzma/common/filter_decoder.c',
71 'xz/src/liblzma/common/filter_flags_decoder.c',
72 'xz/src/liblzma/common/index_decoder.c',
73 'xz/src/liblzma/common/index_hash.c',
74 'xz/src/liblzma/common/stream_buffer_decoder.c',
75 'xz/src/liblzma/common/stream_decoder.c',
76 'xz/src/liblzma/common/stream_flags_decoder.c',
77 'xz/src/liblzma/common/vli_decoder.c',
78 'xz/src/liblzma/lz/lz_decoder.c',
79 'xz/src/liblzma/lzma/lzma_decoder.c',
81 'lzma_compress_source_files': [
82 'xz/src/liblzma/common/alone_encoder.c',
83 'xz/src/liblzma/common/block_buffer_encoder.c',
84 'xz/src/liblzma/common/block_encoder.c',
85 'xz/src/liblzma/common/block_header_encoder.c',
86 'xz/src/liblzma/common/easy_buffer_encoder.c',
87 'xz/src/liblzma/common/easy_encoder.c',
88 'xz/src/liblzma/common/easy_encoder_memusage.c',
89 'xz/src/liblzma/common/filter_buffer_encoder.c',
90 'xz/src/liblzma/common/filter_encoder.c',
91 'xz/src/liblzma/common/filter_flags_encoder.c',
92 'xz/src/liblzma/common/index_encoder.c',
93 'xz/src/liblzma/common/stream_buffer_encoder.c',
94 'xz/src/liblzma/common/stream_encoder.c',
95 'xz/src/liblzma/common/stream_flags_encoder.c',
96 'xz/src/liblzma/common/vli_encoder.c',
97 'xz/src/liblzma/lz/lz_encoder.c',
98 'xz/src/liblzma/lz/lz_encoder_mf.c',
99 'xz/src/liblzma/lzma/lzma_encoder.c',
100 'xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c',
101 'xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c',
106 'lzma_common_defines': [
109 'lzma_common_source_files': [
110 # CRC-32 must be compiled for header integrity checks, even if it is
111 # not enabled for payload integrity checks.
112 'xz/src/liblzma/check/crc32_small.c',
115 'lzma_common_source_files': [
116 # CRC-32 must be compiled for header integrity checks, even if it is
117 # not enabled for payload integrity checks.
119 # Use the "fast" implementation instead of the "x86" one for
120 # architecture independence. Both require the "table."
121 'xz/src/liblzma/check/crc32_fast.c',
122 'xz/src/liblzma/check/crc32_table.c',
123 # 'xz/src/liblzma/check/crc32_x86.S',
125 'lzma_compress_source_files': [
126 'xz/src/liblzma/lzma/fastpos_table.c',
129 ['check_crc32 != 0', {
130 'lzma_common_defines': [
131 'HAVE_CHECK_CRC32=1',
134 ['check_crc64 != 0', {
135 'lzma_common_defines': [
136 'HAVE_CHECK_CRC64=1',
140 'lzma_common_source_files': [
141 'xz/src/liblzma/check/crc64_small.c',
144 'lzma_common_source_files': [
145 # Use the "fast" implementation instead of the "x86" one for
146 # architecture independence. Both require the "table."
147 'xz/src/liblzma/check/crc64_fast.c',
148 'xz/src/liblzma/check/crc64_table.c',
149 # 'xz/src/liblzma/check/crc64_x86.S',
154 ['check_sha256 != 0', {
155 'lzma_common_defines': [
156 'HAVE_CHECK_SHA256=1',
158 'lzma_common_source_files': [
159 'xz/src/liblzma/check/sha256.c',
162 ['coder_lzma1 != 0', {
163 'lzma_decompress_defines': [
164 'HAVE_DECODER_LZMA1=1',
166 'lzma_compress_defines': [
167 'HAVE_ENCODER_LZMA1=1',
170 ['coder_lzma2 != 0', {
171 'lzma_decompress_defines': [
172 'HAVE_DECODER_LZMA2=1',
174 'lzma_compress_defines': [
175 'HAVE_ENCODER_LZMA2=1',
177 'lzma_decompress_source_files': [
178 'xz/src/liblzma/lzma/lzma2_decoder.c',
180 'lzma_compress_source_files': [
181 'xz/src/liblzma/lzma/lzma2_encoder.c',
184 ['coder_delta != 0', {
185 'lzma_decompress_defines': [
186 'HAVE_DECODER_DELTA=1',
188 'lzma_compress_defines': [
189 'HAVE_ENCODER_DELTA=1',
191 'lzma_common_source_files': [
192 'xz/src/liblzma/delta/delta_common.c',
194 'lzma_decompress_source_files': [
195 'xz/src/liblzma/delta/delta_decoder.c',
197 'lzma_compress_source_files': [
198 'xz/src/liblzma/delta/delta_encoder.c',
201 ['coder_bcj_arm != 0', {
202 'lzma_decompress_defines': [
203 'HAVE_DECODER_ARM=1',
205 'lzma_compress_defines': [
206 'HAVE_ENCODER_ARM=1',
208 'lzma_common_source_files': [
209 'xz/src/liblzma/simple/arm.c',
212 ['coder_bcj_armthumb != 0', {
213 'lzma_decompress_defines': [
214 'HAVE_DECODER_ARMTHUMB=1',
216 'lzma_compress_defines': [
217 'HAVE_ENCODER_ARMTHUMB=1',
219 'lzma_common_source_files': [
220 'xz/src/liblzma/simple/armthumb.c',
223 ['coder_bcj_ia64 != 0', {
224 'lzma_decompress_defines': [
225 'HAVE_DECODER_IA64=1',
227 'lzma_compress_defines': [
228 'HAVE_ENCODER_IA64=1',
230 'lzma_common_source_files': [
231 'xz/src/liblzma/simple/ia64.c',
234 ['coder_bcj_powerpc != 0', {
235 'lzma_decompress_defines': [
236 'HAVE_DECODER_POWERPC=1',
238 'lzma_compress_defines': [
239 'HAVE_ENCODER_POWERPC=1',
241 'lzma_common_source_files': [
242 'xz/src/liblzma/simple/powerpc.c',
245 ['coder_bcj_sparc != 0', {
246 'lzma_decompress_defines': [
247 'HAVE_DECODER_SPARC=1',
249 'lzma_compress_defines': [
250 'HAVE_ENCODER_SPARC=1',
252 'lzma_common_source_files': [
253 'xz/src/liblzma/simple/sparc.c',
256 ['coder_bcj_x86 != 0', {
257 'lzma_decompress_defines': [
258 'HAVE_DECODER_X86=1',
260 'lzma_compress_defines': [
261 'HAVE_ENCODER_X86=1',
263 'lzma_common_source_files': [
264 'xz/src/liblzma/simple/x86.c',
267 ['coder_bcj_arm != 0 or coder_bcj_armthumb != 0 or coder_bcj_ia64 != 0 or coder_bcj_powerpc != 0 or coder_bcj_sparc != 0 or coder_bcj_x86 != 0', {
268 'lzma_common_source_files': [
269 'xz/src/liblzma/simple/simple_coder.c',
271 'lzma_decompress_source_files': [
272 'xz/src/liblzma/simple/simple_decoder.c',
274 'lzma_compress_source_files': [
275 'xz/src/liblzma/simple/simple_encoder.c',
283 'target_name': 'lzma',
284 'type': 'static_library',
286 '<@(lzma_common_defines)',
287 '<@(lzma_decompress_defines)',
288 '<@(lzma_compress_defines)',
291 '<@(lzma_include_dirs)',
294 '<@(lzma_common_source_files)',
295 '<@(lzma_decompress_source_files)',
296 '<@(lzma_compress_source_files)',
298 'direct_dependent_settings': {
300 'xz/src/liblzma/api',
306 'target_name': 'lzma_decompress',
308 # Always build as a shared library to promote code sharing. This library
309 # is distributed in Google Chrome update disk images and is used by more
311 'type': 'shared_library',
314 # The library will reside in the same directory as executables linked
316 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
318 # Trim the list of exported symbols to just those needed by
319 # dependents. This limits the set of "roots" seen during dead-code
320 # stripping and reduces the size of the library.
321 'EXPORTED_SYMBOLS_FILE': 'lzma_decompress.export',
325 '<@(lzma_common_defines)',
326 '<@(lzma_decompress_defines)',
329 '<@(lzma_include_dirs)',
332 '<@(lzma_common_source_files)',
333 '<@(lzma_decompress_source_files)',
335 'direct_dependent_settings': {
337 'xz/src/liblzma/api',
343 # Use -Os to minimize the size of the installer tools.
344 'GCC_OPTIMIZATION_LEVEL': 's',
352 'type': 'executable',
357 '<@(lzma_common_defines)',
358 '<@(lzma_decompress_defines)',
359 '<@(lzma_compress_defines)',
366 'xz/src/common/tuklib_cpucores.c',
367 'xz/src/common/tuklib_exit.c',
368 'xz/src/common/tuklib_mbstr_fw.c',
369 'xz/src/common/tuklib_mbstr_width.c',
370 'xz/src/common/tuklib_open_stdxxx.c',
371 'xz/src/common/tuklib_progname.c',
374 'xz/src/xz/file_io.c',
375 'xz/src/xz/hardware.c',
378 'xz/src/xz/message.c',
379 'xz/src/xz/options.c',
380 'xz/src/xz/signals.c',
381 'xz/src/xz/suffix.c',
387 'target_name': 'xzdec',
388 'type': 'executable',
393 '<@(lzma_common_defines)',
394 '<@(lzma_decompress_defines)',
401 'xz/src/common/tuklib_exit.c',
402 'xz/src/common/tuklib_progname.c',
403 'xz/src/xzdec/xzdec.c',
408 # Use -Os to minimize the size of the installer tools.
409 'GCC_OPTIMIZATION_LEVEL': 's',