SConstruct (11979:2ed253d495b6) SConstruct (11982:a17ad156c01e)
1# -*- mode:python -*-
2
3# Copyright (c) 2013, 2015, 2016 ARM Limited
4# All rights reserved.
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating

--- 674 unchanged lines hidden (view full) ---

683 # we consistently violate
684 main.Append(CCFLAGS=['-Wall', '-Wundef', '-Wextra',
685 '-Wno-sign-compare', '-Wno-unused-parameter'])
686 # We always compile using C++11
687 main.Append(CXXFLAGS=['-std=c++11'])
688 if sys.platform.startswith('freebsd'):
689 main.Append(CCFLAGS=['-I/usr/local/include'])
690 main.Append(CXXFLAGS=['-I/usr/local/include'])
1# -*- mode:python -*-
2
3# Copyright (c) 2013, 2015, 2016 ARM Limited
4# All rights reserved.
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating

--- 674 unchanged lines hidden (view full) ---

683 # we consistently violate
684 main.Append(CCFLAGS=['-Wall', '-Wundef', '-Wextra',
685 '-Wno-sign-compare', '-Wno-unused-parameter'])
686 # We always compile using C++11
687 main.Append(CXXFLAGS=['-std=c++11'])
688 if sys.platform.startswith('freebsd'):
689 main.Append(CCFLAGS=['-I/usr/local/include'])
690 main.Append(CXXFLAGS=['-I/usr/local/include'])
691
692 main['FILTER_PSHLINKFLAGS'] = lambda x: str(x).replace(' -shared', '')
693 main['PSHLINKFLAGS'] = main.subst('${FILTER_PSHLINKFLAGS(SHLINKFLAGS)}')
694 main['PLINKFLAGS'] = main.subst('${LINKFLAGS}')
695 shared_partial_flags = ['-Wl,--relocatable', '-nostdlib']
696 main.Append(PSHLINKFLAGS=shared_partial_flags)
697 main.Append(PLINKFLAGS=shared_partial_flags)
691else:
692 print termcap.Yellow + termcap.Bold + 'Error' + termcap.Normal,
693 print "Don't know what compiler options to use for your compiler."
694 print termcap.Yellow + ' compiler:' + termcap.Normal, main['CXX']
695 print termcap.Yellow + ' version:' + termcap.Normal,
696 if not CXX_version:
697 print termcap.Yellow + termcap.Bold + "COMMAND NOT FOUND!" +\
698 termcap.Normal

--- 636 unchanged lines hidden (view full) ---

1335
1336 # Sources are variable name & value (packaged in SCons Value nodes)
1337 return ([target], [Value(variable), Value(val)])
1338
1339config_builder = Builder(emitter = config_emitter, action = config_action)
1340
1341main.Append(BUILDERS = { 'ConfigFile' : config_builder })
1342
698else:
699 print termcap.Yellow + termcap.Bold + 'Error' + termcap.Normal,
700 print "Don't know what compiler options to use for your compiler."
701 print termcap.Yellow + ' compiler:' + termcap.Normal, main['CXX']
702 print termcap.Yellow + ' version:' + termcap.Normal,
703 if not CXX_version:
704 print termcap.Yellow + termcap.Bold + "COMMAND NOT FOUND!" +\
705 termcap.Normal

--- 636 unchanged lines hidden (view full) ---

1342
1343 # Sources are variable name & value (packaged in SCons Value nodes)
1344 return ([target], [Value(variable), Value(val)])
1345
1346config_builder = Builder(emitter = config_emitter, action = config_action)
1347
1348main.Append(BUILDERS = { 'ConfigFile' : config_builder })
1349
1350###################################################
1351#
1352# Builders for static and shared partially linked object files.
1353#
1354###################################################
1355
1356partial_static_builder = Builder(action=SCons.Defaults.LinkAction,
1357 src_suffix='$OBJSUFFIX',
1358 src_builder=['StaticObject', 'Object'],
1359 LINKFLAGS='$PLINKFLAGS',
1360 LIBS='')
1361
1362def partial_shared_emitter(target, source, env):
1363 for tgt in target:
1364 tgt.attributes.shared = 1
1365 return (target, source)
1366partial_shared_builder = Builder(action=SCons.Defaults.ShLinkAction,
1367 emitter=partial_shared_emitter,
1368 src_suffix='$SHOBJSUFFIX',
1369 src_builder='SharedObject',
1370 SHLINKFLAGS='$PSHLINKFLAGS',
1371 LIBS='')
1372
1373main.Append(BUILDERS = { 'PartialShared' : partial_shared_builder,
1374 'PartialStatic' : partial_static_builder })
1375
1343# builds in ext are shared across all configs in the build root.
1344ext_dir = abspath(joinpath(str(main.root), 'ext'))
1345for root, dirs, files in os.walk(ext_dir):
1346 if 'SConscript' in files:
1347 build_dir = os.path.relpath(root, ext_dir)
1348 main.SConscript(joinpath(root, 'SConscript'),
1349 variant_dir=joinpath(build_root, build_dir))
1350

--- 232 unchanged lines hidden ---
1376# builds in ext are shared across all configs in the build root.
1377ext_dir = abspath(joinpath(str(main.root), 'ext'))
1378for root, dirs, files in os.walk(ext_dir):
1379 if 'SConscript' in files:
1380 build_dir = os.path.relpath(root, ext_dir)
1381 main.SConscript(joinpath(root, 'SConscript'),
1382 variant_dir=joinpath(build_root, build_dir))
1383

--- 232 unchanged lines hidden ---