SConscript (6669:2a69e47a335c) SConscript (6727:c77e698abe9c)
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 118 unchanged lines hidden (view full) ---

127 path = []
128
129 modpath = path[:]
130 if modname != '__init__':
131 modpath += [ modname ]
132 modpath = '.'.join(modpath)
133
134 arcpath = path + [ self.basename ]
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 118 unchanged lines hidden (view full) ---

127 path = []
128
129 modpath = path[:]
130 if modname != '__init__':
131 modpath += [ modname ]
132 modpath = '.'.join(modpath)
133
134 arcpath = path + [ self.basename ]
135 debugname = self.snode.abspath
136 if not exists(debugname):
137 debugname = self.tnode.abspath
135 abspath = self.snode.abspath
136 if not exists(abspath):
137 abspath = self.tnode.abspath
138
139 self.package = package
140 self.modname = modname
141 self.modpath = modpath
142 self.arcname = joinpath(*arcpath)
138
139 self.package = package
140 self.modname = modname
141 self.modpath = modpath
142 self.arcname = joinpath(*arcpath)
143 self.debugname = debugname
143 self.abspath = abspath
144 self.compiled = File(self.filename + 'c')
145 self.assembly = File(self.filename + '.s')
146 self.symname = "PyEMB_" + PySource.invalid_sym_char.sub('_', modpath)
147
148 PySource.modules[modpath] = self
149 PySource.tnodes[self.tnode] = self
150 PySource.symnames[self.symname] = self
151

--- 182 unchanged lines hidden (view full) ---

334
335 if fullname == 'm5.defines':
336 mod.__dict__['buildEnv'] = m5.util.SmartDict(build_env)
337 return mod
338
339 source = self.modules[fullname]
340 if source.modname == '__init__':
341 mod.__path__ = source.modpath
144 self.compiled = File(self.filename + 'c')
145 self.assembly = File(self.filename + '.s')
146 self.symname = "PyEMB_" + PySource.invalid_sym_char.sub('_', modpath)
147
148 PySource.modules[modpath] = self
149 PySource.tnodes[self.tnode] = self
150 PySource.symnames[self.symname] = self
151

--- 182 unchanged lines hidden (view full) ---

334
335 if fullname == 'm5.defines':
336 mod.__dict__['buildEnv'] = m5.util.SmartDict(build_env)
337 return mod
338
339 source = self.modules[fullname]
340 if source.modname == '__init__':
341 mod.__path__ = source.modpath
342 mod.__file__ = source.snode.abspath
342 mod.__file__ = source.abspath
343
343
344 exec file(source.snode.abspath, 'r') in mod.__dict__
344 exec file(source.abspath, 'r') in mod.__dict__
345
346 return mod
347
348import m5.SimObject
349import m5.params
350
351m5.SimObject.clear()
352m5.params.clear()

--- 534 unchanged lines hidden (view full) ---

887 '''Action function to compile a .py into a code object, marshal
888 it, compress it, and stick it into an asm file so the code appears
889 as just bytes with a label in the data section'''
890
891 src = file(str(source[0]), 'r').read()
892 dst = file(str(target[0]), 'w')
893
894 pysource = PySource.tnodes[source[0]]
345
346 return mod
347
348import m5.SimObject
349import m5.params
350
351m5.SimObject.clear()
352m5.params.clear()

--- 534 unchanged lines hidden (view full) ---

887 '''Action function to compile a .py into a code object, marshal
888 it, compress it, and stick it into an asm file so the code appears
889 as just bytes with a label in the data section'''
890
891 src = file(str(source[0]), 'r').read()
892 dst = file(str(target[0]), 'w')
893
894 pysource = PySource.tnodes[source[0]]
895 compiled = compile(src, pysource.debugname, 'exec')
895 compiled = compile(src, pysource.abspath, 'exec')
896 marshalled = marshal.dumps(compiled)
897 compressed = zlib.compress(marshalled)
898 data = compressed
899
900 # Some C/C++ compilers prepend an underscore to global symbol
901 # names, so if they're going to do that, we need to prepend that
902 # leading underscore to globals in the assembly file.
903 if env['LEADING_UNDERSCORE']:

--- 199 unchanged lines hidden ---
896 marshalled = marshal.dumps(compiled)
897 compressed = zlib.compress(marshalled)
898 data = compressed
899
900 # Some C/C++ compilers prepend an underscore to global symbol
901 # names, so if they're going to do that, we need to prepend that
902 # leading underscore to globals in the assembly file.
903 if env['LEADING_UNDERSCORE']:

--- 199 unchanged lines hidden ---