Patchwork [01/17] toolchain-scripts.bbclass:add PYTHONHOME variable to environment-setup

login
register
mail settings
Submitter Hongxu Jia
Date March 11, 2013, 11:04 a.m.
Message ID <82f7bfd1e6ce920a363eb1c14db8166aae17bdaa.1362985569.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/45895/
State New
Headers show

Comments

Hongxu Jia - March 11, 2013, 11:04 a.m.
When relocating the SDK, applications using python will search for
python modules in the default location and will fail to start.
The below errors are thrown by gdb, for example:

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site

In order to overcome this, add the PYTHONHOME variable to the
environment-setup script for both standalone toolchain and
adt-installer. No need to do that for meta-ide-support environment
script since this toolchain does not get relocated.

Cherry-pick commit db0a02492c2a53c1917b753bcf21c4ee7c0ecf59

[YOCTO #3839]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/classes/toolchain-scripts.bbclass |    2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index 6d8623c..d336397 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -45,6 +45,7 @@  toolchain_create_sdk_env_script () {
 	echo 'export OECORE_ACLOCAL_OPTS="-I ${SDKPATHNATIVE}/usr/share/aclocal"' >> $script
 	echo 'export OECORE_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script
 	echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script
+	echo 'export PYTHONHOME=${SDKPATHNATIVE}${prefix_nativesdk}' >> $script
 }
 
 # This function creates an environment-setup-script in the TMPDIR which enables
@@ -132,6 +133,7 @@  toolchain_create_sdk_env_script_for_installer () {
         echo 'export OECORE_ACLOCAL_OPTS="-I ${SDKPATHNATIVE}/usr/share/aclocal"' >> $script
 	echo 'export OECORE_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script
 	echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script
+	echo 'export PYTHONHOME=${SDKPATHNATIVE}${prefix_nativesdk}' >> $script
 }
 
 #we get the cached site config in the runtime