SConscript (11802:be62996c95d1) | SConscript (11974:006d830b4a4e) |
---|---|
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 --- 20 unchanged lines hidden (view full) --- 29# Authors: Nathan Binkert 30 31import array 32import bisect 33import imp 34import marshal 35import os 36import re | 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 --- 20 unchanged lines hidden (view full) --- 29# Authors: Nathan Binkert 30 31import array 32import bisect 33import imp 34import marshal 35import os 36import re |
37import subprocess |
|
37import sys 38import zlib 39 40from os.path import basename, dirname, exists, isdir, isfile, join as joinpath 41 42import SCons 43 44# This file defines how to build a particular configuration of gem5 --- 1144 unchanged lines hidden (view full) --- 1189 test_objs += main_objs 1190 path = variant('unittest/%s.%s' % (test.target, label)) 1191 new_env.Program(path, test_objs + static_objs) 1192 1193 progname = exename 1194 if strip: 1195 progname += '.unstripped' 1196 | 38import sys 39import zlib 40 41from os.path import basename, dirname, exists, isdir, isfile, join as joinpath 42 43import SCons 44 45# This file defines how to build a particular configuration of gem5 --- 1144 unchanged lines hidden (view full) --- 1190 test_objs += main_objs 1191 path = variant('unittest/%s.%s' % (test.target, label)) 1192 new_env.Program(path, test_objs + static_objs) 1193 1194 progname = exename 1195 if strip: 1196 progname += '.unstripped' 1197 |
1197 targets = new_env.Program(progname, main_objs + static_objs) | 1198 # When linking the gem5 binary, the command line can be too big for the 1199 # shell to handle. Use "subprocess" to spawn processes without passing 1200 # through the shell to avoid this problem. That means we also can't use 1201 # shell syntax in any of the commands this will run, but that isn't 1202 # currently an issue. 1203 def spawn_with_subprocess(sh, escape, cmd, args, env): 1204 return subprocess.call(args, env=env) |
1198 | 1205 |
1206 # Since we're not running through a shell, no escaping is necessary either. 1207 targets = new_env.Program(progname, main_objs + static_objs, 1208 SPAWN=spawn_with_subprocess, 1209 ESCAPE=lambda x: x) 1210 |
|
1199 if strip: 1200 if sys.platform == 'sunos5': 1201 cmd = 'cp $SOURCE $TARGET; strip $TARGET' 1202 else: 1203 cmd = 'strip $SOURCE -o $TARGET' 1204 targets = new_env.Command(exename, progname, 1205 MakeAction(cmd, Transform("STRIP"))) 1206 --- 143 unchanged lines hidden --- | 1211 if strip: 1212 if sys.platform == 'sunos5': 1213 cmd = 'cp $SOURCE $TARGET; strip $TARGET' 1214 else: 1215 cmd = 'strip $SOURCE -o $TARGET' 1216 targets = new_env.Command(exename, progname, 1217 MakeAction(cmd, Transform("STRIP"))) 1218 --- 143 unchanged lines hidden --- |