| 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 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 'use_system_libevent': 'third_party/libevent/libevent.gyp', | 24 'use_system_libevent': 'third_party/libevent/libevent.gyp', |
| 25 'use_system_libjpeg': 'third_party/libjpeg/libjpeg.gyp', | 25 'use_system_libjpeg': 'third_party/libjpeg/libjpeg.gyp', |
| 26 'use_system_libpng': 'third_party/libpng/libpng.gyp', | 26 'use_system_libpng': 'third_party/libpng/libpng.gyp', |
| 27 'use_system_libusb': 'third_party/libusb/libusb.gyp', | 27 'use_system_libusb': 'third_party/libusb/libusb.gyp', |
| 28 'use_system_libvpx': 'third_party/libvpx/libvpx.gyp', | 28 'use_system_libvpx': 'third_party/libvpx/libvpx.gyp', |
| 29 'use_system_libwebp': 'third_party/libwebp/libwebp.gyp', | 29 'use_system_libwebp': 'third_party/libwebp/libwebp.gyp', |
| 30 'use_system_libxml': 'third_party/libxml/libxml.gyp', | 30 'use_system_libxml': 'third_party/libxml/libxml.gyp', |
| 31 'use_system_libxslt': 'third_party/libxslt/libxslt.gyp', | 31 'use_system_libxslt': 'third_party/libxslt/libxslt.gyp', |
| 32 'use_system_opus': 'third_party/opus/opus.gyp', | 32 'use_system_opus': 'third_party/opus/opus.gyp', |
| 33 'use_system_re2': 'third_party/re2/re2.gyp', | 33 'use_system_re2': 'third_party/re2/re2.gyp', |
| 34 'use_system_snappy': 'third_party/snappy/snappy.gyp', |
| 34 'use_system_speex': 'third_party/speex/speex.gyp', | 35 'use_system_speex': 'third_party/speex/speex.gyp', |
| 35 'use_system_sqlite': 'third_party/sqlite/sqlite.gyp', | 36 'use_system_sqlite': 'third_party/sqlite/sqlite.gyp', |
| 36 'use_system_v8': 'v8/tools/gyp/v8.gyp', | 37 'use_system_v8': 'v8/tools/gyp/v8.gyp', |
| 37 'use_system_zlib': 'third_party/zlib/zlib.gyp', | 38 'use_system_zlib': 'third_party/zlib/zlib.gyp', |
| 38 } | 39 } |
| 39 | 40 |
| 40 | 41 |
| 41 def DoMain(argv): | 42 def DoMain(argv): |
| 42 my_dirname = os.path.dirname(__file__) | 43 my_dirname = os.path.dirname(__file__) |
| 43 source_tree_root = os.path.abspath( | 44 source_tree_root = os.path.abspath( |
| 44 os.path.join(my_dirname, '..', '..', '..')) | 45 os.path.join(my_dirname, '..', '..', '..')) |
| 45 | 46 |
| 46 for flag, path in REPLACEMENTS.items(): | 47 for flag, path in REPLACEMENTS.items(): |
| 47 # Accept arguments in gyp command-line syntax, and ignore other | 48 # Accept arguments in gyp command-line syntax, and ignore other |
| 48 # parameters, so that the caller can re-use command-line for this | 49 # parameters, so that the caller can re-use command-line for this |
| 49 # script and gyp. | 50 # script and gyp. |
| 50 if '-D%s=1' % flag not in argv: | 51 if '-D%s=1' % flag not in argv: |
| 51 continue | 52 continue |
| 52 | 53 |
| 53 # Copy the gyp file from directory of this script to target path. | 54 # Copy the gyp file from directory of this script to target path. |
| 54 shutil.copyfile(os.path.join(my_dirname, os.path.basename(path)), | 55 shutil.copyfile(os.path.join(my_dirname, os.path.basename(path)), |
| 55 os.path.join(source_tree_root, path)) | 56 os.path.join(source_tree_root, path)) |
| 56 | 57 |
| 57 return 0 | 58 return 0 |
| 58 | 59 |
| 59 | 60 |
| 60 if __name__ == '__main__': | 61 if __name__ == '__main__': |
| 61 sys.exit(DoMain(sys.argv)) | 62 sys.exit(DoMain(sys.argv)) |
| OLD | NEW |