def configure_options(self, uplid): self.uplid = uplid self.option_mask = OptionMask(self.uplid, self.ufid) default_opts_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'default.opts') raw_options = RawOptions() raw_options.read(default_opts_path) # At BB, default_internal.opts contains some variables that is required for building bde-bb. bde_root = os.environ.get('BDE_ROOT') if bde_root: default_internal_opts_path = os.path.join(bde_root, 'etc', 'default_internal.opts') raw_options.read(default_internal_opts_path) debug_opt_keys = self.ctx.options.debug_opt_keys if debug_opt_keys: debug_opt_keys = debug_opt_keys.split(',') self.default_opts = Options(self.option_mask) self.default_opts.read(raw_options.options, self.ctx, debug_opt_keys=debug_opt_keys) for g in self.group_dep: self.ctx.start_msg("Evaluating options for '%s'" % g) status_msg = self._evaluate_group_options(g) self.ctx.end_msg(status_msg) tmp_opts = copy.deepcopy(self.default_opts) tmp_opts.evaluate() env_variables = ('SET_TMPDIR', 'XLC_LIBPATH') setenv_re = re.compile(r'^([^=]+)=(.*)$') for e in env_variables: if e in tmp_opts.options: m = setenv_re.match(tmp_opts.options[e]) self.custom_envs[m.group(1)] = m.group(2)
def _get_raw_options(self, node, metadir, metatype): metafile = node.make_node([metadir, node.name + '.' + metatype]) raw_options = RawOptions() raw_options.read(metafile.abspath()) return raw_options.options