summaryrefslogtreecommitdiffstats
path: root/gears
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-08 21:45:23 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-08 21:45:23 +0000
commit4f3c5bbccc29e8a69a67875cf98a47acb9374742 (patch)
treea810ce4371061ceae819a3c4df3bd15bb737c9f0 /gears
parentefae09b341433a2c14bc5f64071b5ba9a78b42e8 (diff)
downloadchromium_src-4f3c5bbccc29e8a69a67875cf98a47acb9374742.zip
chromium_src-4f3c5bbccc29e8a69a67875cf98a47acb9374742.tar.gz
chromium_src-4f3c5bbccc29e8a69a67875cf98a47acb9374742.tar.bz2
Separate SHLINKFLAGS from LINKFLAGS. The former is used when linking shared
libraries, the latter for exes. Review URL: http://codereview.chromium.org/13256 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6542 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gears')
-rw-r--r--gears/SConscript43
-rw-r--r--gears/SConscript.browser12
-rwxr-xr-xgears/SConscript.inputs6
3 files changed, 36 insertions, 25 deletions
diff --git a/gears/SConscript b/gears/SConscript
index 8623c24..acf0723 100644
--- a/gears/SConscript
+++ b/gears/SConscript
@@ -214,9 +214,9 @@ if env['OS'] in ['win32', 'wince']:
env['ENV']['LIB'] = os.environ['LIB']
env['ENV']['INCLUDE'] = os.environ['INCLUDE']
- # HACK to disable manifest creation, since it breaks all the time.
- env['LINKCOM'] = env['LINKCOM'][0]
- env['SHLINKCOM'] = env['SHLINKCOM'][0]
+ mtcom = 'echo Manifest creation disabled, since it breaks a lot.'
+ env['MANIFEST_COM'] = mtcom
+ env['SHMANIFEST_COM'] = mtcom
# Building M4 files
env.Tool('m4')
@@ -320,8 +320,9 @@ env.Replace(
FRAMEWORKS = [],
LIBS = [],
LIBPATH = ['$COMPONENT_LIBRARY_DIR'],
- LINKFLAGS = [],
- SHLINKFLAGS = [],
+ COMMON_LINKFLAGS = [], # for both executables and shared libs
+ LINKFLAGS = ['$COMMON_LINKFLAGS'], # for executables
+ SHLINKFLAGS = ['$COMMON_LINKFLAGS'], # for shared libs
COMPONENT_LIBRARY_DIR = '$COMMON_OUTDIR/lib',
)
@@ -446,11 +447,14 @@ if env['OS'] in ['win32', 'wince']:
'/NOLOGO',
],
# Shared lib and exe flags.
- LINKFLAGS = [
+ COMMON_LINKFLAGS = [
'/NOLOGO',
'/DEBUG',
'/RELEASE',
'/PDB:${TARGET.base}.pdb',
+ ],
+ SHLINKFLAGS = [
+ '/DLL',
# 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.
@@ -505,13 +509,14 @@ if env['OS'] in ['win32', 'wince']:
ARFLAGS = [
'/MACHINE:X86',
],
- LINKFLAGS = [
+ COMMON_LINKFLAGS = [
'/MACHINE:X86',
'/NODEFAULTLIB:msvcrt',
# Flags for security hardening (only available for win32, not wince).
'/DYNAMICBASE',
'/SAFESEH',
-
+ ],
+ SHLINKFLAGS = [
# We only use /SUBSYSTEM on DLLs. For EXEs we omit the flag, and
# the presence of main() or WinMain() determines the subsystem.
'/SUBSYSTEM:WINDOWS',
@@ -550,10 +555,12 @@ if env['OS'] in ['win32', 'wince']:
ARFLAGS = [
'/MACHINE:THUMB',
],
- LINKFLAGS = [
+ COMMON_LINKFLAGS = [
'/MACHINE:THUMB',
'/NODEFAULTLIB:secchk.lib',
'/NODEFAULTLIB:oldnames.lib',
+ ],
+ SHLINKFLAGS = [
'/SUBSYSTEM:WINDOWSCE,5.01',
],
VC80_CPPPATH = [
@@ -581,7 +588,7 @@ if env['OS'] in ['win32', 'wince']:
'/MT',
'/O2',
],
- LINKFLAGS = [
+ COMMON_LINKFLAGS = [
'/INCREMENTAL:NO',
'/OPT:REF',
'/OPT:ICF',
@@ -623,12 +630,12 @@ elif env['OS'] == 'linux':
'-funsigned-char',
'-Wno-char-subscripts',
],
- LINKFLAGS = [
+ COMMON_LINKFLAGS = [
'-fPIC',
'-Bsymbolic',
'-pthread',
-
-# TODO: Following are DLLFLAGS. Figure something out for non-lib targets.
+ ],
+ SHLINKFLAGS = [
'-shared',
'-Wl,--version-script',
'-Wl,$OPEN_DIR/tools/xpcom-ld-script',
@@ -708,7 +715,7 @@ elif env['OS'] == 'osx':
('-include', env.File('#/$OPEN_DIR/base/safari/prefix_header.h').abspath),
('-isysroot', '$OSX_SDK_ROOT')
],
- LINKFLAGS = [
+ COMMON_LINKFLAGS = [
'-mmacosx-version-min=10.4',
'-fPIC',
'-Bsymbolic',
@@ -716,6 +723,8 @@ elif env['OS'] == 'osx':
('-arch', 'i386'),
('-isysroot', '$OSX_SDK_ROOT'),
'-Wl,-dead_strip',
+ ],
+ SHLINKFLAGS = [
'-bundle', # DLLFLAGS
],
FRAMEWORKS = [
@@ -757,12 +766,6 @@ elif env['OS'] == 'osx':
],
)
-# TODO(mpcomplete): fix this and properly separate our DLL flags from EXE
-# flags.
-env.Append(SHLINKFLAGS = ['$LINKFLAGS'])
-if env['OS'] in ['wince', 'win32']:
- env.Append(SHLINKFLAGS = ['/DLL'])
-
# Custom builder to work around a scons and/or hammer bug. ComponentLibrary
# tries to install the library to COMPONENT_LIBRARY_DIR, but since we overrode
# that value, scons gets confused. I'm not sure who is at fault here.
diff --git a/gears/SConscript.browser b/gears/SConscript.browser
index 176d8c7..f622603 100644
--- a/gears/SConscript.browser
+++ b/gears/SConscript.browser
@@ -313,7 +313,7 @@ elif env['BROWSER'] == 'NPAPI':
'delayimp.lib',
'comdlg32.lib',
],
- LINKFLAGS = [
+ SHLINKFLAGS = [
'/DELAYLOAD:"comdlg32.dll"',
],
)
@@ -430,7 +430,7 @@ if env['BROWSER'] in ['FF2', 'FF3']:
outputs['MODULE_TYPELIB'] = env.XptLink('gears.xpt', xptsrcs)
# genfiles/%.res: %.rc
-env.Append(BROWSER_LINKSRCS = [
+env.Append(BROWSER_SHLINKSRCS = [
[env_res.RES(
*PatternRule('$GENFILES_DIR/${SOURCE.filebase}.res', src))
for src in GetInputs('$BROWSER_RESSRCS')]
@@ -484,7 +484,7 @@ if env['BROWSER'] == 'SF':
module = env.ChromeSharedLibrary('gears-$OS-$ARCH-$MODE-${BROWSER}',
env.SharedObject(GetInputs('$BROWSER_CPPSRCS')) +
- GetInputs('$BROWSER_LINKSRCS'))
+ GetInputs('$BROWSER_LINKSRCS $BROWSER_SHLINKSRCS'))
outputs['MODULE'] = env.InstallAs('${SHLIBPREFIX}gears${SHLIBSUFFIX}', module)
if env['OS'] in ['win32', 'wince'] and env['MODE'] == 'dbg':
outputs['MODULE_PDB'] = env.InstallAs('gears.pdb',
@@ -492,6 +492,12 @@ if env['OS'] in ['win32', 'wince'] and env['MODE'] == 'dbg':
env.Alias('gears', outputs['MODULE_PDB'])
env.Alias('gears', outputs['MODULE'])
+if env['OS'] == 'win32' and env['BROWSER'] == 'NPAPI':
+ lib = env.ChromeStaticLibrary('gears-static',
+ env.SharedObject(GetInputs('$BROWSER_CPPSRCS')) +
+ GetInputs('$BROWSER_LINKSRCS'))
+ env.Alias('gears-static', lib)
+
if env['OS'] == 'wince':
env.Append(WINCE_SETUP_LINKSRCS = [
[env_res.RES(*PatternRule('$GENFILES_DIR/${SOURCE.filebase}.res', src))
diff --git a/gears/SConscript.inputs b/gears/SConscript.inputs
index 590cb38..dac9884 100755
--- a/gears/SConscript.inputs
+++ b/gears/SConscript.inputs
@@ -5,7 +5,7 @@
Import('env')
types = ['CPPSRCS', 'M4SRCS', 'HTML_M4SRCS', 'I18N_M4SRCS', 'STABSRCS',
- 'IDLSRCS', 'RESSRCS', 'LINKSRCS']
+ 'IDLSRCS', 'RESSRCS', 'LINKSRCS', 'SHLINKSRCS']
# Set up aliases for shared inputs.
for type in types:
@@ -1065,9 +1065,11 @@ if env['OS'] == 'win32':
'$THIRD_PARTY_DIR/v8/bin-${MODE}/libv8core.lib',
'$THIRD_PARTY_DIR/v8/bin-${MODE}/no_snapshotv8.lib',
'$THIRD_PARTY_DIR/v8/bin-${MODE}/libjscre.lib',
+ ])
+ env.Append(NPAPI_SHLINKSRCS = [
'$OPEN_DIR/base/chrome/module.def',
])
- env.Append(IE_LINKSRCS = [
+ env.Append(IE_SHLINKSRCS = [
'$OPEN_DIR/tools/mscom.def',
])