| OLD | NEW |
| 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2006-2008 The Chromium Authors. 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 os | 5 import os |
| 6 import shutil | 6 import shutil |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 | 9 |
| 10 if sys.platform == 'win32': | 10 if sys.platform == 'win32': |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 PERL = 'perl', | 142 PERL = 'perl', |
| 143 PERL_INCLUDE_FLAG = '-I ', | 143 PERL_INCLUDE_FLAG = '-I ', |
| 144 PERL_INCLUDE_SUFFIX = '', | 144 PERL_INCLUDE_SUFFIX = '', |
| 145 _PERL_INCLUDE_FLAGS = ('${_concat(PERL_INCLUDE_FLAG, ' | 145 _PERL_INCLUDE_FLAGS = ('${_concat(PERL_INCLUDE_FLAG, ' |
| 146 'PERL_INCLUDE_PATH, ' | 146 'PERL_INCLUDE_PATH, ' |
| 147 'PERL_INCLUDE_SUFFIX,' | 147 'PERL_INCLUDE_SUFFIX,' |
| 148 '__env__, RDirs, TARGET, SOURCE)}'), | 148 '__env__, RDirs, TARGET, SOURCE)}'), |
| 149 ) | 149 ) |
| 150 | 150 |
| 151 root_env['req_system_libs'] = ARGUMENTS.get('SYSTEM_LIBS', '').split(',') | 151 root_env['req_system_libs'] = ARGUMENTS.get('SYSTEM_LIBS', '').split(',') |
| 152 root_env['_GYP'] = ARGUMENTS.get('GYP') and '_gyp' or '' |
| 152 | 153 |
| 153 def WantSystemLib(env, lib): | 154 def WantSystemLib(env, lib): |
| 154 """ | 155 """ |
| 155 Return true if lib has been requested as a system library in SYSTEM_LIBS. | 156 Return true if lib has been requested as a system library in SYSTEM_LIBS. |
| 156 """ | 157 """ |
| 157 if lib not in env['all_system_libs']: | 158 if lib not in env['all_system_libs']: |
| 158 env['all_system_libs'].append(lib) | 159 env['all_system_libs'].append(lib) |
| 159 return (lib in env['req_system_libs']) | 160 return (lib in env['req_system_libs']) |
| 160 root_env.AddMethod(WantSystemLib, "WantSystemLib") | 161 root_env.AddMethod(WantSystemLib, "WantSystemLib") |
| 161 | 162 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 181 root_env.ApplySConscript(['$CHROME_SRC_DIR/build/common.scons']) | 182 root_env.ApplySConscript(['$CHROME_SRC_DIR/build/common.scons']) |
| 182 | 183 |
| 183 # The list of all leaf (fully described) environments. | 184 # The list of all leaf (fully described) environments. |
| 184 environment_list = [] | 185 environment_list = [] |
| 185 components = [] | 186 components = [] |
| 186 | 187 |
| 187 # Figure out what SConscript files to load based on the user's request. | 188 # Figure out what SConscript files to load based on the user's request. |
| 188 # Default is to load all SConscript files for a full-tree build. | 189 # Default is to load all SConscript files for a full-tree build. |
| 189 # The keyword arguments in the call below (base, breakpad, etc.) can be | 190 # The keyword arguments in the call below (base, breakpad, etc.) can be |
| 190 # specified in the LOAD= argument to cut down on the build. | 191 # specified in the LOAD= argument to cut down on the build. |
| 191 sconscripts = root_env.ChromiumLoadComponentSConscripts( | 192 sconscript_map = dict( |
| 192 base = '$BASE_DIR/base.scons', | 193 base = '$BASE_DIR/base_main${_GYP}.scons', |
| 193 breakpad = '$BREAKPAD_DIR/SConscript', | 194 breakpad = '$BREAKPAD_DIR/SConscript', |
| 194 chrome = '$CHROME_DIR/chrome.scons', | 195 chrome = '$CHROME_DIR/chrome.scons', |
| 195 gears = '$GEARS_DIR/SConscript', | 196 gears = '$GEARS_DIR/SConscript', |
| 196 google_update = '$GOOGLE_UPDATE_DIR/SConscript', | 197 google_update = '$GOOGLE_UPDATE_DIR/SConscript', |
| 197 googleurl = '$GOOGLEURL_DIR/googleurl.scons', | 198 googleurl = '$GOOGLEURL_DIR/googleurl.scons', |
| 198 media = '$MEDIA_DIR/media.scons', | 199 media = '$MEDIA_DIR/media.scons', |
| 199 net = '$NET_DIR/net.scons', | 200 net = '$NET_DIR/net.scons', |
| 200 printing = '$PRINTING_DIR/printing.scons', | 201 printing = '$PRINTING_DIR/printing.scons', |
| 201 rlz = '$RLZ_DIR/SConscript', | 202 rlz = '$RLZ_DIR/SConscript', |
| 202 sandbox = '$SANDBOX_DIR/sandbox.scons', | 203 sandbox = '$SANDBOX_DIR/sandbox.scons', |
| 203 sdch = '$SDCH_DIR/SConscript', | 204 sdch = '$SDCH_DIR/SConscript', |
| 204 skia = '$SKIA_DIR/SConscript', | 205 skia = '$SKIA_DIR/SConscript', |
| 205 testing = '$TESTING_DIR/SConscript.gtest', | 206 testing = '$TESTING_DIR/SConscript.gtest', |
| 206 third_party = [ | 207 third_party = [ |
| 207 '$BSDIFF_DIR/bsdiff.scons', | 208 '$BSDIFF_DIR/bsdiff.scons', |
| 208 '$BSPATCH_DIR/bspatch.scons', | 209 '$BSPATCH_DIR/bspatch.scons', |
| 209 '$BZIP2_DIR/bzip2.scons', | 210 '$BZIP2_DIR/bzip2.scons', |
| 210 '$ICU38_DIR/icu38.scons', | 211 '$ICU38_DIR/icu38_main${_GYP}.scons', |
| 211 '$LIBJPEG_DIR/libjpeg.scons', | 212 '$LIBJPEG_DIR/libjpeg${_GYP}.scons', |
| 212 '$LIBPNG_DIR/libpng.scons', | 213 '$LIBPNG_DIR/libpng${_GYP}.scons', |
| 213 '$LIBXML_DIR/libxml.scons', | 214 '$LIBXML_DIR/libxml.scons', |
| 214 '$LIBXSLT_DIR/libxslt.scons', | 215 '$LIBXSLT_DIR/libxslt.scons', |
| 215 '$LZMA_SDK_DIR/lzma_sdk.scons', | 216 '$LZMA_SDK_DIR/lzma_sdk.scons', |
| 216 '$MODP_B64_DIR/modp_b64.scons', | 217 '$MODP_B64_DIR/modp_b64.scons', |
| 217 '$ZLIB_DIR/zlib.scons', | 218 '$ZLIB_DIR/zlib${_GYP}.scons', |
| 218 ], | 219 ], |
| 219 tools = '$GTK_CLIP_DUMP_DIR/gcd.scons', | 220 tools = '$GTK_CLIP_DUMP_DIR/gcd.scons', |
| 220 v8 = '$OBJ_ROOT/build/SConscript.v8', | 221 v8 = '$OBJ_ROOT/build/SConscript.v8', |
| 221 webkit = '$WEBKIT_DIR/webkit.scons', | 222 webkit = '$WEBKIT_DIR/webkit.scons', |
| 222 ) | 223 ) |
| 223 | 224 |
| 225 if root_env.get('_GYP'): |
| 226 Import('build_component') |
| 227 sconscripts = [sconscript_map[build_component]] |
| 228 components = [build_component] |
| 229 else: |
| 230 sconscripts = root_env.ChromiumLoadComponentSConscripts(**sconscript_map) |
| 231 |
| 224 # Add the final list into the root environment to be build in BuildComponents. | 232 # Add the final list into the root environment to be build in BuildComponents. |
| 225 root_env.Append(BUILD_SCONSCRIPTS = sconscripts) | 233 root_env.Append(BUILD_SCONSCRIPTS = sconscripts) |
| 226 | 234 |
| 227 if not root_env.WantSystemLib('sqlite'): | 235 if not root_env.WantSystemLib('sqlite') and not root_env.get('_GYP'): |
| 228 root_env.Append(BUILD_SCONSCRIPTS = ['$SQLITE_DIR/SConscript']) | 236 root_env.Append(BUILD_SCONSCRIPTS = ['$SQLITE_DIR/SConscript']) |
| 229 | 237 |
| 230 | 238 |
| 231 # -------------------------------------------------------------------------- | 239 # -------------------------------------------------------------------------- |
| 232 # Windows specific | 240 # Windows specific |
| 233 | 241 |
| 234 windows_env = root_env.Clone() | 242 windows_env = root_env.Clone() |
| 235 | 243 |
| 236 # TODO(siggi) Remove this code once SCons plays well when the | 244 # TODO(siggi) Remove this code once SCons plays well when the |
| 237 # Platform SDK 6.1 is installed with VS2005 but not VS2008. | 245 # Platform SDK 6.1 is installed with VS2005 but not VS2008. |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 'INTERCEPTOR_SOCKET', 'ENFORGE_DIGEST_CACHE', | 454 'INTERCEPTOR_SOCKET', 'ENFORGE_DIGEST_CACHE', |
| 447 'ENFORGE_CACHE_HOST', 'ENFORGE_CACHE_PORT'): | 455 'ENFORGE_CACHE_HOST', 'ENFORGE_CACHE_PORT'): |
| 448 if envvar in os.environ: | 456 if envvar in os.environ: |
| 449 linux_env['ENV'][envvar] = os.environ[envvar] | 457 linux_env['ENV'][envvar] = os.environ[envvar] |
| 450 | 458 |
| 451 excluded_warnings = [ | 459 excluded_warnings = [ |
| 452 # TODO: Clean up uses of ext/hash_map and remove this. | 460 # TODO: Clean up uses of ext/hash_map and remove this. |
| 453 # (see unordered_map and base/hash_tables.h) | 461 # (see unordered_map and base/hash_tables.h) |
| 454 '-Wno-deprecated', # Needed for using ext/hash_map on GCC 4.3 | 462 '-Wno-deprecated', # Needed for using ext/hash_map on GCC 4.3 |
| 455 ] | 463 ] |
| 464 if not root_env.get('_GYP'): |
| 465 linux_env.Append( |
| 466 BUILD_SCONSCRIPTS = [ |
| 467 '$LIBEVENT_DIR/libevent${_GYP}.scons', |
| 468 ], |
| 469 ) |
| 456 linux_env.Append( | 470 linux_env.Append( |
| 457 BUILD_SCONSCRIPTS = [ | 471 ASFLAGS = ['-32'], |
| 458 '$LIBEVENT_DIR/libevent.scons', | |
| 459 ], | |
| 460 CCFLAGS = ['-m32', '-pthread', '-march=i686', '-fno-exceptions'], | 472 CCFLAGS = ['-m32', '-pthread', '-march=i686', '-fno-exceptions'], |
| 461 # GCC will generate ident directives with the GCC version. Accumulate | 473 # GCC will generate ident directives with the GCC version. Accumulate |
| 462 # these all up and you end up with ~80K repeated in a .comment section. | 474 # these all up and you end up with ~80K repeated in a .comment section. |
| 463 CCFLAGS_OPTIMIZED = ['-fno-ident'], | 475 CCFLAGS_OPTIMIZED = ['-fno-ident'], |
| 464 CXXFLAGS = ['-Wall', '-Werror', '-march=i686'] + excluded_warnings, | 476 CXXFLAGS = ['-Wall', '-Werror', '-march=i686'] + excluded_warnings, |
| 465 LINKFLAGS = ['-m32', '-pthread'], | 477 LINKFLAGS = ['-m32', '-pthread'], |
| 466 ) | 478 ) |
| 467 | 479 |
| 468 linux_env.Replace( | 480 linux_env.Replace( |
| 469 # Linking of large files uses lots of RAM, so serialize links | 481 # Linking of large files uses lots of RAM, so serialize links |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 '$RLZ_DIR/SConscript', | 649 '$RLZ_DIR/SConscript', |
| 638 '$SANDBOX_DIR/sandbox.scons', | 650 '$SANDBOX_DIR/sandbox.scons', |
| 639 '$WEBKIT_DIR/SConscript', | 651 '$WEBKIT_DIR/SConscript', |
| 640 'build/SConscript.v8', | 652 'build/SConscript.v8', |
| 641 ], | 653 ], |
| 642 ) | 654 ) |
| 643 # TODO(bradnelson): this is needed for now because target_platform_mac has | 655 # TODO(bradnelson): this is needed for now because target_platform_mac has |
| 644 # OS_MACOSX defined in a weird way. | 656 # OS_MACOSX defined in a weird way. |
| 645 mac_env.FilterOut(CPPDEFINES = ['OS_MACOSX=OS_MACOSX']) | 657 mac_env.FilterOut(CPPDEFINES = ['OS_MACOSX=OS_MACOSX']) |
| 646 | 658 |
| 647 if not root_env.WantSystemLib('libevent'): | 659 if not root_env.WantSystemLib('libevent') and not root_env.get('_GYP'): |
| 648 mac_env.Append( | 660 mac_env.Append( |
| 649 BUILD_SCONSCRIPTS = [ | 661 BUILD_SCONSCRIPTS = [ |
| 650 '$LIBEVENT_DIR/libevent.scons', | 662 '$LIBEVENT_DIR/libevent${_GYP}.scons', |
| 651 ], | 663 ], |
| 652 ) | 664 ) |
| 653 mac_env.Append( | 665 mac_env.Append( |
| 654 CFLAGS = [ | 666 CFLAGS = [ |
| 655 '-std=c99', | 667 '-std=c99', |
| 656 ], | 668 ], |
| 657 CXXFLAGS = [ | 669 CXXFLAGS = [ |
| 658 '-fvisibility-inlines-hidden', | 670 '-fvisibility-inlines-hidden', |
| 659 '${str(SOURCE).endswith(".mm") and "-fobjc-gc" or ""}', | 671 '${str(SOURCE).endswith(".mm") and "-fobjc-gc" or ""}', |
| 660 ], | 672 ], |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 LOAD=[module,...] Comma-separated list of components to load in the | 752 LOAD=[module,...] Comma-separated list of components to load in the |
| 741 dependency graph ('-' prefix excludes): | 753 dependency graph ('-' prefix excludes): |
| 742 %s | 754 %s |
| 743 SYSTEM_LIBS=[lib,...] Comma-separated list of system libraries to link | 755 SYSTEM_LIBS=[lib,...] Comma-separated list of system libraries to link |
| 744 dynamically (by default they are built in from | 756 dynamically (by default they are built in from |
| 745 included sources): | 757 included sources): |
| 746 %s | 758 %s |
| 747 PROGRESS=type Display a progress indicator: | 759 PROGRESS=type Display a progress indicator: |
| 748 name: print each evaluated target name | 760 name: print each evaluated target name |
| 749 spinner: print a spinner every 5 targets | 761 spinner: print a spinner every 5 targets |
| 762 GYP=1 Any non-null value uses GYP-generated files |
| 763 (*_gyp.scons). |
| 750 """ | 764 """ |
| 751 | 765 |
| 752 if GetOption('help'): | 766 if GetOption('help'): |
| 753 import textwrap | 767 import textwrap |
| 754 tw = textwrap.TextWrapper( | 768 tw = textwrap.TextWrapper( |
| 755 width = 78, | 769 width = 78, |
| 756 initial_indent = ' '*32, | 770 initial_indent = ' '*32, |
| 757 subsequent_indent = ' '*32, | 771 subsequent_indent = ' '*32, |
| 758 ) | 772 ) |
| 759 components = tw.fill(', '.join(components)) | 773 components = tw.fill(', '.join(components)) |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 'all_libraries', | 853 'all_libraries', |
| 840 'all_languages', | 854 'all_languages', |
| 841 'all_programs', | 855 'all_programs', |
| 842 'all_test_programs', | 856 'all_test_programs', |
| 843 ], projects = [p], | 857 ], projects = [p], |
| 844 COMPONENT_VS_PROJECT_SCRIPT_PATH=( | 858 COMPONENT_VS_PROJECT_SCRIPT_PATH=( |
| 845 'cd $$(ProjectDir)/$VS_PROJECT_TO_MAIN_DIR && hammer.bat'), | 859 'cd $$(ProjectDir)/$VS_PROJECT_TO_MAIN_DIR && hammer.bat'), |
| 846 ) | 860 ) |
| 847 | 861 |
| 848 # ------------------------------------------------------------------------- | 862 # ------------------------------------------------------------------------- |
| OLD | NEW |