From 91d942a9da18b77b8a0652bc5f07f2e129b8504e Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 8 Nov 2017 19:25:42 -0800 Subject: scons: Move python path management out of the SConstruct. Make site_init.py manage sys.path, and the "default" tool set PYTHONPATH on any environment that's created. The paths to add are tracked in a common gem5_python_paths.py. Change-Id: I3387d4394d47a2f9c83322644cfd05909c6890fa Reviewed-on: https://gem5-review.googlesource.com/5564 Reviewed-by: Gabe Black Maintainer: Gabe Black --- site_scons/site_tools/default.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'site_scons/site_tools') diff --git a/site_scons/site_tools/default.py b/site_scons/site_tools/default.py index 2d32b56bd..73c4a9eaf 100644 --- a/site_scons/site_tools/default.py +++ b/site_scons/site_tools/default.py @@ -39,10 +39,13 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import os +import sys import SCons.Tool import SCons.Tool.default +from gem5_python_paths import extra_python_paths + def common_config(env): # export TERM so that clang reports errors in color use_vars = set([ 'AS', 'AR', 'CC', 'CXX', 'HOME', 'LD_LIBRARY_PATH', @@ -71,6 +74,10 @@ def common_config(env): env.root = env.Dir('#') env.srcdir = env.root.Dir('src') + # add useful python code PYTHONPATH so it can be used by subprocesses + # as well + env.AppendENVPath('PYTHONPATH', extra_python_paths) + gem5_tool_list = [ 'git', 'mercurial', -- cgit v1.2.3