-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 *
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
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
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)
CPPDEFINES = [ '$expandLogOption' ],
CXXFLAGS = [ '-Wno-long-long', '-fno-strict-aliasing' ],
LINKFLAGS = [ '-rdynamic' ],
- LIBS = [ 'senf$LIBADDSUFFIX', 'rt', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB',
- '$BOOSTSIGNALSLIB', '$BOOSTFSLIB' ],
+ LIBS = [ 'senf$LIBADDSUFFIX', 'rt', '$BOOSTREGEXLIB',
+ '$BOOSTSIGNALSLIB', '$BOOSTFSLIB', '$BOOSTSYSTEMLIB',
+ '$BOOSTDATETIMELIB' ],
)
try:
# Set nice default options
env.Append(
- CXXFLAGS = [ '-Wall', '-Woverloaded-virtual' ],
- CXXFLAGS_final = [ '-O3' ],
+ CXXFLAGS_CLANG = [ '-Wno-unneeded-internal-declaration' ], # needed for BOOST_PARAMETER_KEYWORD
+ CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', "${profile and '-pg' or None}",
+ '${str(CXX).split("/")[-1] == "clang++" and "$CXXFLAGS_CLANG" or None}' ],
+ CXXFLAGS_final = [ '-O3', '-fno-threadsafe-statics', '-fno-stack-protector',
+ "${profile and ' ' or '-ffunction-sections'}" ],
CXXFLAGS_normal = [ '-O2', '-g' ],
CXXFLAGS_debug = [ '-O0', '-g' ],
+ LINKFLAGS = [ "${profile and '-pg' or None}" ],
+ LINKFLAGS_final = [ "${profile and ' ' or '-Wl,--gc-sections'}" ],
LINKFLAGS_normal = [ '-Wl,-S' ],
LINKFLAGS_debug = [ '-g' ],
)
- if env['profile']:
- env.Append(
- LINKFLAGS = [ '-pg' ],
- CXXFLAGS = [ '-pg' ],
- )
env.Alias('all', '#')