All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] meta-toolchain: make SDK relocatable by using $SDK_PATH var in env setup script
@ 2010-02-04  1:43 Denys Dmytriyenko
  2010-02-04 16:57 ` Chris Conroy
  0 siblings, 1 reply; 14+ messages in thread
From: Denys Dmytriyenko @ 2010-02-04  1:43 UTC (permalink / raw)
  To: openembedded-devel

Do not hard-code SDK location into all the libtool's .la files and other
libtool, pkg-config and opkg service variables and aliases. Use $SDK_PATH
environment variable instead, which is set once in the main environment-setup
script, allowing easy SDK relocation by adjusting a single variable.

Signed-off-by: Denys Dmytriyenko <denis@denix.org>
---
 recipes/meta/meta-toolchain.bb |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/recipes/meta/meta-toolchain.bb b/recipes/meta/meta-toolchain.bb
index a8c27ec..2855fde 100644
--- a/recipes/meta/meta-toolchain.bb
+++ b/recipes/meta/meta-toolchain.bb
@@ -119,10 +119,10 @@ do_populate_sdk() {
 
 	# Fix or remove broken .la files
 	for i in `find ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS} -name \*.la`; do
-		sed -i 	-e "/^dependency_libs=/s,\([[:space:]']\)${base_libdir},\1${SDKPATH}/${TARGET_SYS}${base_libdir},g" \
-			-e "/^dependency_libs=/s,\([[:space:]']\)${libdir},\1${SDKPATH}/${TARGET_SYS}${libdir},g" \
-			-e "/^dependency_libs=/s,\-\([LR]\)${base_libdir},-\1${SDKPATH}/${TARGET_SYS}${base_libdir},g" \
-			-e "/^dependency_libs=/s,\-\([LR]\)${libdir},-\1${SDKPATH}/${TARGET_SYS}${libdir},g" \
+		sed -i 	-e "/^dependency_libs=/s,\([[:space:]']\)${base_libdir},\1\$SDK_PATH/\$TARGET_SYS${base_libdir},g" \
+			-e "/^dependency_libs=/s,\([[:space:]']\)${libdir},\1\$SDK_PATH/\$TARGET_SYS${libdir},g" \
+			-e "/^dependency_libs=/s,\-\([LR]\)${base_libdir},-\1\$SDK_PATH/\$TARGET_SYS${base_libdir},g" \
+			-e "/^dependency_libs=/s,\-\([LR]\)${libdir},-\1\$SDK_PATH/\$TARGET_SYS${libdir},g" \
 			-e 's/^installed=yes$/installed=no/' $i
 	done
 	rm -f ${SDK_OUTPUT}/${SDKPATH}/lib/*.la
@@ -137,13 +137,16 @@ do_populate_sdk() {
 	# Create environment setup script
 	script=${SDK_OUTPUT}/${SDKPATH}/environment-setup
 	touch $script
-	echo 'export PATH=${SDKPATH}/bin:$PATH' >> $script
-	echo 'export LIBTOOL_SYSROOT_PATH=${prefix}/${TARGET_SYS}' >> $script
-	echo 'export PKG_CONFIG_SYSROOT_DIR=${SDKPATH}/${TARGET_SYS}' >> $script
-	echo 'export PKG_CONFIG_PATH=${SDKPATH}/${TARGET_SYS}${libdir}/pkgconfig' >> $script
-	echo 'export CONFIG_SITE=${SDKPATH}/site-config' >> $script
-	echo "alias opkg='LD_LIBRARY_PATH=${SDKPATH}/lib ${SDKPATH}/bin/opkg-cl -f ${SDKPATH}/${sysconfdir}/opkg-sdk.conf -o ${SDKPATH}'" >> $script
-	echo "alias opkg-target='LD_LIBRARY_PATH=${SDKPATH}/lib ${SDKPATH}/bin/opkg-cl -f ${SDKPATH}/${TARGET_SYS}${sysconfdir}/opkg.conf -o ${SDKPATH}/${TARGET_SYS}'" >> $script
+	echo 'export SDK_PATH=${SDKPATH}' >> $script
+	echo 'export TARGET_SYS=${TARGET_SYS}' >> $script
+	echo 'export PATH=$SDK_PATH/bin:$PATH' >> $script
+	echo 'export CPATH=$SDK_PATH/$TARGET_SYS/usr/include:$CPATH' >> $script
+	echo 'export LIBTOOL_SYSROOT_PATH=$SDK_PATH/$TARGET_SYS' >> $script
+	echo 'export PKG_CONFIG_SYSROOT_DIR=$SDK_PATH/$TARGET_SYS' >> $script
+	echo 'export PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS${libdir}/pkgconfig' >> $script
+	echo 'export CONFIG_SITE=$SDK_PATH/site-config' >> $script
+	echo "alias opkg='LD_LIBRARY_PATH=$SDK_PATH/lib $SDK_PATH/bin/opkg-cl -f $SDK_PATH/${sysconfdir}/opkg-sdk.conf -o $SDK_PATH'" >> $script
+	echo "alias opkg-target='LD_LIBRARY_PATH=$SDK_PATH/lib $SDK_PATH/bin/opkg-cl -f $SDK_PATH/$TARGET_SYS${sysconfdir}/opkg.conf -o $SDK_PATH/$TARGET_SYS'" >> $script
 
 	# Add version information
 	versionfile=${SDK_OUTPUT}/${SDKPATH}/version
-- 
1.6.3.3




^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-02-10 18:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-04  1:43 [RFC][PATCH] meta-toolchain: make SDK relocatable by using $SDK_PATH var in env setup script Denys Dmytriyenko
2010-02-04 16:57 ` Chris Conroy
2010-02-04 17:22   ` Denys Dmytriyenko
2010-02-04 17:57     ` Tom Rini
2010-02-06 13:04       ` Phil Blundell
2010-02-08 19:00         ` Tom Rini
2010-02-09 20:08           ` Khem Raj
2010-02-09 21:36             ` Tom Rini
2010-02-10 15:50               ` Richard Purdie
2010-02-10 18:45                 ` Tom Rini
2010-02-10 18:54                 ` Phil Blundell
2010-02-04 18:42     ` Chris Conroy
2010-02-04 19:07       ` Denys Dmytriyenko
2010-02-08 23:31         ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.