From 6c6b78126a38cf92eef89f027312e1c7a063bd18 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Fri, 20 Oct 2006 11:37:59 -0700 Subject: Construct a correct value of PYTHONHOME from the interpreter running SCons, make it into a sticky option that can be overridden at build time, and set it up before the interpreter is started. Also, fix the code that turns sticky options into config/*.hh so that it works with types other than bool. --HG-- extra : convert_revision : 602398b35d4da4e813f78865678ed348fdea7270 --- src/sim/main.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/sim/main.cc') diff --git a/src/sim/main.cc b/src/sim/main.cc index 8bb0d7aaa..133141e57 100644 --- a/src/sim/main.cc +++ b/src/sim/main.cc @@ -55,6 +55,7 @@ #include "base/statistics.hh" #include "base/str.hh" #include "base/time.hh" +#include "config/pythonhome.hh" #include "cpu/base.hh" #include "cpu/smt.hh" #include "mem/mem_object.hh" @@ -145,6 +146,11 @@ main(int argc, char **argv) if (setenv("PYTHONPATH", pythonpath.c_str(), true) == -1) fatal("setenv: %s\n", strerror(errno)); + char *python_home = getenv("PYTHONHOME"); + if (!python_home) + python_home = PYTHONHOME; + Py_SetPythonHome(python_home); + // initialize embedded Python interpreter Py_Initialize(); PySys_SetArgv(argc, argv); -- cgit v1.2.3