summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2007-06-10 13:54:59 -0700
committerNathan Binkert <binkertn@umich.edu>2007-06-10 13:54:59 -0700
commitcd46796d5cd7fd87f511158350d7c98acfdaba3b (patch)
tree436fca890192c6d76c817192b5b27c7f0d3ad527
parent961f8382f6cb1473420ac82301d7173e878be69c (diff)
downloadgem5-cd46796d5cd7fd87f511158350d7c98acfdaba3b.tar.xz
Add the -templatereduce option to swig to prepare for more templates.
remove the old scanner and replace it with ours instead of just adding ours, this fixes some issues with dependency tracking. --HG-- extra : convert_revision : 925d42ad024deaea48a243067d0ea9542aeba324
-rw-r--r--SConstruct25
1 files changed, 19 insertions, 6 deletions
diff --git a/SConstruct b/SConstruct
index 173910010..fa2366963 100644
--- a/SConstruct
+++ b/SConstruct
@@ -270,16 +270,29 @@ if compare_versions(swig_version[2], min_swig_version) < 0:
Exit(1)
# Set up SWIG flags & scanner
-env.Append(SWIGFLAGS=Split('-c++ -python -modern $_CPPINCFLAGS'))
+swig_flags=Split('-c++ -python -modern -templatereduce $_CPPINCFLAGS')
+env.Append(SWIGFLAGS=swig_flags)
+
+# filter out all existing swig scanners, they mess up the dependency
+# stuff for some reason
+scanners = []
+for scanner in env['SCANNERS']:
+ skeys = scanner.skeys
+ if skeys == '.i':
+ continue
+
+ if isinstance(skeys, (list, tuple)) and '.i' in skeys:
+ continue
-import SCons.Scanner
+ scanners.append(scanner)
+# add the new swig scanner that we like better
+from SCons.Scanner import ClassicCPP as CPPScanner
swig_inc_re = '^[ \t]*[%,#][ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")'
+scanners.append(CPPScanner("SwigScan", [ ".i" ], "CPPPATH", swig_inc_re))
-swig_scanner = SCons.Scanner.ClassicCPP("SwigScan", ".i", "CPPPATH",
- swig_inc_re)
-
-env.Append(SCANNERS = swig_scanner)
+# replace the scanners list that has what we want
+env['SCANNERS'] = scanners
# Platform-specific configuration. Note again that we assume that all
# builds under a given build root run on the same host platform.