| OLD | NEW |
| 1 # Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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 # Notes: | 5 # Notes: |
| 6 # This is the main Gears SConscript file. From here, we include sub-scripts | 6 # This is the main Gears SConscript file. From here, we include sub-scripts |
| 7 # that handle building various targets (third party libs, common exes, the | 7 # that handle building various targets (third party libs, common exes, the |
| 8 # browser plugins themselves, and installers). Some sub-scripts return a | 8 # browser plugins themselves, and installers). Some sub-scripts return a |
| 9 # dictionary of variables to be appended to the environment, so other | 9 # dictionary of variables to be appended to the environment, so other |
| 10 # sub-scripts can use them. | 10 # sub-scripts can use them. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 'symbian': ['NPAPI'], | 67 'symbian': ['NPAPI'], |
| 68 } | 68 } |
| 69 | 69 |
| 70 vars = Variables(None, ARGUMENTS) | 70 vars = Variables(None, ARGUMENTS) |
| 71 vars.AddVariables( | 71 vars.AddVariables( |
| 72 EnumVariable('OS', | 72 EnumVariable('OS', |
| 73 'Which OS is the target', os_guess, os_browsers_map.keys()), | 73 'Which OS is the target', os_guess, os_browsers_map.keys()), |
| 74 EnumVariable('MODE', | 74 EnumVariable('MODE', |
| 75 'Type of binary to generate', 'dbg', ['dbg', 'opt']), | 75 'Type of binary to generate', 'dbg', ['dbg', 'opt']), |
| 76 BoolVariable('OFFICIAL_BUILD', | 76 BoolVariable('OFFICIAL_BUILD', |
| 77 'Create a binary suitable for public release', 0) | 77 'Create a binary suitable for public release', 0), |
| 78 BoolVariable('GEARS_STATIC_LIB', |
| 79 'Create a static library for linking with Chrome', 0), |
| 78 ) | 80 ) |
| 79 vars.Update(env) | 81 vars.Update(env) |
| 80 | 82 |
| 81 env['VALID_BROWSERS'] = os_browsers_map[env['OS']] | 83 env['VALID_BROWSERS'] = os_browsers_map[env['OS']] |
| 82 | 84 |
| 83 # Add BROWSER last, since its valid inputs depend on $OS. | 85 # Add BROWSER last, since its valid inputs depend on $OS. |
| 84 vars.Add( | 86 vars.Add( |
| 85 EnumVariable('BROWSER', | 87 EnumVariable('BROWSER', |
| 86 'Which browser we want to build the plugin for. "all" builds all ' | 88 'Which browser we want to build the plugin for. "all" builds all ' |
| 87 'browsers for this OS.', | 89 'browsers for this OS.', |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 if env['USING_CCTESTS']: | 344 if env['USING_CCTESTS']: |
| 343 env.Append( | 345 env.Append( |
| 344 CPPDEFINES = 'USING_CCTESTS=1', | 346 CPPDEFINES = 'USING_CCTESTS=1', |
| 345 M4FLAGS = '-DUSING_CCTESTS=1', | 347 M4FLAGS = '-DUSING_CCTESTS=1', |
| 346 ) | 348 ) |
| 347 if env['OFFICIAL_BUILD']: | 349 if env['OFFICIAL_BUILD']: |
| 348 env.Append( | 350 env.Append( |
| 349 CPPDEFINES = 'OFFICIAL_BUILD=1', | 351 CPPDEFINES = 'OFFICIAL_BUILD=1', |
| 350 M4FLAGS = '-DOFFICIAL_BUILD=1', | 352 M4FLAGS = '-DOFFICIAL_BUILD=1', |
| 351 ) | 353 ) |
| 354 if env['GEARS_STATIC_LIB']: |
| 355 env.Append( |
| 356 CPPDEFINES = 'GEARS_STATIC_LIB=1', |
| 357 ) |
| 352 | 358 |
| 353 # TODO: if USING_LIBPNG | 359 # TODO: if USING_LIBPNG |
| 354 env.Append( | 360 env.Append( |
| 355 CPPDEFINES = [ | 361 CPPDEFINES = [ |
| 356 'PNG_USER_CONFIG', | 362 'PNG_USER_CONFIG', |
| 357 'CHROME_PNG_WRITE_SUPPORT', | 363 'CHROME_PNG_WRITE_SUPPORT', |
| 358 'GEARS_PNG_BUILD', | |
| 359 ] | 364 ] |
| 360 ) | 365 ) |
| 366 if not env['GEARS_STATIC_LIB']: |
| 367 # If we're not linking with Chrome, don't prefix all the symbols with |
| 368 # webkit_. |
| 369 env.Append(CPPDEFINES = ['GEARS_PNG_BUILD']) |
| 370 |
| 371 |
| 361 # TODO: if USING_ZLIB | 372 # TODO: if USING_ZLIB |
| 362 env.Append( | 373 env.Append( |
| 363 CPPDEFINES = [ | 374 CPPDEFINES = [ |
| 364 'NO_GZIP', | 375 'NO_GZIP', |
| 365 'NO_GZCOMPRESS', | 376 'NO_GZCOMPRESS', |
| 366 ] | 377 ] |
| 367 ) | 378 ) |
| 368 if env['OS'] == 'wince': | 379 if env['OS'] == 'wince': |
| 369 env.Append(CPPDEFINES = 'NO_ERRNO_H') | 380 env.Append(CPPDEFINES = 'NO_ERRNO_H') |
| 370 | 381 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 ], | 472 ], |
| 462 SHLINKFLAGS = [ | 473 SHLINKFLAGS = [ |
| 463 '/DLL', | 474 '/DLL', |
| 464 # Set the preferred base address. This value was chosen because (a) it's near | 475 # Set the preferred base address. This value was chosen because (a) it's near |
| 465 # the top of the valid address range, and (b) it doesn't conflict with other | 476 # the top of the valid address range, and (b) it doesn't conflict with other |
| 466 # DLLs loaded by Chrome in either the browser or plugin process. | 477 # DLLs loaded by Chrome in either the browser or plugin process. |
| 467 '/BASE:0x65000000', | 478 '/BASE:0x65000000', |
| 468 ], | 479 ], |
| 469 CPPFLAGS = [ | 480 CPPFLAGS = [ |
| 470 '/nologo', | 481 '/nologo', |
| 471 '/Zc:wchar_t-', | |
| 472 '/c', | 482 '/c', |
| 473 '/W3', | 483 '/W3', |
| 474 '/WX', | 484 '/WX', |
| 475 '/GR-', | 485 '/GR-', |
| 476 '/Fd"${TARGET.base}.pdb"', | 486 '/Fd"${TARGET.base}.pdb"', |
| 477 ], | 487 ], |
| 478 CXXFLAGS = [ | 488 CXXFLAGS = [ |
| 479 '/TP', | 489 '/TP', |
| 480 '/J', | 490 '/J', |
| 481 ], | 491 ], |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 CPPFLAGS = [ | 603 CPPFLAGS = [ |
| 594 '/MT', | 604 '/MT', |
| 595 '/O2', | 605 '/O2', |
| 596 ], | 606 ], |
| 597 COMMON_LINKFLAGS = [ | 607 COMMON_LINKFLAGS = [ |
| 598 '/INCREMENTAL:NO', | 608 '/INCREMENTAL:NO', |
| 599 '/OPT:REF', | 609 '/OPT:REF', |
| 600 '/OPT:ICF', | 610 '/OPT:ICF', |
| 601 ], | 611 ], |
| 602 ) | 612 ) |
| 613 if not env['GEARS_STATIC_LIB']: |
| 614 # Build with 2-byte wchar_t's only if we're building a DLL. To link with |
| 615 # Chrome, we need 4-byte wchar_t. |
| 616 env.Append( |
| 617 CPPFLAGS = [ |
| 618 '/Zc:wchar_t-', |
| 619 ], |
| 620 ) |
| 621 |
| 603 #--------------------------- LINUX --------------------------- | 622 #--------------------------- LINUX --------------------------- |
| 604 elif env['OS'] == 'linux': | 623 elif env['OS'] == 'linux': |
| 605 env.Append( | 624 env.Append( |
| 606 CPPDEFINES = [ | 625 CPPDEFINES = [ |
| 607 'LINUX', | 626 'LINUX', |
| 608 ], | 627 ], |
| 609 CPPPATH = [ | 628 CPPPATH = [ |
| 610 '$THIRD_PARTY_DIR/gtk/include/gtk-2.0', | 629 '$THIRD_PARTY_DIR/gtk/include/gtk-2.0', |
| 611 '$THIRD_PARTY_DIR/gtk/include/atk-1.0', | 630 '$THIRD_PARTY_DIR/gtk/include/atk-1.0', |
| 612 '$THIRD_PARTY_DIR/gtk/include/glib-2.0', | 631 '$THIRD_PARTY_DIR/gtk/include/glib-2.0', |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 env.Append(**browser_outputs) | 983 env.Append(**browser_outputs) |
| 965 | 984 |
| 966 # Note: even though the installers write to $INSTALLER_OUTDIR, they need to | 985 # Note: even though the installers write to $INSTALLER_OUTDIR, they need to |
| 967 # read files from other dirs, so we give them a variant_dir at the toplevel. | 986 # read files from other dirs, so we give them a variant_dir at the toplevel. |
| 968 env.SConscript('SConscript.installers', | 987 env.SConscript('SConscript.installers', |
| 969 exports=['env'], | 988 exports=['env'], |
| 970 variant_dir='$BASE_OUTDIR', | 989 variant_dir='$BASE_OUTDIR', |
| 971 duplicate=0) | 990 duplicate=0) |
| 972 | 991 |
| 973 env.Alias('gears-installers', 'gears') | 992 env.Alias('gears-installers', 'gears') |
| OLD | NEW |