diff options
author | Denys Dmytriyenko <denis@denix.org> | 2010-02-03 15:43:42 +0000 |
---|---|---|
committer | Denys Dmytriyenko <denis@denix.org> | 2010-02-19 18:26:50 -0500 |
commit | bbe55bc6a41f1965785347d9bec636945bdbd2c6 (patch) | |
tree | b114a49e5da68dcf01aa58ea9552b79d7e79d174 | |
parent | 4f0d9f93c1d1ca5d8d3d83dae101891a720b6305 (diff) |
meta-toolchain: make SDK relocatable by using $SDK_PATH var in env setup script
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.
This patch does not address gcc relocatability, if any.
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
-rw-r--r-- | 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 3169425ebf..066ffe9cbb 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 |