blob: a7d26d6723b570f0cef16005e5436186993d9508 [file] [log] [blame]
[email protected]186f5602008-09-16 18:24:301# 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
3# found in the LICENSE file.
4
[email protected]172914a2008-09-25 17:09:265# Notes:
6# This assumes you have a working gears checkout from p4 in the current dir.
7# Steps for this:
8# > echo %USER%-chromegears > p4config
9# > set P4CONFIG=p4config
10# > g4 client -p //depot/googleclient/gears/p4_depot_paths
11# > g4 sync
12#
13# This is a work-in-progress conversion of the current Gears set of Makefiles.
14# A lot of the stuff doesn't translate to SCons-land well, and I'm not sure
15# how faithful we want to be to the original.
16#
17# Questions:
18# Should we flatten the output directory into
19# Hammer/gears/platform/browser/*.obj like Gears does now? If so, how?
20
[email protected]c1a37472008-10-08 00:05:2621# Notes to self:
22# - os.path.abspath('.') (the CWD) is variant_dir if it exists, else it's the
23# toplevel_dir (which contains the SConstruct).
24# - env.Entry('.') is the entry representing the variant_dir.
25# - env.Entry('#') is the entry representing the toplevel_dir.
26# - str(entry) gives the path relative to variant_dir, or abspath if the entry
27# is outside the variant_dir.
28# - entry.path gives the path relative to toplevel_dir.
29# - entry.abspath gives the absolute path.
30
[email protected]172914a2008-09-25 17:09:2631import os
32
[email protected]186f5602008-09-16 18:24:3033Import('env')
34
35env = env.Clone(
[email protected]c1a37472008-10-08 00:05:2636 OPEN_DIR = "googleclient/gears/opensource/gears",
37 THIRD_PARTY_DIR = "googleclient/gears/opensource/third_party",
[email protected]c1a37472008-10-08 00:05:2638 PRIVATE_THIRD_PARTY_DIR = "googleclient/third_party",
[email protected]186f5602008-09-16 18:24:3039)
40
[email protected]dff2b53ed2008-10-08 22:59:5341if not os.path.exists(env.Dir('#/$OPEN_DIR').abspath):
42 print 'Skipping Gears build: no perforce tree checked out.'
43 Return()
44
[email protected]186f5602008-09-16 18:24:3045# Argument switches
[email protected]777c7bf2008-09-30 20:01:2446
47# TODO: how do we detect linux vs osx?
48os_guess = env['PLATFORM']
49if os_guess == 'posix':
50 os_guess = 'linux'
51elif os_guess == 'darwin':
52 os_guess = 'osx'
53
[email protected]c1a37472008-10-08 00:05:2654# Map of OS -> valid browser targets for that OS.
55os_browsers_map = {
56 'win32': ['IE', 'FF2', 'FF3', 'NPAPI'],
57 'wince': ['IE'],
58 'linux': ['FF2', 'FF3'],
59 'osx': ['SF'],
60 'android': ['NPAPI'],
61}
62
[email protected]186f5602008-09-16 18:24:3063vars = Variables(None, ARGUMENTS)
64vars.AddVariables(
[email protected]c1a37472008-10-08 00:05:2665 EnumVariable('OS',
66 'Which OS is the target', os_guess, os_browsers_map.keys()),
67 EnumVariable('MODE',
68 'Type of binary to generate', 'dbg', ['dbg', 'opt']),
69 BoolVariable('OFFICIAL_BUILD',
70 'Create a binary suitable for public release', 0)
[email protected]186f5602008-09-16 18:24:3071)
72vars.Update(env)
73
[email protected]c1a37472008-10-08 00:05:2674env['VALID_BROWSERS'] = os_browsers_map[env['OS']]
75
76# Add BROWSER last, since its valid inputs depend on $OS.
77vars.Add(
78 EnumVariable('BROWSER',
79 'Which browser we want to build the plugin for. "all" builds all '
80 'browsers for this OS.',
81 'all', env['VALID_BROWSERS'] + ['all']))
82vars.Update(env)
83
[email protected]777c7bf2008-09-30 20:01:2484env.Replace(
[email protected]186f5602008-09-16 18:24:3085 USING_CCTESTS = (env['MODE'] == 'dbg' or not env['OFFICIAL_BUILD'])
86)
87
88# Version
[email protected]777c7bf2008-09-30 20:01:2489env.Replace(
[email protected]186f5602008-09-16 18:24:3090 MAJOR = '0',
91 MINOR = '4',
[email protected]5514903c2008-10-08 21:24:5592 BUILD = '23',
[email protected]186f5602008-09-16 18:24:3093 PATCH = '0',
94 VERSION = '${MAJOR}.${MINOR}.${BUILD}.${PATCH}',
95
[email protected]172914a2008-09-25 17:09:2696 FRIENDLY_NAME = 'Google Gears',
[email protected]186f5602008-09-16 18:24:3097 SHORT_NAME = 'gears',
98)
99
100# Platform
[email protected]25ab0c62008-10-14 00:28:34101# TODO: OSX and Symbian builds will override this value.
102# For other platforms we set just one value.
103if env['OS'] in ['wince', 'android']:
104 env.Replace(ARCH = 'arm')
105elif env['OS'] == 'osx':
106 # On OSX we build a fat binary.
107 env.Replace(ARCH = 'i386+ppc')
108else:
109 env.Replace(ARCH = 'i386')
[email protected]186f5602008-09-16 18:24:30110
[email protected]c1a37472008-10-08 00:05:26111# Output dirs
112env.Replace(
[email protected]25ab0c62008-10-14 00:28:34113 BASE_OUTDIR = '$GEARS_DIR/$OS-$ARCH-$MODE',
[email protected]c1a37472008-10-08 00:05:26114 COMMON_OUTDIR = '$BASE_OUTDIR/common',
[email protected]6b3531282008-10-10 00:01:37115 BROWSER_OUTDIR = '$BASE_OUTDIR/${BROWSER.lower()}',
[email protected]c1a37472008-10-08 00:05:26116 IE_OUTDIR = '$BASE_OUTDIR/ie',
117 FF2_OUTDIR = '$BASE_OUTDIR/ff2',
118 FF3_OUTDIR = '$BASE_OUTDIR/ff3',
119 NPAPI_OUTDIR = '$BASE_OUTDIR/npapi',
120 SF_OUTDIR = '$BASE_OUTDIR/sf',
[email protected]6b3531282008-10-10 00:01:37121
122 GENFILES_DIR = "$BROWSER_OUTDIR/genfiles",
123 COMMON_GENFILES_DIR = "$COMMON_OUTDIR/genfiles",
[email protected]c1a37472008-10-08 00:05:26124)
125
[email protected]5514903c2008-10-08 21:24:55126# Add our tools to the PATH.
[email protected]25ab0c62008-10-14 00:28:34127paths = []
[email protected]5514903c2008-10-08 21:24:55128if env['OS'] in ['win32', 'wince']:
[email protected]25ab0c62008-10-14 00:28:34129 # Clear out our environment so we don't accidentally use the system's libs.
130 env['ENV']['PATH'] = ''
131 env['ENV']['LIB'] = ''
132 env['ENV']['INCLUDE'] = ''
133
134 # Keep system32 for 'xcopy'.
135 paths += [env.subst('${ENV["SYSTEMROOT"]}/system32')]
136 if env['OS'] == 'win32':
137 env.Append(
138 VC80 = env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/vc_80/files').abspath)
139 paths += [
140 env.subst('$VC80/common7/ide'),
141 env.subst('$VC80/vc/bin'),
142 env.subst('$VC80/common7/tools'),
143 env.subst('$VC80/common7/tools/bin'),
144 env.subst('$VC80/team_tools/performance_tools'),
145 ]
146 else: # wince
147 env.Append(
148 VC80 = env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/vc_80ce/files').abspath)
149 paths += [
150 env.subst('$VC80/bin/x86_arm'),
151 env.subst('$VC80/common7/ide'),
152 env.subst('$VC80/common7/tools'),
153 env.subst('$VC80/common7/tools/bin'),
154 env.subst('$VC80/vc/bin'),
155 env.subst('$VC80/smartdevices/sdktools'),
156 ]
157
158 paths += [env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/wix/v3_0_2925/files').abspath]
159
160paths += [env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/gnu/files').abspath]
161paths += [env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/python_24').abspath]
162
163# Prepend them so our tools come first.
164for each in reversed(paths):
165 env.PrependENVPath('PATH', each)
[email protected]172914a2008-09-25 17:09:26166
[email protected]6b3531282008-10-10 00:01:37167# Building M4 files
[email protected]172914a2008-09-25 17:09:26168env.Tool('m4')
169
[email protected]6b3531282008-10-10 00:01:37170env.Append(
171 M4ARCH = (env['ARCH'] == 'i386' and 'x86' or '$ARCH'),
172 M4FLAGS = [
173 '--prefix-builtins',
174 '-DPRODUCT_VERSION=$VERSION',
175 '-DPRODUCT_VERSION_MAJOR=$MAJOR',
176 '-DPRODUCT_VERSION_MINOR=$MINOR',
177 '-DPRODUCT_VERSION_BUILD=$BUILD',
178 '-DPRODUCT_VERSION_PATCH=$PATCH',
179 '-DPRODUCT_OS=$OS',
180 '-DPRODUCT_ARCH="$M4ARCH"',
181 '-DPRODUCT_GCC_VERSION="gcc3"',
182 '-DPRODUCT_MAINTAINER="google"',
183 '-DPRODUCT_FRIENDLY_NAME_UQ="$FRIENDLY_NAME"',
184 '-DPRODUCT_SHORT_NAME_UQ="$SHORT_NAME"',
185 '-DI18N_LANGUAGES="(${",".join(I18N_LANGS)})"',
186 ],
187 M4PATH = [
188 '$OPEN_DIR',
189 '.',
190 ],
191)
192
193# SCons magic to make M4PATH work.
194env.Replace(
195 M4INCPREFIX = '-I',
196 M4INCSUFFIX = '',
197 _M4INCFLAGS = ('${_concat(M4INCPREFIX, M4PATH, M4INCSUFFIX, '
198 '__env__, RDirs, TARGET, SOURCE)}'),
199 M4COM = '$M4 $M4FLAGS ${_M4INCFLAGS} $SOURCE > $TARGET',
200)
201
202# TODO: Dependency scanner for m4 files - doesn't work. It can't detect files
203# that don't exist!
204#m4_include_re = re.compile(r'm4_include\((.*)\)', re.M)
205#def m4_scan(node, env, path):
206# contents = node.get_contents()
207# includes = m4_include_re.findall(contents)
208# ret_includes = []
209# for include in includes:
210# for dir in path:
211# file = os.path.join(dir, include)
212# if os.path.exists(file):
213# ret_includes.append(file)
214# break
215# return ret_includes
216#
217#m4_scanner = Scanner(function = m4_scan, skeys = ['.m4', '.html_m4'])
218#env.Append(SCANNERS = m4_scanner)
219
220
[email protected]7ef840ff2008-09-22 21:15:54221# C++ build flags.
[email protected]186f5602008-09-16 18:24:30222
[email protected]172914a2008-09-25 17:09:26223# Clear out the inherited defines from Chrome's build. I want to match Gears'
224# current build as closely as possible until we switch everyone to SCons, then
225# gradually integrate.
[email protected]7ef840ff2008-09-22 21:15:54226env.Replace(
[email protected]186f5602008-09-16 18:24:30227 CPPPATH = [
228 '$OPEN_DIR',
229 '$OPEN_DIR/..',
230 '$THIRD_PARTY_DIR',
231 '$THIRD_PARTY_DIR/breakpad/src',
232 '$THIRD_PARTY_DIR/googleurl',
233 '$THIRD_PARTY_DIR/npapi',
234 '$THIRD_PARTY_DIR/zlib',
235 '$THIRD_PARTY_DIR/v8/bindings_local',
[email protected]c1a37472008-10-08 00:05:26236 '.',
[email protected]6b3531282008-10-10 00:01:37237 '$COMMON_OUTDIR',
[email protected]172914a2008-09-25 17:09:26238 ],
239 LIBPATH = [
240 '$LIBS_DIR',
[email protected]186f5602008-09-16 18:24:30241 ],
[email protected]7ef840ff2008-09-22 21:15:54242 CCFLAGS = [],
[email protected]172914a2008-09-25 17:09:26243 CPPDEFINES = [],
244 LIBS = [],
245 LINKFLAGS = [],
[email protected]186f5602008-09-16 18:24:30246)
247
[email protected]7ef840ff2008-09-22 21:15:54248if env['MODE'] == 'dbg':
[email protected]172914a2008-09-25 17:09:26249 env.Append(
[email protected]f9ef79b2008-09-25 17:19:21250 CPPDEFINES = [
251 'DEBUG=1',
252 '_DEBUG=1',
253 ],
[email protected]172914a2008-09-25 17:09:26254 M4FLAGS = '-DDEBUG=1',
255 )
256else:
257 env.Append(
258 CPPDEFINES = 'NDEBUG=1',
259 M4FLAGS = '-DNDEBUG=1',
260 )
[email protected]7ef840ff2008-09-22 21:15:54261if env['USING_CCTESTS']:
[email protected]172914a2008-09-25 17:09:26262 env.Append(
263 CPPDEFINES = 'USING_CCTESTS=1',
264 M4FLAGS = '-DUSING_CCTESTS=1',
265 )
[email protected]7ef840ff2008-09-22 21:15:54266if env['OFFICIAL_BUILD']:
[email protected]172914a2008-09-25 17:09:26267 env.Append(
268 CPPDEFINES = 'OFFICIAL_BUILD=1',
269 M4FLAGS = '-DOFFICIAL_BUILD=1',
270 )
[email protected]186f5602008-09-16 18:24:30271
272# TODO: if USING_PNG
[email protected]172914a2008-09-25 17:09:26273env.Append(CPPDEFINES = 'PNG_USER_CONFIG')
274# TODO: if USING_ZLIB
[email protected]186f5602008-09-16 18:24:30275env.Append(
276 CPPDEFINES = [
[email protected]172914a2008-09-25 17:09:26277 'NO_GZIP',
278 'NO_GZCOMPRESS',
279 ]
[email protected]186f5602008-09-16 18:24:30280)
[email protected]25ab0c62008-10-14 00:28:34281if env['OS'] == 'wince':
282 env.Append(CPPDEFINES = 'NO_ERRNO_H')
[email protected]186f5602008-09-16 18:24:30283
[email protected]5514903c2008-10-08 21:24:55284# Languages
285
286env['I18N_LANGS'] = [
287 'en-US',
288 'ar',
289 'bg',
290 'ca',
291 'cs',
292 'da',
293 'de',
294 'el',
295 'en-GB',
296 'es',
297 'et',
298 'fa',
299 'fi',
300 'fil',
301 'fr',
302 'he',
303 'hi',
304 'hr',
305 'hu',
306 'id',
307 'is',
308 'it',
309 'ja',
310 'ko',
311 'lt',
312 'lv',
313 'ms',
314 'nl',
315 'no',
316 'pl',
317 'pt-BR',
318 'pt-PT',
319 'ro',
320 'ru',
321 'sk',
322 'sl',
323 'sr',
324 'sv',
325 'th',
326 'tr',
327 'uk',
328 'ur',
329 'vi',
330 'zh-CN',
331 'zh-TW',
332 'ml',
333 'te',
334 'gu',
335 'kn',
336 'or',
337 'bn',
338 'ta',
339 'mr',
340]
341
[email protected]172914a2008-09-25 17:09:26342# Platform-specific flags follow.
343
[email protected]25ab0c62008-10-14 00:28:34344if env['OS'] in ['win32', 'wince']:
[email protected]172914a2008-09-25 17:09:26345 env.Append(
346 CPPDEFINES = [
347 'STRICT',
348 '_UNICODE',
349 'UNICODE',
350 '_USRDLL',
351 'WIN32',
352 '_WINDLL',
353 '_CRT_SECURE_NO_DEPRECATE',
354 'NOMINMAX',
355
[email protected]7ef840ff2008-09-22 21:15:54356# In VC8, the way to disable exceptions is to remove all /EH* flags, and to
357# define _HAS_EXCEPTIONS=0 (for C++ headers) and _ATL_NO_EXCEPTIONS (for ATL).
358 '_HAS_EXCEPTIONS=0',
359 '_ATL_NO_EXCEPTIONS',
360# Do not export UTF functions.
361 'U_STATIC_IMPLEMENTATION',
[email protected]186f5602008-09-16 18:24:30362 ],
363 LINKFLAGS = [
[email protected]7ef840ff2008-09-22 21:15:54364 '/NOLOGO',
365 '/DEBUG',
366 '/RELEASE',
[email protected]172914a2008-09-25 17:09:26367
[email protected]25ab0c62008-10-14 00:28:34368 '/PDB:${TARGET.base}.pdb',
[email protected]186f5602008-09-16 18:24:30369# Set the preferred base address. This value was chosen because (a) it's near
370# the top of the valid address range, and (b) it doesn't conflict with other
371# DLLs loaded by Chrome in either the browser or plugin process.
372 '/BASE:0x65000000',
[email protected]7ef840ff2008-09-22 21:15:54373 ],
374 CPPFLAGS = [
[email protected]25ab0c62008-10-14 00:28:34375 '/nologo',
376 '/Zi', # TODO: Chrome defines /Z7, no idea what these are.
377 '/Zc:wchar_t-',
378 '/c',
379 '/W3',
380 '/WX',
381 '/GR-',
[email protected]7ef840ff2008-09-22 21:15:54382 ],
383 CXXFLAGS = [
[email protected]25ab0c62008-10-14 00:28:34384 '/TP',
385 '/J',
[email protected]186f5602008-09-16 18:24:30386 ],
[email protected]777c7bf2008-09-30 20:01:24387 CPPPATH = [
[email protected]25ab0c62008-10-14 00:28:34388 '$VC80_CPPPATH',
389 ],
390 LIBPATH = [
391 '$VC80_LIBPATH',
392 ],
393 )
394 if env['OS'] == 'win32':
395 env.Append(
396 CPPDEFINES = [
397# We require APPVER=5.0 for things like HWND_MESSAGE.
398# When APPVER=5.0, win32.mak in the Platform SDK sets:
399# C defines: WINVER=0x0500
400# _WIN32_WINNT=0x0500
401# _WIN32_IE=0x0500
402# _RICHEDIT_VER=0x0010
403# RC defines: WINVER=0x0500
404# MIDL flags: /target NT50
405# Note: _WIN32_WINDOWS was replaced by _WIN32_WINNT for post-Win95 builds.
406# Note: XP_WIN is only used by Firefox headers
407 '_WINDOWS',
408 'WINVER=0x0500',
409 '_WIN32_WINNT=0x0500',
410 '_WIN32_IE=0x0500',
411 '_RICHEDIT_VER=0x0010',
412 '_MERGE_PROXYSTUB',
413 'BREAKPAD_AVOID_STREAMS',
414 'XP_WIN',
415 ],
416 LINKFLAGS = [
417 '/MACHINE:X86',
418 '/NODEFAULTLIB:msvcrt',
419# Flags for security hardening (only available for win32, not wince).
420 '/DYNAMICBASE',
421 '/SAFESEH',
422
423# We only use /SUBSYSTEM on DLLs. For EXEs we omit the flag, and
424# the presence of main() or WinMain() determines the subsystem.
425 '/SUBSYSTEM:WINDOWS',
426 ],
427 VC80_CPPPATH = [
[email protected]777c7bf2008-09-30 20:01:24428# TODO: switch over to Chrome's SDK.
429# Note: these must come after $THIRD_PARTY_DIR/npapi because we want our own
430# npapi.h to take precedence.
[email protected]25ab0c62008-10-14 00:28:34431 '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80/files/include',
432 '$PRIVATE_THIRD_PARTY_DIR/platformsdk_vc80/files/include',
433 '$PRIVATE_THIRD_PARTY_DIR/vc_80/files/include',
434 ],
435 VC80_LIBPATH = [
436 '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80/files/lib',
437 '$PRIVATE_THIRD_PARTY_DIR/platformsdk_vc80/files/lib',
438 '$PRIVATE_THIRD_PARTY_DIR/vc_80/files/vc/lib',
439 ],
440 )
441 else: # OS=wince
442 env.Append(
443 CPPDEFINES = [
444# For Windows Mobile we need:
445# C defines: _WIN32_WCE=0x0501
446# _UNDER_CE=0x0501
447 '_WIN32_WCE=0x501',
448 'WINVER=_WIN32_WCE',
449 'UNDER_CE=0x501',
450 'WINCE',
451 'WIN32_PLATFORM_PSPC',
452 'ARM',
453 '_ARM_',
454 'POCKETPC2003_UI_MODEL',
455 '_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA',
456 '_CE_CRT_ALLOW_WIN_MINMAX',
457 ],
458 LINKFLAGS = [
459 '/MACHINE:THUMB',
460 '/NODEFAULTLIB:secchk.lib',
461 '/NODEFAULTLIB:oldnames.lib',
462 '/SUBSYSTEM:WINDOWSCE,5.01',
463 ],
464 VC80_CPPPATH = [
465 '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80ce/files/include',
466 '$PRIVATE_THIRD_PARTY_DIR/vc_80ce/files/include',
467# Visual Studio must be setup before the PocketPC SDK.
468 '$PRIVATE_THIRD_PARTY_DIR/pocketpc_sdk_ce_50/files/include/armv4i',
469 ],
470 VC80_LIBPATH = [
471 '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80ce/files/lib/armv4i',
472 '$PRIVATE_THIRD_PARTY_DIR/vc_80ce/files/lib/armv4i',
473 '$PRIVATE_THIRD_PARTY_DIR/pocketpc_sdk_ce_50/files/lib/armv4i',
474 ],
475 )
476
[email protected]172914a2008-09-25 17:09:26477 if env['MODE'] == 'dbg':
478 env.Append(
479 CPPFLAGS = [
480 '/MTd',
481 ],
482 )
483 else: # MODE=opt
484 env.Append(
485 CPPFLAGS = [
486 '/MT',
487 '/O2',
488 ],
489 LINKFLAGS = [
490 '/INCREMENTAL:NO',
491 '/OPT:REF',
492 '/OPT:ICF',
493 ],
494 )
[email protected]777c7bf2008-09-30 20:01:24495elif env['OS'] == 'linux':
496 env.Append(
497 CPPDEFINES = [
498 'LINUX',
499 ],
500 CPPPATH = [
501 '$THIRD_PARTY_DIR/gtk/include/gtk-2.0',
502 '$THIRD_PARTY_DIR/gtk/include/atk-1.0',
503 '$THIRD_PARTY_DIR/gtk/include/glib-2.0',
504 '$THIRD_PARTY_DIR/gtk/include/pango-1.0',
505 '$THIRD_PARTY_DIR/gtk/include/cairo',
506 '$THIRD_PARTY_DIR/gtk/lib/gtk-2.0/include',
507 '$THIRD_PARTY_DIR/gtk/lib/glib-2.0/include',
508 ],
509 CCFLAGS = [
510 '-fPIC',
511 '-fmessage-length=0',
512 '-Wall',
513 '-Werror',
514# NS_LITERAL_STRING does not work properly without this compiler option
515 '-fshort-wchar',
516# Additions to compile on hardy
517 '-Wno-unused-variable',
518 '-Wno-missing-braces',
519 '-Wno-address',
520 '-m32',
521 ],
522 CXXFLAGS = [
523 '-fno-exceptions',
524 '-fno-rtti',
525 '-Wno-non-virtual-dtor',
526 '-Wno-ctor-dtor-privacy',
527 '-funsigned-char',
528 '-Wno-char-subscripts',
529 ],
530 LINKFLAGS = [
531 '-fPIC',
532 '-Bsymbolic',
533 '-pthread',
534
535# TODO: Following are DLLFLAGS. Figure something out for non-lib targets.
536 '-shared',
537 '-Wl,--version-script',
538 '-Wl,$OPEN_DIR/tools/xpcom-ld-script',
539# for PortAudio: need pthread and math
540 '-lpthread',
541 '-lm',
542# Additions to compile on hardy
543 '-m32',
544 ],
545 )
546 if env['MODE'] == 'dbg':
547 env.Append(
548 CPPFLAGS = [
549 '-g',
550 '-O0',
551 ],
552 )
553 else: # MODE=opt
554 env.Append(
555 CPPFLAGS = [
556 '-O2',
557 ],
558 )
[email protected]172914a2008-09-25 17:09:26559
[email protected]7ef840ff2008-09-22 21:15:54560# Load all the components
[email protected]186f5602008-09-16 18:24:30561
562sconscripts = [
[email protected]7ef840ff2008-09-22 21:15:54563 'SConscript.googleurl',
[email protected]186f5602008-09-16 18:24:30564 'SConscript.libgd',
565 'SConscript.libjpeg',
566 'SConscript.libpng',
567 'SConscript.portaudio',
568 'SConscript.sqlite',
569 'SConscript.zlib',
570]
571
[email protected]25ab0c62008-10-14 00:28:34572
[email protected]7ef840ff2008-09-22 21:15:54573for each in sconscripts:
574 env.SConscript(each,
575 exports=['env'],
[email protected]c1a37472008-10-08 00:05:26576 variant_dir='$COMMON_OUTDIR',
[email protected]7ef840ff2008-09-22 21:15:54577 duplicate=0)
[email protected]186f5602008-09-16 18:24:30578
[email protected]6b3531282008-10-10 00:01:37579# Must come before SConscript.dll because it Imports targets from this
580# SConscript.
581env.SConscript('SConscript.common',
582 exports=['env'],
583 variant_dir='$COMMON_OUTDIR',
584 duplicate=0)
585
[email protected]c1a37472008-10-08 00:05:26586browsers = [env['BROWSER']]
587if browsers[0] == 'all':
588 browsers = env['VALID_BROWSERS']
589print 'Building:', browsers
590
591for each in browsers:
[email protected]6b3531282008-10-10 00:01:37592 env.Replace(BROWSER = each)
[email protected]c1a37472008-10-08 00:05:26593 env.SConscript('SConscript.dll',
594 exports=['env'],
595 variant_dir='$BROWSER_OUTDIR',
596 duplicate=0)
597
598env.SConscript('SConscript.installers',
[email protected]7ef840ff2008-09-22 21:15:54599 exports=['env'],
[email protected]c1a37472008-10-08 00:05:26600 variant_dir='$BASE_OUTDIR',
[email protected]7ef840ff2008-09-22 21:15:54601 duplicate=0)