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 <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
Gabe Black
2017-11-08 19:25:42 -08:00
parent 902b3e34be
commit 91d942a9da
4 changed files with 63 additions and 11 deletions

View File

@@ -95,13 +95,6 @@ from os.path import join as joinpath, split as splitpath
import SCons
import SCons.Node
extra_python_paths = [
Dir('src/python').srcnode().abspath, # gem5 includes
Dir('ext/ply').srcnode().abspath, # ply is used by several files
]
sys.path[1:1] = extra_python_paths
from m5.util import compareVersions, readCommand
from m5.util.terminal import get_termcap
@@ -192,10 +185,6 @@ if not ('CC' in main_dict_keys and 'CXX' in main_dict_keys):
print "No C++ compiler installed (package g++ on Ubuntu and RedHat)"
Exit(1)
# add useful python code PYTHONPATH so it can be used by subprocesses
# as well
main.AppendENVPath('PYTHONPATH', extra_python_paths)
###################################################
#
# Figure out which configurations to set up based on the path(s) of