mirror of
https://github.com/drasko/codezero.git
synced 2026-01-14 11:53:15 +01:00
Generalize the configuration processing so that the top-level SConstruct only processes the ARCH symbol and prepares the PLATFORM and SUBARCH entries so as to write the config.h. Everything is now entered in the environment so the SConscript files can be responsible fo rthe processing.
This commit is contained in:
11
SConstruct
11
SConstruct
@@ -100,11 +100,16 @@ else :
|
||||
for key, value in configData.items():
|
||||
if value:
|
||||
items = key.split('_')
|
||||
if items[0] == 'ARCH': continue
|
||||
if items[0] == configuration.env['ARCH'].upper():
|
||||
configuration.env[items[1]] = items[2].lower()
|
||||
elif items[0] == 'DRIVER':
|
||||
# Add data to the environment about which driver paths to include in the build.
|
||||
configuration.env.Append(driverList = [items[1].lower() + '/' + items[2].lower()])
|
||||
else:
|
||||
path = items[1].lower() + '/' + items[2].lower()
|
||||
try:
|
||||
configuration.env[items[0]]
|
||||
except KeyError:
|
||||
configuration.env[items[0]] = []
|
||||
configuration.env[items[0]].append(path)
|
||||
configuration.Define('__ARCH__', configuration.env['ARCH'])
|
||||
configuration.Define('__PLATFORM__', configuration.env['PLATFORM'])
|
||||
configuration.Define('__SUBARCH__', configuration.env['SUBARCH'])
|
||||
|
||||
@@ -30,12 +30,12 @@ sources = \
|
||||
Glob('glue/' + environment['ARCH'] + '/*.[cS]') + \
|
||||
Glob('platform/' + environment['PLATFORM'] + '/*.[cS]')
|
||||
|
||||
for item in environment['driverList'] :
|
||||
for item in environment['DRIVER'] :
|
||||
path = 'drivers/' + item
|
||||
if not os.path.isdir(path):
|
||||
feature , device = item.split ( '/' )
|
||||
raise ValueError, 'Driver ' + device + ' for ' + feature + ' not available.'
|
||||
sources += Glob('drivers/' + item + '/*.[cS]')
|
||||
sources += Glob(path + '/*.[cS]')
|
||||
|
||||
objects = environment.Object(sources)
|
||||
Depends(objects, environment['configFiles'])
|
||||
|
||||
Reference in New Issue
Block a user