diff options
author | Nathan Binkert <nate@binkert.org> | 2010-09-12 15:41:34 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2010-09-12 15:41:34 -0700 |
commit | 2edfcbbaee87c1a28351fc0dcd81d52d0d9102a4 (patch) | |
tree | 3436d2dad1d98f200566e719add526b135ae0e08 /src/SConscript | |
parent | afafaf1dcbab1fac3e3ba2f87dd5138d3ec08588 (diff) | |
download | gem5-2edfcbbaee87c1a28351fc0dcd81d52d0d9102a4.tar.xz |
swig: make all generated files go into the m5.internal package
This is necessary because versions of swig older than 1.3.39 fail to
do the right thing and try to do relative imports for everything (even
with the package= option to %module). Instead of putting params in
the m5.internal.params package, put params in the m5.internal package
and make all param modules start with param_. Same thing for
m5.internal.enums.
Also, stop importing all generated params into m5.objects. They are
not necessary and now with everything using relative imports we wound
up with pollution of the namespace (where builtin-range got overridden).
--HG--
rename : src/python/m5/internal/enums/__init__.py => src/python/m5/internal/enums.py
rename : src/python/m5/internal/params/__init__.py => src/python/m5/internal/params.py
Diffstat (limited to 'src/SConscript')
-rw-r--r-- | src/SConscript | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/SConscript b/src/SConscript index 5aa534a80..ec3f5373b 100644 --- a/src/SConscript +++ b/src/SConscript @@ -470,7 +470,7 @@ def createSwigParam(target, source, env): param = all_params[name] code = code_formatter() - code('%module(package="m5.internal.swig") ${name}_$0', param.file_ext) + code('%module(package="m5.internal") $0_${name}', param.file_ext) param.swig_decl(code) code.write(target[0].abspath) @@ -502,7 +502,7 @@ def createEnumSwig(target, source, env): code = code_formatter() code('''\ -%module(package="m5.internal.enums") $name +%module(package="m5.internal") enum_$name %{ #include "enums/$name.hh" @@ -526,11 +526,11 @@ for name,simobj in sorted(sim_objects.iteritems()): # Generate any parameter header files needed params_i_files = [] for name,param in all_params.iteritems(): - i_file = File('params/%s_%s.i' % (name, param.file_ext)) + i_file = File('python/m5/internal/%s_%s.i' % (param.file_ext, name)) params_i_files.append(i_file) env.Command(i_file, Value(name), createSwigParam) env.Depends(i_file, depends) - SwigSource('m5.internal.swig', i_file) + SwigSource('m5.internal', i_file) # Generate all enum header files for name,enum in sorted(all_enums.iteritems()): @@ -546,10 +546,10 @@ for name,enum in sorted(all_enums.iteritems()): env.Command(hh_file, Value(name), createEnumParam) env.Depends(hh_file, depends + extra_deps) - i_file = File('enums/%s.i' % name) + i_file = File('python/m5/internal/enum_%s.i' % name) env.Command(i_file, Value(name), createEnumSwig) env.Depends(i_file, depends + extra_deps) - SwigSource('m5.internal.enums', i_file) + SwigSource('m5.internal', i_file) def buildParam(target, source, env): name = source[0].get_contents() @@ -561,7 +561,7 @@ def buildParam(target, source, env): code = code_formatter() - code('%module(package="m5.internal.params") $name') + code('%module(package="m5.internal") param_$name') code() code('%{') code('#include "params/$obj.hh"') @@ -575,7 +575,7 @@ def buildParam(target, source, env): code() if obj._base: - code('%import "params/${{obj._base}}.i"') + code('%import "python/m5/internal/param_${{obj._base}}.i"') code() obj.swig_objdecls(code) code() @@ -585,10 +585,10 @@ def buildParam(target, source, env): code.write(target[0].abspath) for name in sim_objects.iterkeys(): - params_file = File('params/%s.i' % name) + params_file = File('python/m5/internal/param_%s.i' % name) env.Command(params_file, Value(name), buildParam) env.Depends(params_file, depends) - SwigSource('m5.internal.params', params_file) + SwigSource('m5.internal', params_file) # Generate the main swig init file def makeEmbeddedSwigInit(target, source, env): |