OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """ | 6 """ |
7 Replaces gyp files in tree with files from here that | 7 Replaces gyp files in tree with files from here that |
8 make the build use system libraries. | 8 make the build use system libraries. |
9 """ | 9 """ |
10 | 10 |
11 | 11 |
12 import os.path | 12 import os.path |
13 import shutil | 13 import shutil |
14 import sys | 14 import sys |
15 | 15 |
16 | 16 |
17 REPLACEMENTS = { | 17 REPLACEMENTS = { |
| 18 'use_system_bzip2': 'third_party/bzip2/bzip2.gyp', |
| 19 'use_system_expat': 'third_party/expat/expat.gyp', |
18 'use_system_harfbuzz': 'third_party/harfbuzz-ng/harfbuzz.gyp', | 20 'use_system_harfbuzz': 'third_party/harfbuzz-ng/harfbuzz.gyp', |
| 21 'use_system_jsoncpp': 'third_party/jsoncpp/jsoncpp.gyp', |
| 22 'use_system_libevent': 'third_party/libevent/libevent.gyp', |
| 23 'use_system_libjpeg': 'third_party/libjpeg/libjpeg.gyp', |
| 24 'use_system_libpng': 'third_party/libpng/libpng.gyp', |
| 25 'use_system_libusb': 'third_party/libusb/libusb.gyp', |
| 26 'use_system_libwebp': 'third_party/libwebp/libwebp.gyp', |
| 27 'use_system_libxml': 'third_party/libxml/libxml.gyp', |
| 28 'use_system_libxslt': 'third_party/libxslt/libxslt.gyp', |
| 29 'use_system_opus': 'third_party/opus/opus.gyp', |
| 30 'use_system_re2': 'third_party/re2/re2.gyp', |
| 31 'use_system_sqlite': 'third_party/sqlite/sqlite.gyp', |
| 32 'use_system_zlib': 'third_party/zlib/zlib.gyp', |
19 } | 33 } |
20 | 34 |
21 | 35 |
22 def DoMain(argv): | 36 def DoMain(argv): |
23 my_dirname = os.path.dirname(__file__) | 37 my_dirname = os.path.dirname(__file__) |
24 source_tree_root = os.path.abspath( | 38 source_tree_root = os.path.abspath( |
25 os.path.join(my_dirname, '..', '..', '..')) | 39 os.path.join(my_dirname, '..', '..', '..')) |
26 | 40 |
27 for flag, path in REPLACEMENTS.items(): | 41 for flag, path in REPLACEMENTS.items(): |
28 # Accept arguments in gyp command-line syntax, and ignore other | 42 # Accept arguments in gyp command-line syntax, and ignore other |
29 # parameters, so that the caller can re-use command-line for this | 43 # parameters, so that the caller can re-use command-line for this |
30 # script and gyp. | 44 # script and gyp. |
31 if '-D%s=1' % flag not in argv: | 45 if '-D%s=1' % flag not in argv: |
32 continue | 46 continue |
33 | 47 |
34 # Copy the gyp file from directory of this script to target path. | 48 # Copy the gyp file from directory of this script to target path. |
35 shutil.copyfile(os.path.join(my_dirname, os.path.basename(path)), | 49 shutil.copyfile(os.path.join(my_dirname, os.path.basename(path)), |
36 os.path.join(source_tree_root, path)) | 50 os.path.join(source_tree_root, path)) |
37 | 51 |
38 return 0 | 52 return 0 |
39 | 53 |
40 | 54 |
41 if __name__ == '__main__': | 55 if __name__ == '__main__': |
42 sys.exit(DoMain(sys.argv)) | 56 sys.exit(DoMain(sys.argv)) |
OLD | NEW |