OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Harness for defining library dependencies for scons files.""" | 5 """Harness for defining library dependencies for scons files.""" |
6 | 6 |
7 | 7 |
8 # The following is a map from a library, to the corresponding | 8 # The following is a map from a library, to the corresponding |
9 # list of dependent libraries that must be included after that library, in | 9 # list of dependent libraries that must be included after that library, in |
10 # the list of libraries. | 10 # the list of libraries. |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 ], | 175 ], |
176 'validators': [ | 176 'validators': [ |
177 'ncvalidate_arm_v2', | 177 'ncvalidate_arm_v2', |
178 ], | 178 ], |
179 }, | 179 }, |
180 'arm-thumb2': { | 180 'arm-thumb2': { |
181 'ncvalidate_arm_v2': [ | 181 'ncvalidate_arm_v2': [ |
182 'arm_validator_core', | 182 'arm_validator_core', |
183 ], | 183 ], |
184 }, | 184 }, |
185 'mips32': { | |
186 'ncvalidate_mips': [ | |
187 'mips_validator_core', | |
188 ], | |
189 'validators': [ | |
190 'ncvalidate_mips', | |
191 ], | |
192 }, | |
185 } | 193 } |
186 | 194 |
187 | 195 |
188 def AddLibDeps(env, platform, libraries): | 196 def AddLibDeps(env, platform, libraries): |
189 """ Adds dependent libraries to list of libraries. | 197 """ Adds dependent libraries to list of libraries. |
190 | 198 |
191 Computes the transitive closure of library dependencies for each library | 199 Computes the transitive closure of library dependencies for each library |
192 in the given list. Dependent libraries are added after libraries | 200 in the given list. Dependent libraries are added after libraries |
193 as defined in LIBRARY_DEPENDENCIES, unless there is a cycle. If | 201 as defined in LIBRARY_DEPENDENCIES, unless there is a cycle. If |
194 a cycle occurs, it is broken and the remaining (acyclic) graph | 202 a cycle occurs, it is broken and the remaining (acyclic) graph |
(...skipping 11 matching lines...) Expand all Loading... | |
206 def VisitList(libraries): | 214 def VisitList(libraries): |
207 for library in reversed(libraries): | 215 for library in reversed(libraries): |
208 if library not in visited: | 216 if library not in visited: |
209 VisitLibrary(library) | 217 VisitLibrary(library) |
210 | 218 |
211 def GetLibraryDeps(library): | 219 def GetLibraryDeps(library): |
212 ret = (LIBRARY_DEPENDENCIES_DEFAULT.get(library, []) + | 220 ret = (LIBRARY_DEPENDENCIES_DEFAULT.get(library, []) + |
213 PLATFORM_LIBRARY_DEPENDENCIES.get(platform, {}).get(library, [])) | 221 PLATFORM_LIBRARY_DEPENDENCIES.get(platform, {}).get(library, [])) |
214 if env['NACL_BUILD_FAMILY'] != 'TRUSTED': | 222 if env['NACL_BUILD_FAMILY'] != 'TRUSTED': |
215 ret.extend(UNTRUSTED_LIBRARY_DEPENDENCIES.get(library, [])) | 223 ret.extend(UNTRUSTED_LIBRARY_DEPENDENCIES.get(library, [])) |
216 if library == 'validators' and not env.Bit('target_arm'): | 224 if library == 'validators' and not (env.Bit('target_arm') or |
Mark Seaborn
2012/09/08 02:43:14
Just change this to
if library == 'validators' a
petarj
2012/09/11 16:58:13
Done.
| |
225 env.Bit('target_mips32')): | |
217 if env.Bit('validator_ragel'): | 226 if env.Bit('validator_ragel'): |
218 ret.append(env.NaClTargetArchSuffix('dfa_validate_caller')) | 227 ret.append(env.NaClTargetArchSuffix('dfa_validate_caller')) |
219 else: | 228 else: |
220 ret.append(env.NaClTargetArchSuffix('ncvalidate')) | 229 ret.append(env.NaClTargetArchSuffix('ncvalidate')) |
221 return ret | 230 return ret |
222 | 231 |
223 def VisitLibrary(library): | 232 def VisitLibrary(library): |
224 visited.add(library) | 233 visited.add(library) |
225 VisitList(GetLibraryDeps(library)) | 234 VisitList(GetLibraryDeps(library)) |
226 closure.append(library) | 235 closure.append(library) |
227 | 236 |
228 # Ideally we would just do "VisitList(libraries)" here, but some | 237 # Ideally we would just do "VisitList(libraries)" here, but some |
229 # PPAPI tests (specifically, tests/ppapi_gles_book) list "ppapi_cpp" | 238 # PPAPI tests (specifically, tests/ppapi_gles_book) list "ppapi_cpp" |
230 # twice in the link line, and we need to maintain these duplicates. | 239 # twice in the link line, and we need to maintain these duplicates. |
231 for library in reversed(libraries): | 240 for library in reversed(libraries): |
232 VisitLibrary(library) | 241 VisitLibrary(library) |
233 | 242 |
234 closure.reverse() | 243 closure.reverse() |
235 return closure | 244 return closure |
OLD | NEW |