def update(self, fname): if os.path.exists(fname) and not GetOption("silent") and not env.GetOption("help"): print "Restoring previous command-line options from '%s'" % fname vars = Variables(fname, self.opts) vars.AddVariables(*self.variables) vars.Update(env) vars.Save(fname, env)
def update(self, fname='options.cache'): if os.path.exists(fname) and not GetOption("silent") and\ not GetOption("help"): print """Note: Restoring previous command-line options from '%s'. Please delete this file when trying to start from scratch.""" % fname vars = Variables(fname, self.opts) vars.AddVariables(*self.variables) vars.Update(self.env) vars.Save(fname, self.env)
def AddVariables(self): defvars = SVariables(self.def_env_file, args=ARGUMENTS) defvars.AddVariables( BoolVariable('verbose', 'Increase verbosity', 0), EnumVariable('debug_mode', 'debug output and symbols', 'no', allowed_values=('no', 'libs', 'tests', 'all'), map={}, ignorecase=0), # case sensitive # test abi makes tests to call out for given library call EnumVariable('libabi', 'Test ABI for library function calling', 'aocl', allowed_values=('aocl', 'glibc', 'libm', 'acml', 'amdlibm'), map={}, ignorecase=2), # lowercase always EnumVariable('developer', 'A developer friendly mode', 0, allowed_values=('0', '1', '2', '3', '4'), map={ '0': 0, '1': 1, '2': 2, '3': 3, '4': 4 }), EnumVariable('build', 'Build type shortcut', 'release', allowed_values=('release', 'developer', 'debug'), ignorecase=2), EnumVariable('compiler', "Select compiler type", 'gcc', allowed_values=('gcc', 'aocc', 'llvm', 'icc'), ignorecase=2), PathVariable('toolchain_base', "Use this as toolchain prefix", '/usr/bin')) self.defvars = defvars