summaryrefslogtreecommitdiff
path: root/site_scons/site_tools/default.py
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2017-11-08 19:25:42 -0800
committerGabe Black <gabeblack@google.com>2017-11-10 13:17:15 +0000
commit91d942a9da18b77b8a0652bc5f07f2e129b8504e (patch)
treea882b3c8f2ad7c37aab747429621ff12432d4312 /site_scons/site_tools/default.py
parent902b3e34beaadaa2ac2932a9ff93f08008a4b16f (diff)
downloadgem5-91d942a9da18b77b8a0652bc5f07f2e129b8504e.tar.xz
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>
Diffstat (limited to 'site_scons/site_tools/default.py')
-rw-r--r--site_scons/site_tools/default.py7
1 files changed, 7 insertions, 0 deletions
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',