From: Andreas Hansson Date: Tue, 10 Jan 2012 00:08:20 +0000 (-0600) Subject: SWIG: Make gem5 compile and link with swig 2.0.4 X-Git-Tag: stable_2012_06_28~275^2~41 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=59b7cad3ec6ae02f53b53865b365101b1856bb93;p=gem5.git SWIG: Make gem5 compile and link with swig 2.0.4 To make gem5 compile and run with swig 2.0.4 a few minor fixes are necessary, the fail label issues by swig must not be treated as an error by gcc (tested with gcc 4.2.1), and the vector wrappers must have SWIGPY_SLICE_ARG defined which happens in pycontainer.swg, included through std_container.i. By adding the aforementioned include to the vector wrappers everything seems to work. --- diff --git a/src/SConscript b/src/SConscript index 0a4bb57f4..7fb03e821 100755 --- a/src/SConscript +++ b/src/SConscript @@ -851,8 +851,8 @@ def makeEnv(label, objsfx, strip = False, **kwargs): swig_env.Append(CCFLAGS='-Wno-uninitialized') swig_env.Append(CCFLAGS='-Wno-sign-compare') swig_env.Append(CCFLAGS='-Wno-parentheses') + swig_env.Append(CCFLAGS='-Wno-unused-label') if compareVersions(env['GCC_VERSION'], '4.6.0') != -1: - swig_env.Append(CCFLAGS='-Wno-unused-label') swig_env.Append(CCFLAGS='-Wno-unused-but-set-variable') werror_env = new_env.Clone() diff --git a/src/python/m5/params.py b/src/python/m5/params.py index ee3678dc9..03917d085 100644 --- a/src/python/m5/params.py +++ b/src/python/m5/params.py @@ -256,6 +256,9 @@ class VectorParamDesc(ParamDesc): self.ptype.cxx_predecls(code) code('%}') code() + # Make sure the SWIGPY_SLICE_ARG is defined through this inclusion + code('%include "std_container.i"') + code() self.ptype.swig_predecls(code) code() code('%include "std_vector.i"')