Patchwork [v2,2/2] external-toolchain-csl: allow linux-libc-headers

login
register
mail settings
Submitter Ben Gardiner
Date March 2, 2011, 3:05 p.m.
Message ID <9a9ee76e6057e7dfe38af1d77b4ed7ffc9ff3775.1299076392.git.bengardiner@nanometrics.ca>
Download mbox | patch
Permalink /patch/983/
State New, archived
Headers show

Comments

Ben Gardiner - March 2, 2011, 3:05 p.m.
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@nanometrics.ca>
Tested-by: Andrea Galbusera <gizero@gmail.com>

---

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

---
 conf/local.conf.sample                 |    4 ++++
 recipes/meta/external-toolchain-csl.bb |   15 ++++++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)
Phil Blundell - March 2, 2011, 5:50 p.m.
On Wed, 2011-03-02 at 10:05 -0500, Ben Gardiner wrote:
> -	cp -a ${TOOLCHAIN_PATH}/${TARGET_SYS}/libc/usr/include/* ${STAGING_INCDIR}
> +	rsync -a ${RSYNC_OPTS} ${TOOLCHAIN_PATH}/${TARGET_SYS}/libc/usr/include/* ${STAGING_INCDIR}

If you want to exclude some files then it's probably better to use
something like tar --exclude ... -cf - | tar -xf -.  (I think the
--exclude option is in POSIX so any reasonable version of tar ought to
have it.)  Or you could use some sort of "find | grep -v .. | xargs cp"
construct to make a list of the files that you do want to copy.  Either
of those is probably a better option than rsync.

p.

Patch

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}