Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2013 Google Inc. All rights reserved. | 1 # Copyright (c) 2013 Google Inc. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import copy | 5 import copy |
| 6 import hashlib | 6 import hashlib |
| 7 import multiprocessing | 7 import multiprocessing |
| 8 import os.path | 8 import os.path |
| 9 import re | 9 import re |
| 10 import signal | 10 import signal |
| (...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1636 # Chromium's ffmpeg c99conv.py currently looks for a 'cc =' line in | 1636 # Chromium's ffmpeg c99conv.py currently looks for a 'cc =' line in |
| 1637 # build.ninja so needs something valid here. http://crbug.com/233985 | 1637 # build.ninja so needs something valid here. http://crbug.com/233985 |
| 1638 cc = 'cl.exe' | 1638 cc = 'cl.exe' |
| 1639 cxx = 'cl.exe' | 1639 cxx = 'cl.exe' |
| 1640 ld = 'link.exe' | 1640 ld = 'link.exe' |
| 1641 ld_host = '$ld' | 1641 ld_host = '$ld' |
| 1642 else: | 1642 else: |
| 1643 cc = 'gcc' | 1643 cc = 'gcc' |
| 1644 cxx = 'g++' | 1644 cxx = 'g++' |
| 1645 ld = '$cxx' | 1645 ld = '$cxx' |
| 1646 ld_c = '$cc' | |
| 1646 ld_host = '$cxx_host' | 1647 ld_host = '$cxx_host' |
| 1647 | 1648 |
| 1648 cc_host = None | 1649 cc_host = None |
| 1649 cxx_host = None | 1650 cxx_host = None |
| 1650 cc_host_global_setting = None | 1651 cc_host_global_setting = None |
| 1651 cxx_host_global_setting = None | 1652 cxx_host_global_setting = None |
| 1652 | 1653 |
| 1653 build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) | 1654 build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) |
| 1654 make_global_settings = data[build_file].get('make_global_settings', []) | 1655 make_global_settings = data[build_file].get('make_global_settings', []) |
| 1655 build_to_root = gyp.common.InvertRelativePath(build_dir, | 1656 build_to_root = gyp.common.InvertRelativePath(build_dir, |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1888 './gyp-mac-tool filter-libtool libtool $libtool_flags ' | 1889 './gyp-mac-tool filter-libtool libtool $libtool_flags ' |
| 1889 '-static -o $out $in' | 1890 '-static -o $out $in' |
| 1890 '$postbuilds') | 1891 '$postbuilds') |
| 1891 master_ninja.rule( | 1892 master_ninja.rule( |
| 1892 'lipo', | 1893 'lipo', |
| 1893 description='LIPO $out, POSTBUILDS', | 1894 description='LIPO $out, POSTBUILDS', |
| 1894 command='rm -f $out && lipo -create $in -output $out$postbuilds') | 1895 command='rm -f $out && lipo -create $in -output $out$postbuilds') |
| 1895 | 1896 |
| 1896 # Record the public interface of $lib in $lib.TOC. See the corresponding | 1897 # Record the public interface of $lib in $lib.TOC. See the corresponding |
| 1897 # comment in the posix section above for details. | 1898 # comment in the posix section above for details. |
| 1898 solink_base = '$ld -shared $ldflags -o $lib %(suffix)s' | 1899 solink_base = '$ld %(type)s $ldflags -o $lib %(suffix)s' |
| 1899 mtime_preserving_solink_base = ( | 1900 mtime_preserving_solink_base = ( |
| 1900 'if [ ! -e $lib -o ! -e ${lib}.TOC ] || ' | 1901 'if [ ! -e $lib -o ! -e ${lib}.TOC ] || ' |
| 1901 # Always force dependent targets to relink if this library | 1902 # Always force dependent targets to relink if this library |
| 1902 # reexports something. Handling this correctly would require | 1903 # reexports something. Handling this correctly would require |
| 1903 # recursive TOC dumping but this is rare in practice, so punt. | 1904 # recursive TOC dumping but this is rare in practice, so punt. |
| 1904 'otool -l $lib | grep -q LC_REEXPORT_DYLIB ; then ' | 1905 'otool -l $lib | grep -q LC_REEXPORT_DYLIB ; then ' |
| 1905 '%(solink)s && %(extract_toc)s > ${lib}.TOC; ' | 1906 '%(solink)s && %(extract_toc)s > ${lib}.TOC; ' |
| 1906 'else ' | 1907 'else ' |
| 1907 '%(solink)s && %(extract_toc)s > ${lib}.tmp && ' | 1908 '%(solink)s && %(extract_toc)s > ${lib}.tmp && ' |
| 1908 'if ! cmp -s ${lib}.tmp ${lib}.TOC; then ' | 1909 'if ! cmp -s ${lib}.tmp ${lib}.TOC; then ' |
| 1909 'mv ${lib}.tmp ${lib}.TOC ; ' | 1910 'mv ${lib}.tmp ${lib}.TOC ; ' |
| 1910 'fi; ' | 1911 'fi; ' |
| 1911 'fi' | 1912 'fi' |
| 1912 % { 'solink': solink_base, | 1913 % { 'solink': solink_base, |
| 1913 'extract_toc': | 1914 'extract_toc': |
| 1914 '{ otool -l $lib | grep LC_ID_DYLIB -A 5; ' | 1915 '{ otool -l $lib | grep LC_ID_DYLIB -A 5; ' |
| 1915 'nm -gP $lib | cut -f1-2 -d\' \' | grep -v U$$; true; }'}) | 1916 'nm -gP $lib | cut -f1-2 -d\' \' | grep -v U$$; true; }'}) |
| 1916 | 1917 |
| 1917 # TODO(thakis): The solink_module rule is likely wrong. Xcode seems to pass | |
| 1918 # -bundle -single_module here (for osmesa.so). | |
| 1919 solink_suffix = '$in $solibs $libs$postbuilds' | 1918 solink_suffix = '$in $solibs $libs$postbuilds' |
| 1920 master_ninja.rule( | 1919 master_ninja.rule( |
| 1921 'solink', | 1920 'solink', |
| 1922 description='SOLINK $lib, POSTBUILDS', | 1921 description='SOLINK $lib, POSTBUILDS', |
| 1923 restat=True, | 1922 restat=True, |
| 1924 command=mtime_preserving_solink_base % {'suffix':solink_suffix}, | 1923 command=mtime_preserving_solink_base % {'suffix': solink_suffix, |
| 1924 'type': '-shared'}, | |
| 1925 pool='link_pool') | 1925 pool='link_pool') |
| 1926 master_ninja.rule( | 1926 master_ninja.rule( |
| 1927 'solink_notoc', | 1927 'solink_notoc', |
| 1928 description='SOLINK $lib, POSTBUILDS', | 1928 description='SOLINK $lib, POSTBUILDS', |
| 1929 restat=True, | 1929 restat=True, |
| 1930 command=solink_base % {'suffix':solink_suffix}, | 1930 command=solink_base % {'suffix':solink_suffix, 'type': '-shared'}, |
|
Mark Mentovai
2013/09/05 14:29:37
Missing space before solink_suffix?
| |
| 1931 pool='link_pool') | 1931 pool='link_pool') |
| 1932 | 1932 |
| 1933 solink_module_suffix = '$in $solibs $libs$postbuilds' | 1933 solink_module_suffix = '$in $solibs $libs$postbuilds' |
| 1934 master_ninja.rule( | 1934 master_ninja.rule( |
| 1935 'solink_module', | 1935 'solink_module', |
| 1936 description='SOLINK(module) $lib, POSTBUILDS', | 1936 description='SOLINK(module) $lib, POSTBUILDS', |
| 1937 restat=True, | 1937 restat=True, |
| 1938 command=mtime_preserving_solink_base % {'suffix':solink_module_suffix}, | 1938 command=mtime_preserving_solink_base % {'suffix': solink_module_suffix, |
| 1939 'type': '-bundle'}, | |
| 1939 pool='link_pool') | 1940 pool='link_pool') |
| 1940 master_ninja.rule( | 1941 master_ninja.rule( |
| 1941 'solink_module_notoc', | 1942 'solink_module_notoc', |
| 1942 description='SOLINK(module) $lib, POSTBUILDS', | 1943 description='SOLINK(module) $lib, POSTBUILDS', |
| 1943 restat=True, | 1944 restat=True, |
| 1944 command=solink_base % {'suffix':solink_module_suffix}, | 1945 command=solink_base % {'suffix': solink_module_suffix, 'type': '-bundle'}, |
| 1945 pool='link_pool') | 1946 pool='link_pool') |
| 1946 | 1947 |
| 1947 master_ninja.rule( | 1948 master_ninja.rule( |
| 1948 'link', | 1949 'link', |
| 1949 description='LINK $out, POSTBUILDS', | 1950 description='LINK $out, POSTBUILDS', |
| 1950 command=('$ld $ldflags -o $out ' | 1951 command=('$ld $ldflags -o $out ' |
| 1951 '$in $solibs $libs$postbuilds'), | 1952 '$in $solibs $libs$postbuilds'), |
| 1952 pool='link_pool') | 1953 pool='link_pool') |
| 1953 master_ninja.rule( | 1954 master_ninja.rule( |
| 1954 'infoplist', | 1955 'infoplist', |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2086 arglists.append( | 2087 arglists.append( |
| 2087 (target_list, target_dicts, data, params, config_name)) | 2088 (target_list, target_dicts, data, params, config_name)) |
| 2088 pool.map(CallGenerateOutputForConfig, arglists) | 2089 pool.map(CallGenerateOutputForConfig, arglists) |
| 2089 except KeyboardInterrupt, e: | 2090 except KeyboardInterrupt, e: |
| 2090 pool.terminate() | 2091 pool.terminate() |
| 2091 raise e | 2092 raise e |
| 2092 else: | 2093 else: |
| 2093 for config_name in config_names: | 2094 for config_name in config_names: |
| 2094 GenerateOutputForConfig(target_list, target_dicts, data, params, | 2095 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 2095 config_name) | 2096 config_name) |
| OLD | NEW |