Deleted Added
sdiff udiff text old ( 8881:042d509574c1 ) new ( 8913:8b223e308b08 )
full compact
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):
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)
847
848 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
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
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 ---