From: tho Date: Tue, 5 Apr 2011 15:49:45 +0000 (+0000) Subject: SENFScons: external modules can now extend SConfigure and senfutil X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=f792c278aba0cc2080591d393fff2d8cdca9b95d;p=senf.git SENFScons: external modules can now extend SConfigure and senfutil git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1777 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/SConfigure b/SConfigure index a279710..906b0bc 100644 --- a/SConfigure +++ b/SConfigure @@ -1,5 +1,7 @@ # -*- python -*- +import glob + Import('env') ########################################################################### @@ -98,4 +100,16 @@ res = conf.CheckSTLCopyN(); \ res = conf.CheckValgrind() and conf.CheckValgrindWildcards(); \ conf.env.Replace(HAVE_VALGRIND = res) +########################################################################### + +# run configure scripts from external modules +Export('conf') + +sconscripts = sorted(glob.glob("senf/Ext/*/SConfigure")) +if sconscripts: + SConscript(sconscripts) + +########################################################################### + env = conf.Finish() + diff --git a/SConstruct b/SConstruct index 8f4da1c..3a60e3a 100644 --- a/SConstruct +++ b/SConstruct @@ -160,9 +160,6 @@ senfutil.parseArguments( BoolVariable('sparse_tests', 'Link tests against object files and not the senf lib', False) ) -if env['PARSEFLAGS']: - env.MergeFlags(env['PARSEFLAGS']) - # Add UNIX env vars matching IMPORT_ENV patterns into the execution environment senfutil.importProcessEnv(env) diff --git a/senf/Ext/SConscript b/senf/Ext/SConscript index 1a6d41f..b0553b5 100644 --- a/senf/Ext/SConscript +++ b/senf/Ext/SConscript @@ -10,7 +10,7 @@ sconscripts = sorted(glob.glob("*/SConscript")) if sconscripts: SENFSCons.IndexPage(env, 'Mainpage.dox', title="Extensions", text="""This folder contains additional SENF extensions which are built - into the senf libarary but are not part of senf proper.""") + into the senf library but are not part of senf proper.""") SConscript(sconscripts) diff --git a/senf/Socket/Mainpage.dox b/senf/Socket/Mainpage.dox index edc8b31..7035c9f 100644 --- a/senf/Socket/Mainpage.dox +++ b/senf/Socket/Mainpage.dox @@ -40,7 +40,7 @@ namespace senf { it's functionality \li The rest of the socket API is accessible using a classic inheritance hierarchy of \link protocol_group protocol classes \endlink - \li There is a family of auxilliary \ref addr_group to supplement the socket library + \li There is a family of auxiliary \ref addr_group to supplement the socket library \section socket_handle Socket Handles @@ -68,10 +68,10 @@ namespace senf { The protocol interface provides further protocol dependent and (possibly) polymorphic access to - further socket funcitonality. On the other hand, this type of interface is not as flexible, + further socket functionality. On the other hand, this type of interface is not as flexible, generic and fast as the policy interface. - \section socket_addr Auxilliary Addressing classes + \section socket_addr Auxiliary Addressing classes \seechapter \ref addr_group To supplement the socket library, there are a multitude of addressing classes. These come in two @@ -164,7 +164,7 @@ namespace senf { of the socket (which generic handles don't). This allows to access to the complete protocol interface. - \section over_impl Implementation of the Socket Libarary Structure + \section over_impl Implementation of the Socket Library Structure In the Implementation, the socket policy is identified by an instance of the senf::SocketPolicy template. The Socket representation is internally represented in a senf::SocketBody which is not diff --git a/site_scons/senfutil.py b/site_scons/senfutil.py index 1a2d4a1..8fa8759 100644 --- a/site_scons/senfutil.py +++ b/site_scons/senfutil.py @@ -1,4 +1,4 @@ -import os, os.path, site_tools.Yaptu, types, re, fnmatch +import os, os.path, site_tools.Yaptu, types, re, fnmatch, sys import SCons.Util from SCons.Script import * @@ -12,6 +12,19 @@ except NameError: BoolVariable = BoolOption ########################################################################### +extdir = os.path.join(senfutildir, '../senf/Ext') +sys.path.append(extdir) + +for ext in os.listdir(extdir): + if not os.path.isdir( os.path.join(extdir, ext)): continue + if ext.startswith('.'): continue + try: + setattr( sys.modules[__name__], ext, + __import__('%s.site_scons' % ext, fromlist=['senfutil']).senfutil ) + except ImportError: + pass + +########################################################################### def loadTools(env): global senfutildir @@ -27,8 +40,7 @@ def parseArguments(env, *defs): env.Help(""" Any construction environment variable may be set from the scons command line (see SConstruct file and SCons documentation for a list -of variables) usin -g +of variables) using VARNAME=value Assign new value VARNAME+=value Append value at end @@ -42,11 +54,13 @@ Special command line parameters: for k,v in ARGLIST: if not unknv.has_key(k) : continue if k.endswith('+'): - env.Append(**{k[:-1]: v}) - env.Append(ARGUMENT_VARIABLES = {k[:-1]:v}) + env.Append(**{k[:-1]: [v]}) + env.Append(ARGUMENT_VARIABLES = {k[:-1]:[v]}) else: env.Replace(**{k: v}) env.Append(ARGUMENT_VARIABLES = {k:v}) + if env['PARSEFLAGS']: + env.MergeFlags(env['PARSEFLAGS']) def importProcessEnv(env): env.Append( ENV = dict(( (k,v)