Patchwork meta-toolchain.bb: Fix do_populate_sdk for DISTRO=micro.

login
register
mail settings
Submitter Graham Gower
Date Dec. 17, 2010, 6:15 a.m.
Message ID <4D0B000B.4010903@gmail.com>
Download mbox | patch
Permalink /patch/78/
State Accepted
Headers show

Comments

Graham Gower - Dec. 17, 2010, 6:15 a.m.
Signed-off-by: Graham Gower <graham.gower@gmail.com>
---
 recipes/meta/meta-toolchain.bb |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
Khem Raj - Dec. 18, 2010, 1:57 a.m.
On Thu, Dec 16, 2010 at 10:15 PM, Graham Gower <graham.gower@gmail.com> wrote:
>
> Signed-off-by: Graham Gower <graham.gower@gmail.com>

Looks ok

Acked-by: Khem Raj <raj.khem@gmail.com>

> ---
>  recipes/meta/meta-toolchain.bb |   16 +++++++++-------
>  1 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/recipes/meta/meta-toolchain.bb b/recipes/meta/meta-toolchain.bb
> index e949432..cb9e438 100644
> --- a/recipes/meta/meta-toolchain.bb
> +++ b/recipes/meta/meta-toolchain.bb
> @@ -72,9 +72,9 @@ do_populate_sdk() {
>                ${IPKG_TARGET} remove -force-depends ${TOOLCHAIN_TARGET_EXCLUDE}
>        fi
>
> -       install -d ${SDK_OUTPUT}/${SDKPATH}/usr/lib/opkg
> -       mv ${SDK_OUTPUT}/usr/lib/opkg/* ${SDK_OUTPUT}/${SDKPATH}/usr/lib/opkg/
> -       rm -Rf ${SDK_OUTPUT}/usr/lib
> +       install -d ${SDK_OUTPUT}/${SDKPATH}${libdir}/opkg
> +       mv ${SDK_OUTPUT}${libdir}/opkg/* ${SDK_OUTPUT}/${SDKPATH}${libdir}/opkg/
> +       rm -Rf ${SDK_OUTPUT}${libdir}
>
>        # Clean up empty directories from excluded packages
>        find ${SDK_OUTPUT} -depth -type d -empty -print0 | xargs -r0 /bin/rmdir
> @@ -86,7 +86,7 @@ do_populate_sdk() {
>        install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKPATH}/${sysconfdir}/
>
>        # extract and store ipks, pkgdata and shlibs data
> -       target_pkgs=`cat ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/usr/lib/opkg/status | grep Package: | cut -f 2 -d ' '`
> +       target_pkgs=`cat ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}${libdir}/opkg/status | grep Package: | cut -f 2 -d ' '`
>        mkdir -p ${SDK_OUTPUT2}/${SDKPATH}/ipk/
>        mkdir -p ${SDK_OUTPUT2}/${SDKPATH}/pkgdata/runtime/
>        mkdir -p ${SDK_OUTPUT2}/${SDKPATH}/${TARGET_SYS}/shlibs/
> @@ -123,9 +123,11 @@ do_populate_sdk() {
>
>        # With sysroot support, gcc expects the default C++ headers to be
>        # in a specific place.
> -       install -d ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/include
> -       mv ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/usr/include/c++ \
> -               ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/include/
> +       if [ "${base_prefix}" != "${prefix}" ]; then
> +               install -d ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/include
> +               mv ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/usr/include/c++ \
> +                       ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/include/
> +       fi
>
>        # Fix or remove broken .la files
>        for i in `find ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS} -name \*.la`; do
> --
> 1.7.1
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>

Patch

diff --git a/recipes/meta/meta-toolchain.bb b/recipes/meta/meta-toolchain.bb
index e949432..cb9e438 100644
--- a/recipes/meta/meta-toolchain.bb
+++ b/recipes/meta/meta-toolchain.bb
@@ -72,9 +72,9 @@  do_populate_sdk() {
 		${IPKG_TARGET} remove -force-depends ${TOOLCHAIN_TARGET_EXCLUDE}
 	fi
 
-	install -d ${SDK_OUTPUT}/${SDKPATH}/usr/lib/opkg
-	mv ${SDK_OUTPUT}/usr/lib/opkg/* ${SDK_OUTPUT}/${SDKPATH}/usr/lib/opkg/
-	rm -Rf ${SDK_OUTPUT}/usr/lib
+	install -d ${SDK_OUTPUT}/${SDKPATH}${libdir}/opkg
+	mv ${SDK_OUTPUT}${libdir}/opkg/* ${SDK_OUTPUT}/${SDKPATH}${libdir}/opkg/
+	rm -Rf ${SDK_OUTPUT}${libdir}
 
 	# Clean up empty directories from excluded packages
 	find ${SDK_OUTPUT} -depth -type d -empty -print0 | xargs -r0 /bin/rmdir
@@ -86,7 +86,7 @@  do_populate_sdk() {
 	install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKPATH}/${sysconfdir}/
 
 	# extract and store ipks, pkgdata and shlibs data
-	target_pkgs=`cat ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/usr/lib/opkg/status | grep Package: | cut -f 2 -d ' '`
+	target_pkgs=`cat ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}${libdir}/opkg/status | grep Package: | cut -f 2 -d ' '`
 	mkdir -p ${SDK_OUTPUT2}/${SDKPATH}/ipk/
 	mkdir -p ${SDK_OUTPUT2}/${SDKPATH}/pkgdata/runtime/
 	mkdir -p ${SDK_OUTPUT2}/${SDKPATH}/${TARGET_SYS}/shlibs/
@@ -123,9 +123,11 @@  do_populate_sdk() {
 
 	# With sysroot support, gcc expects the default C++ headers to be
 	# in a specific place.
-	install -d ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/include
-	mv ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/usr/include/c++ \
-		${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/include/
+	if [ "${base_prefix}" != "${prefix}" ]; then
+		install -d ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/include
+		mv ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/usr/include/c++ \
+			${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/include/
+	fi
 
 	# Fix or remove broken .la files
 	for i in `find ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS} -name \*.la`; do