X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=site_scons%2Fsenfutil.py;h=b86c14ef8e9d30af7c77c7f3cc151aebb308c5ff;hb=1081c75b5564fda3eef4918bf137a76fe62fe9ae;hp=2b570d2e878cb826f1364641c710f6048a19c08f;hpb=8558757024b5e0181b62f888f665dc2dfc48639b;p=senf.git diff --git a/site_scons/senfutil.py b/site_scons/senfutil.py index 2b570d2..b86c14e 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 @@ -47,6 +59,8 @@ Special command line parameters: else: env.Replace(**{k: v}) env.Append(ARGUMENT_VARIABLES = {k:v}) + if env.get('PARSEFLAGS', None): + env.MergeFlags(env['PARSEFLAGS']) def importProcessEnv(env): env.Append( ENV = dict(( (k,v) @@ -154,7 +168,7 @@ def SetupForSENF(env, senf_path = [], flavor=None): CPPDEFINES = [ '$expandLogOption' ], CXXFLAGS = [ '-Wno-long-long', '-fno-strict-aliasing' ], LINKFLAGS = [ '-rdynamic' ], - LIBS = [ 'senf$LIBADDSUFFIX', 'rt', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB', + LIBS = [ 'senf$LIBADDSUFFIX', 'rt', '$BOOSTREGEXLIB', '$BOOSTSIGNALSLIB', '$BOOSTFSLIB' ], ) @@ -205,15 +219,17 @@ def DefaultOptions(env): env, BoolVariable('final', 'Build final (optimized) build', False), BoolVariable('debug', 'Link in debug symbols', False), + BoolVariable('profile', 'compile and link with the profiling enabled option', False), ) # Set nice default options env.Append( - CXXFLAGS = [ '-Wall', '-Woverloaded-virtual' ], + CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', "${profile and '-pg' or None}" ], CXXFLAGS_final = [ '-O3' ], CXXFLAGS_normal = [ '-O2', '-g' ], CXXFLAGS_debug = [ '-O0', '-g' ], + LINKFLAGS = [ "${profile and '-pg' or None}" ], LINKFLAGS_normal = [ '-Wl,-S' ], LINKFLAGS_debug = [ '-g' ], )