SConscript (8881:042d509574c1) SConscript (8913:8b223e308b08)
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

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

146 def __le__(self, other): return self.filename <= other.filename
147 def __gt__(self, other): return self.filename > other.filename
148 def __ge__(self, other): return self.filename >= other.filename
149 def __eq__(self, other): return self.filename == other.filename
150 def __ne__(self, other): return self.filename != other.filename
151
152class Source(SourceFile):
153 '''Add a c/c++ source file to the build'''
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

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

146 def __le__(self, other): return self.filename <= other.filename
147 def __gt__(self, other): return self.filename > other.filename
148 def __ge__(self, other): return self.filename >= other.filename
149 def __eq__(self, other): return self.filename == other.filename
150 def __ne__(self, other): return self.filename != other.filename
151
152class Source(SourceFile):
153 '''Add a c/c++ source file to the build'''
154 def __init__(self, source, Werror=True, swig=False, **guards):
154 def __init__(self, source, swig = False, **guards):
155 '''specify the source file, and any guards'''
156 super(Source, self).__init__(source, **guards)
157
155 '''specify the source file, and any guards'''
156 super(Source, self).__init__(source, **guards)
157
158 self.Werror = Werror
159 self.swig = swig
160
161class PySource(SourceFile):
162 '''Add a python source file to the named package'''
163 invalid_sym_char = re.compile('[^A-z0-9_]')
164 modules = {}
165 tnodes = {}
166 symnames = {}

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

839 # name. Use '_' instead.
840 libname = 'gem5_' + label
841 exename = 'gem5.' + label
842 secondary_exename = 'm5.' + label
843
844 new_env = env.Clone(OBJSUFFIX=objsfx, SHOBJSUFFIX=objsfx + 's')
845 new_env.Label = label
846 new_env.Append(**kwargs)
158 self.swig = swig
159
160class PySource(SourceFile):
161 '''Add a python source file to the named package'''
162 invalid_sym_char = re.compile('[^A-z0-9_]')
163 modules = {}
164 tnodes = {}
165 symnames = {}

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

838 # name. Use '_' instead.
839 libname = 'gem5_' + label
840 exename = 'gem5.' + label
841 secondary_exename = 'm5.' + label
842
843 new_env = env.Clone(OBJSUFFIX=objsfx, SHOBJSUFFIX=objsfx + 's')
844 new_env.Label = label
845 new_env.Append(**kwargs)
846 # Always consider warnings errors
847 new_env.Append(CCFLAGS='-Werror')
847
848 swig_env = new_env.Clone()
848
849 swig_env = new_env.Clone()
849 swig_env.Append(CCFLAGS='-Werror')
850 if env['GCC']:
851 swig_env.Append(CCFLAGS='-Wno-uninitialized')
852 swig_env.Append(CCFLAGS='-Wno-sign-compare')
853 swig_env.Append(CCFLAGS='-Wno-parentheses')
854 swig_env.Append(CCFLAGS='-Wno-unused-label')
855 if compareVersions(env['GCC_VERSION'], '4.6.0') != -1:
856 swig_env.Append(CCFLAGS='-Wno-unused-but-set-variable')
857 if env['CLANG']:
858 swig_env.Append(CCFLAGS=['-Wno-unused-label'])
859
850 if env['GCC']:
851 swig_env.Append(CCFLAGS='-Wno-uninitialized')
852 swig_env.Append(CCFLAGS='-Wno-sign-compare')
853 swig_env.Append(CCFLAGS='-Wno-parentheses')
854 swig_env.Append(CCFLAGS='-Wno-unused-label')
855 if compareVersions(env['GCC_VERSION'], '4.6.0') != -1:
856 swig_env.Append(CCFLAGS='-Wno-unused-but-set-variable')
857 if env['CLANG']:
858 swig_env.Append(CCFLAGS=['-Wno-unused-label'])
859
860
861 werror_env = new_env.Clone()
862 werror_env.Append(CCFLAGS='-Werror')
863
864 def make_obj(source, static, extra_deps = None):
865 '''This function adds the specified source to the correct
866 build environment, and returns the corresponding SCons Object
867 nodes'''
868
869 if source.swig:
870 env = swig_env
860 def make_obj(source, static, extra_deps = None):
861 '''This function adds the specified source to the correct
862 build environment, and returns the corresponding SCons Object
863 nodes'''
864
865 if source.swig:
866 env = swig_env
871 elif source.Werror:
872 env = werror_env
873 else:
874 env = new_env
875
876 if static:
877 obj = env.StaticObject(source.tnode)
878 else:
879 obj = env.SharedObject(source.tnode)
880

--- 124 unchanged lines hidden ---
867 else:
868 env = new_env
869
870 if static:
871 obj = env.StaticObject(source.tnode)
872 else:
873 obj = env.SharedObject(source.tnode)
874

--- 124 unchanged lines hidden ---