From 03205855cc301875f9949e3a1c7c3dbbde437454 Mon Sep 17 00:00:00 2001 From: Russel Winder Date: Fri, 28 Aug 2009 10:39:19 +0100 Subject: [PATCH] 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. --- SConstruct | 11 ++++++++--- src/SConscript | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index 63e7928..df74c0d 100644 --- a/SConstruct +++ b/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']) diff --git a/src/SConscript b/src/SConscript index 4fd93dd..dd29e13 100644 --- a/src/SConscript +++ b/src/SConscript @@ -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'])