[elbe-devel] [PATCH v2 22/24] sdk/environment-setup: dont hardcode sdk path

Manuel Traut manut at linutronix.de
Thu Feb 8 14:17:08 CET 2018


use the already defined variable from the dictionary instead of
hardcoding the sdk path

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/elbeproject.py                        | 6 ++++--
 elbepack/makofiles/environment-setup-elbe.mako | 6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index 27b92bb0..4704ba02 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -95,8 +95,10 @@ def __gen_sdk_scripts(triplet, prj_name, prj_version, builddir, sdkpath):
         f.write(template(t, sdkvalues))
 
     t = os.path.join(mako_template_dir, 'environment-setup-elbe.mako')
-    with open(os.path.join(sdkpath,
-                           'environment-setup-elbe'), 'w') as f:
+    envname = 'environment-setup-elbe-%s-%s-%s' % (triplet,
+                                                   prj_name,
+                                                   prj_version)
+    with open(os.path.join(sdkpath, envname), 'w') as f:
         f.write(template(t, sdkvalues))
 
 
diff --git a/elbepack/makofiles/environment-setup-elbe.mako b/elbepack/makofiles/environment-setup-elbe.mako
index 095101c7..087291ea 100644
--- a/elbepack/makofiles/environment-setup-elbe.mako
+++ b/elbepack/makofiles/environment-setup-elbe.mako
@@ -49,11 +49,11 @@ if [ ! -z "$LD_LIBRARY_PATH" ]; then
     echo "  http://xahlee.info/UnixResource_dir/_/ldpath.html"
     return 1
 fi
-export SDKTARGETSYSROOT=/opt/elbe-sdk/sysroots/target
-export PATH=/opt/elbe-sdk/sysroots/host/usr/bin:/opt/elbe-sdk/sysroots/host/usr/sbin:/opt/elbe-sdk/sysroots/host/bin:/opt/elbe-sdk/sysroots/host/sbin:$PATH
+export SDKTARGETSYSROOT="${sdk_path}/sysroots/target"
+export PATH="${sdk_path}/sysroots/host/usr/bin:${sdk_path}/sysroots/host/usr/sbin:${sdk_path}/sysroots/host/bin:${sdk_path}/sysroots/host/sbin:$PATH"
 export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT
 export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib/${real_multimach_target_sys}/pkgconfig
-export OECORE_NATIVE_SYSROOT="/opt/elbe-sdk/sysroots/host"
+export OECORE_NATIVE_SYSROOT="${sdk_path}/sysroots/host"
 export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"
 export CC="${real_multimach_target_sys}-gcc --sysroot=$SDKTARGETSYSROOT"
 export CXX="${real_multimach_target_sys}-g++ --sysroot=$SDKTARGETSYSROOT"
-- 
2.15.1




More information about the elbe-devel mailing list