| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/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 """Downloads, builds (with instrumentation) and installs shared libraries.""" | 6 """Downloads, builds (with instrumentation) and installs shared libraries.""" |
| 7 | 7 |
| 8 import argparse | 8 import argparse |
| 9 import os | 9 import os |
| 10 import platform | 10 import platform |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 # Passing C(XX)FLAGS overrides the defaults, and EXTRA_C(XX)FLAGS is not | 119 # Passing C(XX)FLAGS overrides the defaults, and EXTRA_C(XX)FLAGS is not |
| 120 # supported. Append our extra flags to CC/CXX. | 120 # supported. Append our extra flags to CC/CXX. |
| 121 make_args.append('CC="%s %s"' % (environment['CC'], environment['CFLAGS'])) | 121 make_args.append('CC="%s %s"' % (environment['CC'], environment['CFLAGS'])) |
| 122 make_args.append('CXX="%s %s"' % | 122 make_args.append('CXX="%s %s"' % |
| 123 (environment['CXX'], environment['CXXFLAGS'])) | 123 (environment['CXX'], environment['CXXFLAGS'])) |
| 124 # We need to override ZDEFS_FLAGS at least to prevent -Wl,-z,defs. | 124 # We need to override ZDEFS_FLAGS at least to prevent -Wl,-z,defs. |
| 125 # Might as well use this to pass the linker flags, since ZDEF_FLAGS is always | 125 # Might as well use this to pass the linker flags, since ZDEF_FLAGS is always |
| 126 # added during linking on Linux. | 126 # added during linking on Linux. |
| 127 make_args.append('ZDEFS_FLAG="-Wl,-z,nodefs %s"' % environment['LDFLAGS']) | 127 make_args.append('ZDEFS_FLAG="-Wl,-z,nodefs %s"' % environment['LDFLAGS']) |
| 128 make_args.append('NSPR_INCLUDE_DIR=/usr/include/nspr') | 128 make_args.append('NSPR_INCLUDE_DIR=/usr/include/nspr') |
| 129 make_args.append('NSPR_LIB_DIR=/usr/lib') | 129 make_args.append('NSPR_LIB_DIR=%s/lib' % install_prefix) |
| 130 make_args.append('NSS_ENABLE_ECC=1') | 130 make_args.append('NSS_ENABLE_ECC=1') |
| 131 with ScopedChangeDirectory('nss') as cd_nss: | 131 with ScopedChangeDirectory('nss') as cd_nss: |
| 132 # -j is not supported | 132 # -j is not supported |
| 133 shell_call('make %s' % ' '.join(make_args), parsed_arguments.verbose, | 133 shell_call('make %s' % ' '.join(make_args), parsed_arguments.verbose, |
| 134 environment) | 134 environment) |
| 135 # 'make install' is not supported. Copy the DSOs manually. | 135 # 'make install' is not supported. Copy the DSOs manually. |
| 136 install_dir = '%s/lib/' % install_prefix | 136 install_dir = '%s/lib/' % install_prefix |
| 137 for (dirpath, dirnames, filenames) in os.walk('./lib/'): | 137 for (dirpath, dirnames, filenames) in os.walk('./lib/'): |
| 138 for filename in filenames: | 138 for filename in filenames: |
| 139 if filename.endswith('.so'): | 139 if filename.endswith('.so'): |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 os.chdir(get_script_absolute_path()) | 358 os.chdir(get_script_absolute_path()) |
| 359 # Ensure all build dependencies are installed. | 359 # Ensure all build dependencies are installed. |
| 360 if parsed_arguments.check_build_deps: | 360 if parsed_arguments.check_build_deps: |
| 361 check_package_build_dependencies(parsed_arguments.package) | 361 check_package_build_dependencies(parsed_arguments.package) |
| 362 | 362 |
| 363 download_build_install(parsed_arguments) | 363 download_build_install(parsed_arguments) |
| 364 | 364 |
| 365 | 365 |
| 366 if __name__ == '__main__': | 366 if __name__ == '__main__': |
| 367 main() | 367 main() |
| OLD | NEW |