SConscript (12304:299452fa8cc4) SConscript (12305:b6ebf3d20329)
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

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

167 new_tag = Source.link_group_tag(group)
168 Source._current_group_tag = new_tag
169 Source.source_groups.add(group)
170
171 def _add_link_group_tag(self):
172 self.tags.add(Source._current_group_tag)
173
174 '''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

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

167 new_tag = Source.link_group_tag(group)
168 Source._current_group_tag = new_tag
169 Source.source_groups.add(group)
170
171 def _add_link_group_tag(self):
172 self.tags.add(Source._current_group_tag)
173
174 '''Add a c/c++ source file to the build'''
175 def __init__(self, source, tags=None, add_tags=None, Werror=True):
175 def __init__(self, source, tags=None, add_tags=None):
176 '''specify the source file, and any tags'''
177 super(Source, self).__init__(source, tags, add_tags)
178 self._add_link_group_tag()
176 '''specify the source file, and any tags'''
177 super(Source, self).__init__(source, tags, add_tags)
178 self._add_link_group_tag()
179 self.Werror = Werror
180
181class PySource(SourceFile):
182 '''Add a python source file to the named package'''
183 invalid_sym_char = re.compile('[^A-z0-9_]')
184 modules = {}
185 tnodes = {}
186 symnames = {}
187

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

947 libname = 'gem5_' + label
948 exename = 'gem5.' + label
949 secondary_exename = 'm5.' + label
950
951 new_env = env.Clone(OBJSUFFIX=objsfx, SHOBJSUFFIX=objsfx + 's')
952 new_env.Label = label
953 new_env.Append(**kwargs)
954
179
180class PySource(SourceFile):
181 '''Add a python source file to the named package'''
182 invalid_sym_char = re.compile('[^A-z0-9_]')
183 modules = {}
184 tnodes = {}
185 symnames = {}
186

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

946 libname = 'gem5_' + label
947 exename = 'gem5.' + label
948 secondary_exename = 'm5.' + label
949
950 new_env = env.Clone(OBJSUFFIX=objsfx, SHOBJSUFFIX=objsfx + 's')
951 new_env.Label = label
952 new_env.Append(**kwargs)
953
955 werror_env = new_env.Clone()
956 # Treat warnings as errors but white list some warnings that we
957 # want to allow (e.g., deprecation warnings).
958 werror_env.Append(CCFLAGS=['-Werror',
959 '-Wno-error=deprecated-declarations',
960 '-Wno-error=deprecated',
961 ])
954 def make_obj(source, static, extra_deps=None):
955 '''This function creates a scons node of the requested type, and sets
956 up any additional dependencies.'''
962
957
963 def make_obj(source, static, extra_deps = None):
964 '''This function adds the specified source to the correct
965 build environment, and returns the corresponding SCons Object
966 nodes'''
967
968 if source.Werror:
969 env = werror_env
970 else:
971 env = new_env
972
973 if static:
958 if static:
974 obj = env.StaticObject(source.tnode)
959 obj = new_env.StaticObject(source.tnode)
975 else:
960 else:
976 obj = env.SharedObject(source.tnode)
961 obj = new_env.SharedObject(source.tnode)
977
978 if extra_deps:
962
963 if extra_deps:
979 env.Depends(obj, extra_deps)
964 new_env.Depends(obj, extra_deps)
980
981 return obj
982
983 lib_sources = Source.all.with_tag('gem5 lib')
984
985 # Without Python, leave out all Python content from the library
986 # builds. The option doesn't affect gem5 built as a program
987 if GetOption('without_python'):

--- 186 unchanged lines hidden ---
965
966 return obj
967
968 lib_sources = Source.all.with_tag('gem5 lib')
969
970 # Without Python, leave out all Python content from the library
971 # builds. The option doesn't affect gem5 built as a program
972 if GetOption('without_python'):

--- 186 unchanged lines hidden ---