Changeset 795ff98 in mainline
- Timestamp:
- 2005-12-06T19:30:53Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d43d2f7
- Parents:
- 3bb9c99
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel.config
r3bb9c99 r795ff98 16 16 17 17 # Deadlock detection support for spinlocks 18 ! CONFIG_DEBUG_SPINLOCK (y/n)18 ! [CONFIG_DEBUG=y] CONFIG_DEBUG_SPINLOCK (y/n) 19 19 20 20 ## Run-time configuration directives … … 32 32 @ "synch/semaphore1" Semaphore test 1 33 33 @ "synch/semaphore2" Sempahore test 2 34 @ "fpu/fpu1" Intel fpu test 135 @ "fpu/sse1" Intel Sse test 136 @ "fpu/mips1" Mips FPU test 134 @ [ARCH=ia32|ARCH=amd64] "fpu/fpu1" Intel fpu test 1 35 @ [ARCH=ia32|ARCH=amd64] "fpu/sse1" Intel Sse test 1 36 @ [ARCH=mips] "fpu/mips1" Mips FPU test 1 37 37 @ "print/print1" Printf test 1 38 38 @ "thread/trhead1" Thread test 1 -
tools/build
r3bb9c99 r795ff98 61 61 fi 62 62 63 tools/config.py default63 tools/config.py $ARCH default 64 64 make all "ARCH=$ARCH" "TAG=$TAG" $ARGS -
tools/config.py
r3bb9c99 r795ff98 176 176 return data 177 177 178 def read_defaults(fname): 179 defaults = {} 178 def read_defaults(fname,defaults): 180 179 f = file(fname,'r') 181 180 for line in f: 182 res = re.match(r'^( [^#]\w*)\s*=\s*(.*?)\s*$', line)181 res = re.match(r'^(?:#!# )?([^#]\w*)\s*=\s*(.*?)\s*$', line) 183 182 if res: 184 183 defaults[res.group(1)] = res.group(2) 185 184 f.close() 186 return defaults 185 186 def check_condition(text, defaults): 187 result = False 188 conds = text.split('|') 189 for cond in conds: 190 condname,condval = cond.split('=') 191 if not defaults.has_key(condname): 192 raise RuntimeError("Condition var %s does not exist: %s" % \ 193 (condname,line)) 194 # None means wildcard 195 if defaults[condname] is None: 196 return True 197 if condval == defaults[condname]: 198 return True 199 return False 187 200 188 201 def parse_config(input, output, dlg, defaults={}): … … 199 212 for line in f: 200 213 if line.startswith('!'): 201 res = re.search(r'!\s*( [^\s]+)\s*\((.*)\)\s*$', line)214 res = re.search(r'!\s*(?:\[(.*?)\])?\s*([^\s]+)\s*\((.*)\)\s*$', line) 202 215 if not res: 203 216 raise RuntimeError("Weird line: %s" % line) 204 varname = res.group( 1)205 vartype = res.group( 2)217 varname = res.group(2) 218 vartype = res.group(3) 206 219 207 220 default = defaults.get(varname,None) 221 222 if res.group(1): 223 if not check_condition(res.group(1), defaults): 224 if default is not None: 225 outf.write('#!# %s = %s\n' % (varname, default)) 226 continue 208 227 209 228 if vartype == 'y/n': … … 222 241 raise RuntimeError("Bad method: %s" % vartype) 223 242 outf.write('%s = %s\n' % (varname, result)) 243 # Remeber the selected value 244 defaults[varname] = result 224 245 # Clear cumulated values 225 246 comment = '' … … 229 250 230 251 if line.startswith('@'): 231 res = re.match(r'@\s* "(.*?)"\s*(.*)$', line)252 res = re.match(r'@\s*(?:\[(.*?)\])?\s*"(.*?)"\s*(.*)$', line) 232 253 if not res: 233 254 raise RuntimeError("Bad line: %s" % line) 234 choices.append((res.group(1), res.group(2))) 255 if res.group(1): 256 if not check_condition(res.group(1),defaults): 257 continue 258 choices.append((res.group(2), res.group(3))) 235 259 continue 236 260 … … 245 269 246 270 def main(): 247 defaults = { }271 defaults = {'ARCH':None} 248 272 try: 249 273 dlg = Dialog() … … 253 277 # Default run will update the configuration file 254 278 # with newest options 255 if len(sys.argv) == 2 and sys.argv[1]=='default': 279 if len(sys.argv) >= 2: 280 defaults['ARCH'] = sys.argv[1] 281 if len(sys.argv) == 3 and sys.argv[2]=='default': 256 282 dlg = DefaultDialog(dlg) 257 283 258 284 if os.path.exists(OUTPUT): 259 defaults = read_defaults(OUTPUT)285 read_defaults(OUTPUT, defaults) 260 286 261 287 parse_config(INPUT, TMPOUTPUT, dlg, defaults)
Note:
See TracChangeset
for help on using the changeset viewer.