| OLD | NEW |
| 1 # Copyright 2008, Google Inc. | 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 # All rights reserved. | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # | 3 # found in the LICENSE file. |
| 4 # Redistribution and use in source and binary forms, with or without | |
| 5 # modification, are permitted provided that the following conditions are | |
| 6 # met: | |
| 7 # | |
| 8 # * Redistributions of source code must retain the above copyright | |
| 9 # notice, this list of conditions and the following disclaimer. | |
| 10 # * Redistributions in binary form must reproduce the above | |
| 11 # copyright notice, this list of conditions and the following disclaimer | |
| 12 # in the documentation and/or other materials provided with the | |
| 13 # distribution. | |
| 14 # * Neither the name of Google Inc. nor the names of its | |
| 15 # contributors may be used to endorse or promote products derived from | |
| 16 # this software without specific prior written permission. | |
| 17 # | |
| 18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| 19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| 20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| 21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| 22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
| 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
| 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 29 | 4 |
| 30 import os | 5 import os |
| 31 import shutil | 6 import shutil |
| 32 import sys | 7 import sys |
| 33 | 8 |
| 34 | 9 |
| 35 p = ARGUMENTS.get('PROGRESS') | 10 p = ARGUMENTS.get('PROGRESS') |
| 36 if p == 'spinner': | 11 if p == 'spinner': |
| 37 Progress(['/\r', '|\r', '\\\r', '-\r'], interval=5, file=open('con', 'w')) | 12 Progress(['/\r', '|\r', '\\\r', '-\r'], interval=5, file=open('con', 'w')) |
| 38 elif p == 'name': | 13 elif p == 'name': |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 'PERL_INCLUDE_SUFFIX,' | 340 'PERL_INCLUDE_SUFFIX,' |
| 366 '__env__, RDirs, TARGET, SOURCE)}'), | 341 '__env__, RDirs, TARGET, SOURCE)}'), |
| 367 ) | 342 ) |
| 368 # Build with support for gcov when COVERAGE=1. | 343 # Build with support for gcov when COVERAGE=1. |
| 369 if ARGUMENTS.get('COVERAGE') == '1': | 344 if ARGUMENTS.get('COVERAGE') == '1': |
| 370 env.Append(CCFLAGS=['-fprofile-arcs', '-ftest-coverage']) | 345 env.Append(CCFLAGS=['-fprofile-arcs', '-ftest-coverage']) |
| 371 env.Append(LINKFLAGS=['-fprofile-arcs']) | 346 env.Append(LINKFLAGS=['-fprofile-arcs']) |
| 372 | 347 |
| 373 # Build with system-provided NSS | 348 # Build with system-provided NSS |
| 374 env.ParseConfig('pkg-config --cflags --libs nss') | 349 env.ParseConfig('pkg-config --cflags --libs nss') |
| 350 |
| 351 elif env['PLATFORM'] == 'darwin': |
| 352 |
| 353 # For now, mac only loads the components we know work on Mac, by default. |
| 354 load = [ |
| 355 'base', |
| 356 #'breakpad', |
| 357 'googleurl', |
| 358 'net', |
| 359 'skia', |
| 360 'testing', |
| 361 'third_party', |
| 362 #'webkit', |
| 363 ] |
| 364 |
| 365 env.Replace( |
| 366 # Reproduce XCode's behavior of using gcc even to link C++, |
| 367 # and distinguishing it the -x c++ option. |
| 368 CC = 'gcc-4.2', |
| 369 CXX = 'g++-4.2', |
| 370 LINK = '$CXX', |
| 371 |
| 372 CFLAGS = [ |
| 373 '-std=c99', |
| 374 ], |
| 375 CXXFLAGS = [ |
| 376 '-fvisibility-inlines-hidden', |
| 377 ], |
| 378 CCFLAGS = [ |
| 379 '-fmessage-length=0', |
| 380 '-pipe', |
| 381 '-O0', |
| 382 '-mdynamic-no-pic', |
| 383 '-Werror', |
| 384 '-Wnewline-eof', |
| 385 '-fvisibility=hidden', |
| 386 '-gdwarf-2', |
| 387 '-Wall', |
| 388 '-Wendif-labels', |
| 389 '-fstack-protector', |
| 390 '-fstack-protector-all', |
| 391 ], |
| 392 CPPDEFINES = [ |
| 393 'DEBUG', |
| 394 ], |
| 395 |
| 396 FRAMEWORKPATH = [ |
| 397 env.Dir('${TARGET_ROOT}'), |
| 398 '/System/Library/Frameworks/ApplicationServices.framework/Versions/A/F
rameworks', |
| 399 ], |
| 400 FRAMEWORKS = [ |
| 401 'ApplicationServices', |
| 402 'Foundation', |
| 403 ], |
| 404 ) |
| 405 |
| 375 else: | 406 else: |
| 376 | 407 |
| 377 print "Unsupported SCons $PLATFORM value %s" % repr(env['PLATFORM']) | 408 print "Unsupported SCons $PLATFORM value %s" % repr(env['PLATFORM']) |
| 378 Exit(1) | 409 Exit(1) |
| 379 | 410 |
| 380 | 411 |
| 381 if ARGUMENTS.get('VERBOSE') in (None, '0'): | 412 if ARGUMENTS.get('VERBOSE') in (None, '0'): |
| 382 env['CCCOMSTR'] = 'Compiling $TARGET ...' | 413 env['CCCOMSTR'] = 'Compiling $TARGET ...' |
| 383 env['CXXCOMSTR'] = 'Compiling $TARGET ...' | 414 env['CXXCOMSTR'] = 'Compiling $TARGET ...' |
| 384 env['ARCOMSTR'] = 'Archiving $TARGET ...' | 415 env['ARCOMSTR'] = 'Archiving $TARGET ...' |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 sconscripts.append('$SKIA_DIR/SConscript') | 486 sconscripts.append('$SKIA_DIR/SConscript') |
| 456 | 487 |
| 457 if LoadComponent('testing'): | 488 if LoadComponent('testing'): |
| 458 sconscripts.append('$TESTING_DIR/SConscript.gtest') | 489 sconscripts.append('$TESTING_DIR/SConscript.gtest') |
| 459 | 490 |
| 460 if LoadComponent('third_party'): | 491 if LoadComponent('third_party'): |
| 461 sconscripts.extend([ | 492 sconscripts.extend([ |
| 462 '$BSDIFF_DIR/SConscript', | 493 '$BSDIFF_DIR/SConscript', |
| 463 '$BZIP2_DIR/SConscript', | 494 '$BZIP2_DIR/SConscript', |
| 464 '$ICU38_DIR/SConscript', | 495 '$ICU38_DIR/SConscript', |
| 465 '$LIBJPEG_DIR/SConscript', | |
| 466 '$LIBPNG_DIR/SConscript', | 496 '$LIBPNG_DIR/SConscript', |
| 467 '$LIBXML_DIR/SConscript', | |
| 468 '$LIBXSLT_DIR/SConscript', | |
| 469 '$LZMA_SDK_DIR/SConscript', | 497 '$LZMA_SDK_DIR/SConscript', |
| 470 '$MODP_B64_DIR/SConscript', | 498 '$MODP_B64_DIR/SConscript', |
| 471 '$ZLIB_DIR/SConscript', | 499 '$ZLIB_DIR/SConscript', |
| 472 ]) | 500 ]) |
| 473 # This is temoporary until we get this lib to build on other platforms. | 501 # Temporary until we get these building on Mac. |
| 502 if env['PLATFORM'] != 'darwin': |
| 503 sconscripts.extend([ |
| 504 '$LIBJPEG_DIR/SConscript', |
| 505 '$LIBXML_DIR/SConscript', |
| 506 '$LIBXSLT_DIR/SConscript', |
| 507 ]) |
| 508 # This is temporary until we get this lib to build on other platforms. |
| 474 if env['PLATFORM'] == 'win32': | 509 if env['PLATFORM'] == 'win32': |
| 475 sconscripts.extend([ | 510 sconscripts.extend([ |
| 476 '$BSPATCH_DIR/SConscript', | 511 '$BSPATCH_DIR/SConscript', |
| 477 ]) | 512 ]) |
| 478 | 513 |
| 479 if LoadComponent('v8') and env.Dir('#/../v8').exists(): | 514 if LoadComponent('v8') and env.Dir('#/../v8').exists(): |
| 480 env.SConscript('SConscript.v8', | 515 env.SConscript('SConscript.v8', |
| 481 exports=['env']) | 516 exports=['env']) |
| 482 | 517 |
| 483 if LoadComponent('webkit'): | 518 if LoadComponent('webkit'): |
| (...skipping 25 matching lines...) Expand all Loading... |
| 509 initial_indent = ' '*32, | 544 initial_indent = ' '*32, |
| 510 subsequent_indent = ' '*32, | 545 subsequent_indent = ' '*32, |
| 511 ) | 546 ) |
| 512 components = tw.fill(', '.join(components)) | 547 components = tw.fill(', '.join(components)) |
| 513 | 548 |
| 514 Help(help_fmt % components) | 549 Help(help_fmt % components) |
| 515 | 550 |
| 516 | 551 |
| 517 Import('build_component') | 552 Import('build_component') |
| 518 Default(build_component) | 553 Default(build_component) |
| OLD | NEW |