diff options
author | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-14 00:28:34 +0000 |
---|---|---|
committer | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-14 00:28:34 +0000 |
commit | 25ab0c6f7454bc7a8a61478f0ef39082dc75bf1e (patch) | |
tree | d639111fe45769c3b97c51a81882035c429fde3a /gears | |
parent | 039a3bcf29d3a985a5fc160c2fc631eff25b522b (diff) | |
download | chromium_src-25ab0c6f7454bc7a8a61478f0ef39082dc75bf1e.zip chromium_src-25ab0c6f7454bc7a8a61478f0ef39082dc75bf1e.tar.gz chromium_src-25ab0c6f7454bc7a8a61478f0ef39082dc75bf1e.tar.bz2 |
Add WinCE support to Gears SConscripts. No installer support yet.
Review URL: http://codereview.chromium.org/7133
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3336 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gears')
-rw-r--r-- | gears/SConscript | 204 | ||||
-rw-r--r-- | gears/SConscript.dll | 129 | ||||
-rw-r--r-- | gears/SConscript.googleurl | 2 | ||||
-rw-r--r-- | gears/SConscript.installers | 12 | ||||
-rw-r--r-- | gears/SConscript.libgd | 1 | ||||
-rw-r--r-- | gears/SConscript.libjpeg | 1 | ||||
-rw-r--r-- | gears/SConscript.libpng | 1 | ||||
-rw-r--r-- | gears/SConscript.portaudio | 5 | ||||
-rw-r--r-- | gears/SConscript.sqlite | 4 | ||||
-rw-r--r-- | gears/SConscript.zlib | 1 |
10 files changed, 262 insertions, 98 deletions
diff --git a/gears/SConscript b/gears/SConscript index c3b53c35..a7d26d6 100644 --- a/gears/SConscript +++ b/gears/SConscript @@ -98,11 +98,19 @@ env.Replace( ) # Platform -env.Replace(ARCH = 'i386') +# TODO: OSX and Symbian builds will override this value. +# For other platforms we set just one value. +if env['OS'] in ['wince', 'android']: + env.Replace(ARCH = 'arm') +elif env['OS'] == 'osx': + # On OSX we build a fat binary. + env.Replace(ARCH = 'i386+ppc') +else: + env.Replace(ARCH = 'i386') # Output dirs env.Replace( - BASE_OUTDIR = '$GEARS_DIR/$MODE', + BASE_OUTDIR = '$GEARS_DIR/$OS-$ARCH-$MODE', COMMON_OUTDIR = '$BASE_OUTDIR/common', BROWSER_OUTDIR = '$BASE_OUTDIR/${BROWSER.lower()}', IE_OUTDIR = '$BASE_OUTDIR/ie', @@ -116,13 +124,45 @@ env.Replace( ) # Add our tools to the PATH. -env.PrependENVPath('PATH', - env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/gnu/files').abspath) -env.PrependENVPath('PATH', - env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/python_24').abspath) +paths = [] if env['OS'] in ['win32', 'wince']: - env.PrependENVPath('PATH', - env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/wix/v3_0_2925/files').abspath) + # Clear out our environment so we don't accidentally use the system's libs. + env['ENV']['PATH'] = '' + env['ENV']['LIB'] = '' + env['ENV']['INCLUDE'] = '' + + # Keep system32 for 'xcopy'. + paths += [env.subst('${ENV["SYSTEMROOT"]}/system32')] + if env['OS'] == 'win32': + env.Append( + VC80 = env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/vc_80/files').abspath) + paths += [ + env.subst('$VC80/common7/ide'), + env.subst('$VC80/vc/bin'), + env.subst('$VC80/common7/tools'), + env.subst('$VC80/common7/tools/bin'), + env.subst('$VC80/team_tools/performance_tools'), + ] + else: # wince + env.Append( + VC80 = env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/vc_80ce/files').abspath) + paths += [ + env.subst('$VC80/bin/x86_arm'), + env.subst('$VC80/common7/ide'), + env.subst('$VC80/common7/tools'), + env.subst('$VC80/common7/tools/bin'), + env.subst('$VC80/vc/bin'), + env.subst('$VC80/smartdevices/sdktools'), + ] + + paths += [env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/wix/v3_0_2925/files').abspath] + +paths += [env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/gnu/files').abspath] +paths += [env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/python_24').abspath] + +# Prepend them so our tools come first. +for each in reversed(paths): + env.PrependENVPath('PATH', each) # Building M4 files env.Tool('m4') @@ -238,6 +278,8 @@ env.Append( 'NO_GZCOMPRESS', ] ) +if env['OS'] == 'wince': + env.Append(CPPDEFINES = 'NO_ERRNO_H') # Languages @@ -299,7 +341,7 @@ env['I18N_LANGS'] = [ # Platform-specific flags follow. -if env['OS'] == 'win32': +if env['OS'] in ['win32', 'wince']: env.Append( CPPDEFINES = [ 'STRICT', @@ -311,25 +353,6 @@ if env['OS'] == 'win32': '_CRT_SECURE_NO_DEPRECATE', 'NOMINMAX', -# We require APPVER=5.0 for things like HWND_MESSAGE. -# When APPVER=5.0, win32.mak in the Platform SDK sets: -# C defines: WINVER=0x0500 -# _WIN32_WINNT=0x0500 -# _WIN32_IE=0x0500 -# _RICHEDIT_VER=0x0010 -# RC defines: WINVER=0x0500 -# MIDL flags: /target NT50 -# Note: _WIN32_WINDOWS was replaced by _WIN32_WINNT for post-Win95 builds. -# Note: XP_WIN is only used by Firefox headers - '_WINDOWS', - 'WINVER=0x0500', - '_WIN32_WINNT=0x0500', - '_WIN32_IE=0x0500', - '_RICHEDIT_VER=0x0010', - '_MERGE_PROXYSTUB', - 'BREAKPAD_AVOID_STREAMS', - 'XP_WIN', - # In VC8, the way to disable exceptions is to remove all /EH* flags, and to # define _HAS_EXCEPTIONS=0 (for C++ headers) and _ATL_NO_EXCEPTIONS (for ATL). '_HAS_EXCEPTIONS=0', @@ -342,48 +365,115 @@ if env['OS'] == 'win32': '/DEBUG', '/RELEASE', - # win32-specific - '/MACHINE:X86', - '/NODEFAULTLIB:msvcrt', -# Flags for security hardening (only available for win32, not wince). - '/DYNAMICBASE', - '/SAFESEH', -# We only use /SUBSYSTEM on DLLs. For EXEs we omit the flag, and -# the presence of main() or WinMain() determines the subsystem. - '/SUBSYSTEM:WINDOWS', - + '/PDB:${TARGET.base}.pdb', # Set the preferred base address. This value was chosen because (a) it's near # the top of the valid address range, and (b) it doesn't conflict with other # DLLs loaded by Chrome in either the browser or plugin process. '/BASE:0x65000000', ], CPPFLAGS = [ - '/nologo', - '/Zi', # TODO: Chrome defines /Z7, no idea what these are. - '/Zc:wchar_t-', - '/c', - '/W3', - '/WX', - '/GR-', + '/nologo', + '/Zi', # TODO: Chrome defines /Z7, no idea what these are. + '/Zc:wchar_t-', + '/c', + '/W3', + '/WX', + '/GR-', ], CXXFLAGS = [ - '/TP', - '/J', + '/TP', + '/J', ], CPPPATH = [ -# TODO: switch over to Chrome's SDK. -# Note: these must come after $THIRD_PARTY_DIR/npapi because we want our own -# npapi.h to take precedence. - '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80/files/include', - '$PRIVATE_THIRD_PARTY_DIR/platformsdk_vc80/files/include', - '$PRIVATE_THIRD_PARTY_DIR/vc_80/files/include', + '$VC80_CPPPATH', ], LIBPATH = [ - '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80/files/lib', - '$PRIVATE_THIRD_PARTY_DIR/platformsdk_vc80/files/lib', - '$PRIVATE_THIRD_PARTY_DIR/vc_80/files/vc/lib', + '$VC80_LIBPATH', ], ) + if env['OS'] == 'win32': + env.Append( + CPPDEFINES = [ +# We require APPVER=5.0 for things like HWND_MESSAGE. +# When APPVER=5.0, win32.mak in the Platform SDK sets: +# C defines: WINVER=0x0500 +# _WIN32_WINNT=0x0500 +# _WIN32_IE=0x0500 +# _RICHEDIT_VER=0x0010 +# RC defines: WINVER=0x0500 +# MIDL flags: /target NT50 +# Note: _WIN32_WINDOWS was replaced by _WIN32_WINNT for post-Win95 builds. +# Note: XP_WIN is only used by Firefox headers + '_WINDOWS', + 'WINVER=0x0500', + '_WIN32_WINNT=0x0500', + '_WIN32_IE=0x0500', + '_RICHEDIT_VER=0x0010', + '_MERGE_PROXYSTUB', + 'BREAKPAD_AVOID_STREAMS', + 'XP_WIN', + ], + LINKFLAGS = [ + '/MACHINE:X86', + '/NODEFAULTLIB:msvcrt', +# Flags for security hardening (only available for win32, not wince). + '/DYNAMICBASE', + '/SAFESEH', + +# We only use /SUBSYSTEM on DLLs. For EXEs we omit the flag, and +# the presence of main() or WinMain() determines the subsystem. + '/SUBSYSTEM:WINDOWS', + ], + VC80_CPPPATH = [ +# TODO: switch over to Chrome's SDK. +# Note: these must come after $THIRD_PARTY_DIR/npapi because we want our own +# npapi.h to take precedence. + '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80/files/include', + '$PRIVATE_THIRD_PARTY_DIR/platformsdk_vc80/files/include', + '$PRIVATE_THIRD_PARTY_DIR/vc_80/files/include', + ], + VC80_LIBPATH = [ + '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80/files/lib', + '$PRIVATE_THIRD_PARTY_DIR/platformsdk_vc80/files/lib', + '$PRIVATE_THIRD_PARTY_DIR/vc_80/files/vc/lib', + ], + ) + else: # OS=wince + env.Append( + CPPDEFINES = [ +# For Windows Mobile we need: +# C defines: _WIN32_WCE=0x0501 +# _UNDER_CE=0x0501 + '_WIN32_WCE=0x501', + 'WINVER=_WIN32_WCE', + 'UNDER_CE=0x501', + 'WINCE', + 'WIN32_PLATFORM_PSPC', + 'ARM', + '_ARM_', + 'POCKETPC2003_UI_MODEL', + '_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA', + '_CE_CRT_ALLOW_WIN_MINMAX', + ], + LINKFLAGS = [ + '/MACHINE:THUMB', + '/NODEFAULTLIB:secchk.lib', + '/NODEFAULTLIB:oldnames.lib', + '/SUBSYSTEM:WINDOWSCE,5.01', + ], + VC80_CPPPATH = [ + '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80ce/files/include', + '$PRIVATE_THIRD_PARTY_DIR/vc_80ce/files/include', +# Visual Studio must be setup before the PocketPC SDK. + '$PRIVATE_THIRD_PARTY_DIR/pocketpc_sdk_ce_50/files/include/armv4i', + ], + VC80_LIBPATH = [ + '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80ce/files/lib/armv4i', + '$PRIVATE_THIRD_PARTY_DIR/vc_80ce/files/lib/armv4i', + '$PRIVATE_THIRD_PARTY_DIR/pocketpc_sdk_ce_50/files/lib/armv4i', + ], + ) + if env['MODE'] == 'dbg': env.Append( CPPFLAGS = [ @@ -467,7 +557,6 @@ elif env['OS'] == 'linux': ], ) - # Load all the components sconscripts = [ @@ -480,6 +569,7 @@ sconscripts = [ 'SConscript.zlib', ] + for each in sconscripts: env.SConscript(each, exports=['env'], diff --git a/gears/SConscript.dll b/gears/SConscript.dll index 6221420..9095031 100644 --- a/gears/SConscript.dll +++ b/gears/SConscript.dll @@ -147,35 +147,64 @@ env.Append( ], LIBS = [ # 'base', - 'gd', 'googleurl-gears', # env['ICU_LIBS'], # TODO(sgk): '$ICU_LIBS' when scons is fixed - 'jpeg-gears', # 'modp_b64', 'png-gears', - 'portaudio', 'sqlite-gears', # 'skia', 'zlib-gears', ], ) +# Add in libraries for in-development APIs for non-official builds. +if not env['OFFICIAL_BUILD']: + if env['OS'] != 'wince': + env.Append(LIBS = [ + 'gd', + 'jpeg-gears' + ]) + env.Append(LIBS = 'portaudio') + if env['BROWSER'] == 'IE': - env.Append( - LIBS = [ - 'kernel32.lib', - 'user32.lib', - 'gdi32.lib', - 'uuid.lib', - 'sensapi.lib', - 'shlwapi.lib', - 'shell32.lib', - 'advapi32.lib', - 'wininet.lib', - 'comdlg32.lib', - 'user32.lib', - ], - ) + if env['OS'] == 'win32': + env.Append( + LIBS = [ + 'kernel32.lib', + 'user32.lib', + 'gdi32.lib', + 'uuid.lib', + 'sensapi.lib', + 'shlwapi.lib', + 'shell32.lib', + 'advapi32.lib', + 'wininet.lib', + 'comdlg32.lib', + 'user32.lib', + ], + ) + else: # OS=wince + env.Append( + LIBS = [ + 'wininet.lib', + 'ceshell.lib', + 'coredll.lib', + 'corelibc.lib', + 'ole32.lib', + 'oleaut32.lib', + 'uuid.lib', + 'commctrl.lib', + 'atlosapis.lib', + 'piedocvw.lib', + 'cellcore.lib', + 'htmlview.lib', + 'imaging.lib', + 'toolhelp.lib', + 'aygshell.lib', + 'iphlpapi.lib', + 'gpsapi.lib', + ], + ) elif env['BROWSER'] in ['FF2', 'FF3']: env.Append( LIBPATH = '$GECKO_LIB', @@ -227,7 +256,7 @@ env_res.Replace( '$COMMON_GENFILES_DIR/..', '$GENFILES_DIR/..', '$OPEN_DIR', - '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80/files/include', + '$VC80_CPPPATH', ], ) @@ -236,15 +265,33 @@ if env['MODE'] == 'dbg': else: env_res.Append(CPPDEFINES = 'NDEBUG=1') +env_res.Append(RCFLAGS = [('/l', '0x409')]) if env['OS'] == 'win32': - env_res.Append(RCFLAGS = ['/l', '0x409']) - -if env['OS'] == 'win32': - env.Append( - CPPFLAGS = [ - '/wd4018' # TODO: move to breakpad + env_res.Append( + CPPPATH = [ + '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80/files/include', ], ) +elif env['OS'] == 'wince': + env_res.Append( + CPPDEFINES = [ + 'WINCE', + '_WIN32', + '_WIN32_WCE', + 'UNDER_CE', + ], + CPPPATH = [ + '$OPEN_DIR/..', + '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80ce/files/include', + ], + RCFLAGS = [ + '-N', + ] + ) + +if env['OS'] == 'win32': + # TODO: move to breakpad + env.Append(CPPFLAGS = ['/wd4018']) # Input file lists @@ -468,6 +515,7 @@ elif env['OS'] == 'wince': srcs['IE'] += [ '$OPEN_DIR/base/common/common_ie.cc', '$OPEN_DIR/base/common/file_wince.cc', + '$OPEN_DIR/base/common/html_event_monitor_iemobile.cc', '$OPEN_DIR/base/common/wince_compatibility.cc', ] @@ -878,6 +926,18 @@ if not env['OFFICIAL_BUILD']: ] #----------------------------------------------------------------------------- +# installer/wince + +if env['OS'] == 'wince': + srcs['IE'] += [ + '$OPEN_DIR/installer/iemobile/cab_updater.cc', + ] + + m4srcs['IE'] += [ + '$OPEN_DIR/installer/iemobile/setup.rc.m4', + ] + +#----------------------------------------------------------------------------- # image # The Image API is not yet enabled in official builds. @@ -969,18 +1029,21 @@ if not env['OFFICIAL_BUILD']: dll_resources = [] -if env['OS'] == 'win32': +if env['OS'] in ['win32', 'wince']: ui_res = env_res.RES('$GENFILES_DIR/ui_resources.rc'), + dll_resources += [ui_res] module_res = None if env['BROWSER'] == 'NPAPI': module_res = env_res.RES('$OPEN_DIR/base/npapi/module.rc') + dll_resources += [module_res] elif env['BROWSER'] == 'IE': module_res = env_res.RES('$OPEN_DIR/base/ie/module.rc') + string_res = env_res.RES('$GENFILES_DIR/string_table.rc') + dll_resources += [module_res, string_res] - dll_resources += [ui_res] - if module_res: - dll_resources += [module_res] + if env['OS'] == 'wince': + dll_resources += [env_res.RES('$GENFILES_DIR/setup.rc')] #----------------------------------------------------------------------------- # libs @@ -1012,9 +1075,7 @@ elif env['BROWSER'] == 'IE': # - libtremor # - vista broker # TODO: other targets -# - installer -# - notifier - +# - installer (safari, android, iemobile ...) # Now build the dependency tree. def PatternRule(t, s): return utils.PatternRule(t, s, env) @@ -1084,12 +1145,10 @@ if env['BROWSER'] in ['FF2', 'FF3']: srcs['all'] += common_targets['src'] # TODO: figure out why the .rc scanner doesn't notice these dependencies. -if env['OS'] == 'win32': +if env['OS'] in ['win32', 'wince']: env.Depends(ui_res, html_m4s) env.Depends(module_res, m4s) -Export('m4srcs') - module = env.ChromeSharedLibrary('gears', srcs['all'] + libs + dll_resources) env.Alias('gears', module) diff --git a/gears/SConscript.googleurl b/gears/SConscript.googleurl index c4fea18..6cc9d4d1f 100644 --- a/gears/SConscript.googleurl +++ b/gears/SConscript.googleurl @@ -12,9 +12,9 @@ env.Replace( CPPPATH = [ '$GURL_DIR', '$GURL_DIR/..', -# '#/..', '$ICU38_DIR/public/common', '$ICU38_DIR/public/i18n', + '$VC80_CPPPATH', ], ) diff --git a/gears/SConscript.installers b/gears/SConscript.installers index bf73301..532d941 100644 --- a/gears/SConscript.installers +++ b/gears/SConscript.installers @@ -171,12 +171,15 @@ def FirefoxInstaller(env): ('chrome/chromeFiles/locale', ['$FF3_OUTDIR/genfiles/i18n']), ('components/', ['$FF3_OUTDIR/gears.xpt', - '$COMMON_OUTDIR/ipc_test${PROGSUFFIX}', '$OPEN_DIR/base/firefox/static_files/components/bootstrap.js']), ('components/$FF2_MODULE', ['$FF2_OUTDIR/$MODULE']), ('components/$MODULE', ['$FF3_OUTDIR/$MODULE']), ] + if env['USING_CCTESTS']: + copysrcs += [ + ('components/', ['$COMMON_OUTDIR/ipc_test${PROGSUFFIX}']), + ] if env['OS'] != 'win32': # TODO(playmobil): Inspector should be located in extensions dir on win32. copysrcs += [ @@ -184,7 +187,12 @@ def FirefoxInstaller(env): ('resources/inspector/common/', ['$OPEN_DIR/sdk/gears_init.js', '$OPEN_DIR/sdk/samples/sample.js']), ] - # TODO: notifier, ipc_test, pdb, os x + if env['MODE'] == 'dbg' and env['OS'] in ['win32', 'wince']: + copysrcs += [ + ('components/gears_ff2.pdb', ['$FF2_OUTDIR/gears.pdb']), + ('components/gears.pdb', ['$FF3_OUTDIR/gears.pdb']), + ] + # TODO: notifier, os x srcs = [] actions = [Delete('${TARGET.base}')] diff --git a/gears/SConscript.libgd b/gears/SConscript.libgd index 9deed8f..a857721 100644 --- a/gears/SConscript.libgd +++ b/gears/SConscript.libgd @@ -16,6 +16,7 @@ env.Replace( '$THIRD_PARTY_DIR/libjpeg', '$THIRD_PARTY_DIR/libpng', '$THIRD_PARTY_DIR/zlib', + '$VC80_CPPPATH', ], ) diff --git a/gears/SConscript.libjpeg b/gears/SConscript.libjpeg index ef7c6c7..c6c7da6 100644 --- a/gears/SConscript.libjpeg +++ b/gears/SConscript.libjpeg @@ -14,6 +14,7 @@ env.Replace( LIBJPEG_DIR = '$THIRD_PARTY_DIR/libjpeg', CPPPATH = [ '$LIBJPEG_DIR', + '$VC80_CPPPATH', ], ) diff --git a/gears/SConscript.libpng b/gears/SConscript.libpng index d3d81ae..2103d92 100644 --- a/gears/SConscript.libpng +++ b/gears/SConscript.libpng @@ -14,6 +14,7 @@ env.Replace( CPPPATH = [ '$LIBPNG_DIR', '$THIRD_PARTY_DIR/zlib', + '$VC80_CPPPATH', ], ) diff --git a/gears/SConscript.portaudio b/gears/SConscript.portaudio index 46506b7..888ef1d 100644 --- a/gears/SConscript.portaudio +++ b/gears/SConscript.portaudio @@ -12,6 +12,7 @@ env.Replace( CPPPATH = [ '$PA_DIR/include', '$PA_DIR/src/common', + '$VC80_CPPPATH', ], ) @@ -22,7 +23,7 @@ env.Append( ], ) -if env['OS'] == 'win32': +if env['OS'] in ['win32', 'wince']: env.Append( CPPPATH = [ '$PA_DIR/src/os/win', @@ -64,7 +65,7 @@ input_files = [ ] # Platform-specific inputs -if env['OS'] == 'win32': +if env['OS'] in ['win32', 'wince']: input_files += [ '$PA_DIR/src/hostapi/wmme/pa_win_wmme.c', '$PA_DIR/src/os/win/pa_win_hostapis.c', diff --git a/gears/SConscript.sqlite b/gears/SConscript.sqlite index 1a36a29..9fb9c3f 100644 --- a/gears/SConscript.sqlite +++ b/gears/SConscript.sqlite @@ -18,6 +18,7 @@ env.Replace( '$SQLITE_DIR/src', '$SQLITE_DIR/preprocessed', + '$VC80_CPPPATH', ], ) @@ -48,7 +49,7 @@ env.Append( ], ) -if env['OS'] == 'win32': +if env['OS'] in ['win32', 'wince']: env.Append( CPPFLAGS = [ # from Chrome @@ -61,6 +62,7 @@ if env['OS'] == 'win32': '/wd4146', ], ) + env.Append(CPPFLAGS = ['/wd4146']) elif env['OS'] == 'linux': env.Append( CPPFLAGS = [ diff --git a/gears/SConscript.zlib b/gears/SConscript.zlib index 4049073..91bc727 100644 --- a/gears/SConscript.zlib +++ b/gears/SConscript.zlib @@ -13,6 +13,7 @@ env.Replace( ZLIB_DIR = '$THIRD_PARTY_DIR/zlib', CPPPATH = [ '$ZLIB_DIR', + '$VC80_CPPPATH', ], ) |