def __init__(self, mainEnv, configuration_name = 'default'): """ Applies the definitions in configuration_name to generate a correct environment (specificall the set of compilation flags() for the TinySTM library. That environment is returned """ mnemosyne.Environment.__init__(self, mainEnv, configuration_name) # Apply the configuration variables specific to MTM. directives = helper.Directives(configuration_name, 'logalloc', ARGUMENTS, self._boolean_directive_vars, self._enumerable_directive_vars, self._numerical_directive_vars) # Bring in appropriate environment variables and preprocessor definitions. # Note: the inclusion of the OS environment reportedly threatens to make # this build more brittle, but otherwise I have to write an SCons builder # for libatomic_ops as well. Instead, I let the system paths make it # visible and assume that the user has installed libatomic_ops themselves. if ('INCLUDE' in os.environ): osinclude = string.split(os.environ['INCLUDE'], ':') else: osinclude = [] self.Append( CPPDEFINES = directives.getPreprocessorDefinitions(), CPPPATH = ['include'] + osinclude, ENV = os.environ)
def __init__(self, mainEnv, configuration_name='default'): """ Applies the definitions in configuration_name to generate a correct environment (specificall the set of compilation flags() for the TinySTM library. That environment is returned """ SCons.Environment.Environment.__init__(self) # Generate build directives mnemosyneDirectives = helper.Directives( configuration_name, 'mnemosyne', ARGUMENTS, self._mnemosyne_boolean_directive_vars, self._mnemosyne_enumerable_directive_vars, self._mnemosyne_numerical_directive_vars) configuration_variables = Environment._GetConfigurationVariables(self) configuration_variables.Update(self) self.Append( CPPDEFINES=mnemosyneDirectives.getPreprocessorDefinitions()) # Disable some remark messages when using Intel CC # We don't use ICC anymore but GCC only. if mainEnv is not None and mainEnv['CC'] == 'icc': DISABLE_WARNINGS = [ '-wd869', #remark #869 : parameter "XYZ" was never referenced ] self.Append(CCFLAGS=string.join(DISABLE_WARNINGS, ' ')) # Inherit some command line options from the main environment if mainEnv is not None: self['BUILD_LINKAGE'] = mainEnv['BUILD_LINKAGE'] self['BUILD_DEBUG'] = mainEnv['BUILD_DEBUG'] self['BUILD_STATS'] = mainEnv['BUILD_STATS'] self['MY_ROOT_DIR'] = mainEnv['MY_ROOT_DIR'] self['MY_LINKER_DIR'] = mainEnv['MY_LINKER_DIR'] self['CC'] = mainEnv['CC'] self['CXX'] = mainEnv['CXX'] if mainEnv is not None and mainEnv['VERBOSE'] == False: self.Replace(CCCOMSTR='(COMPILE) $SOURCES', CXXCOMSTR='(COMPILE) $SOURCES', SHCXXCOMSTR='(COMPILE) $SOURCES', SHCCCOMSTR='(COMPILE) $SOURCES', ASPPCOMSTR='(ASSEMBLE) $SOURCES', ARCOMSTR='(BUILD) $TARGET', RANLIBCOMSTR='(INDEX) $TARGET', LINKCOMSTR='(LINK) $TARGET', SHLINKCOMSTR='(LINK) $TARGET')