[oe] [PATCH v2 2/2] external-toolchain-csl: allow linux-libc-headers

Ben Gardiner bengardiner at nanometrics.ca
Wed Mar 2 15:05:14 UTC 2011


If PREFERRED_PROVIDER_linux-libc-headers is defined as anything
other than external-toolchain-csl then don't PROVIDE, install or
stage the linux headers packaged with the CSL toolchain.

Signed-off-by: Ben Gardiner <bengardiner at nanometrics.ca>
Tested-by: Andrea Galbusera <gizero at gmail.com>

---

Changes since v1:
 * rebased to 3dc72c4ca0a9ce677f6c3a56517626984b5eaaa0 of
   git://git.openembedded.org/openembedded#master
 * added Tested-by: Andrea Galbusera <gizero at gmail.com>

---
 conf/local.conf.sample                 |    4 ++++
 recipes/meta/external-toolchain-csl.bb |   15 ++++++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/conf/local.conf.sample b/conf/local.conf.sample
index ff3da96..51d0449 100644
--- a/conf/local.conf.sample
+++ b/conf/local.conf.sample
@@ -90,6 +90,10 @@ PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}g++:gcc-cross"
 # Stay away from unversioned distros unless you really know what you are doing
 # DISTRO = "angstrom-2008.1"
 
+#Uncomment this if you want to use linux-headers from the linux-lib-headers
+#recipe as opposed to those bundled with the CSL toolchain
+#PREFERRED_PROVIDER_linux-libc-headers = "linux-libc-headers"
+
 # So far, angstrom.conf sets ENABLE_BINARY_LOCALE_GENERATION
 # to generate binary locale packages at build time using qemu-native and
 # thereby guarantee i18n support on all devices. If your build breaks on 
diff --git a/recipes/meta/external-toolchain-csl.bb b/recipes/meta/external-toolchain-csl.bb
index 2e109c8..48c23eb 100644
--- a/recipes/meta/external-toolchain-csl.bb
+++ b/recipes/meta/external-toolchain-csl.bb
@@ -1,4 +1,4 @@
-PR = "r7"
+PR = "r8"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
@@ -21,9 +21,10 @@ PROVIDES = "\
 	virtual/libintl \
 	virtual/libiconv \
 	glibc-thread-db \
-	linux-libc-headers \
+	${@base_conditional('PREFERRED_PROVIDER_linux-libc-headers', 'external-toolchain-csl', 'linux-libc-headers', '', d)} \
 "
 
+DEPENDS = "${@base_conditional('PREFERRED_PROVIDER_linux-libc-headers', 'external-toolchain-csl', '', 'linux-libc-headers', d)}"
 RPROVIDES_glibc-dev += "libc-dev libc6-dev virtual-libc-dev"
 PACKAGES_DYNAMIC += "glibc-gconv-*"
 PACKAGES_DYNAMIC += "glibc-locale-*"
@@ -35,7 +36,7 @@ PACKAGES = "\
 	libgcc-dev \
 	libstdc++ \
 	libstdc++-dev \
-	linux-libc-headers \
+	${@base_conditional('PREFERRED_PROVIDER_linux-libc-headers', 'external-toolchain-csl', 'linux-libc-headers', '', d)} \
 	glibc-dbg \
 	glibc \
 	catchsegv \
@@ -200,6 +201,8 @@ LICENSE_libstdc++ = "${CSL_LIC_RLE}"
 LICENSE_libstdc++-dev = "${CSL_LIC_RLE}"
 
 do_install() {
+	RSYNC_OPTS="${@base_conditional('PREFERRED_PROVIDER_linux-libc-headers', 'external-toolchain-csl', '', '--exclude=/include/linux', d)}"
+
 	install -d ${D}${sysconfdir}
 	install -d ${D}${bindir}
 	install -d ${D}${sbindir}
@@ -213,7 +216,7 @@ do_install() {
 	cp -a ${TOOLCHAIN_PATH}/${TARGET_SYS}/libc/etc/* ${D}${sysconfdir}
 	cp -a ${TOOLCHAIN_PATH}/${TARGET_SYS}/libc/sbin/* ${D}${base_sbindir} \
 		|| true
-	cp -a ${TOOLCHAIN_PATH}/${TARGET_SYS}/libc/usr/* ${D}/usr
+	rsync -a ${RSYNC_OPTS} ${TOOLCHAIN_PATH}/${TARGET_SYS}/libc/usr/* ${D}/usr
 	cp -a ${TOOLCHAIN_PATH}/${TARGET_SYS}/include/* ${D}/usr/include
 
 	rm -rf ${D}${bindir}/gdbserver
@@ -222,11 +225,13 @@ do_install() {
 }
 
 do_stage() {
+	RSYNC_OPTS="${@base_conditional('PREFERRED_PROVIDER_linux-libc-headers', 'external-toolchain-csl', '', '--exclude=/linux', d)}"
+
 	install -d ${STAGING_INCDIR}
 	install -d ${STAGING_LIBDIR}
 	install -d ${STAGING_DIR_TARGET}${base_libdir}
 
-	cp -a ${TOOLCHAIN_PATH}/${TARGET_SYS}/libc/usr/include/* ${STAGING_INCDIR}
+	rsync -a ${RSYNC_OPTS} ${TOOLCHAIN_PATH}/${TARGET_SYS}/libc/usr/include/* ${STAGING_INCDIR}
 	cp -a ${TOOLCHAIN_PATH}/${TARGET_SYS}/include/* ${STAGING_INCDIR}
 	cp -a ${TOOLCHAIN_PATH}/${TARGET_SYS}/libc/usr/lib/* ${STAGING_LIBDIR}
 	cp -a ${TOOLCHAIN_PATH}/${TARGET_SYS}/libc/lib/* ${STAGING_DIR_TARGET}${base_libdir}
-- 
1.7.1





More information about the Openembedded-devel mailing list