]> code.ossystems Code Review - openembedded-core.git/commitdiff
linux-tools: don't build perf when GPLv3 in INCOMPATIBLE_LICENSE
authorJoshua Lock <josh@linux.intel.com>
Tue, 24 Jan 2012 22:10:30 +0000 (14:10 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 26 Jan 2012 20:47:21 +0000 (20:47 +0000)
As binutils is required by perf to build and is GPLv3 licensed adding
GPLv3 to INCOMPATIBLE_LICENSE will cause linux-yocto to be skipped.

Long term we should look at moving perf to a separate recipe but as a
short term solution this patch will ensure that when GPLv3 is in
INCOMPATIBLE_LICENSE perf is not built and it's dependencies are not
added to build.

Fixes [YOCTO #1879]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
meta/recipes-kernel/linux/linux-tools.inc
meta/recipes-kernel/linux/linux-yocto_2.6.37.bb
meta/recipes-kernel/linux/linux-yocto_3.0.bb

index aa45dba3062d4a8e0c2379c7f5c62e328750c487..b667421fb10c4edf9470a29846dd17f18dfac216 100644 (file)
@@ -1,17 +1,27 @@
 # included by kernel recipes if they want to build/provide
 # perf functionality from their tree.
-do_compile_perf_libc-uclibc () {
-       :
-}
-do_install_perf_libc-uclibc () {
-       :
+
+BUILDPERF = "yes"
+BUILDPERF_libc-uclibc = "no"
+# perf requires binutils which is GPLv3 licensed, don't prevent the entire kernel
+# being built if GPLv3 is in INCOMPATIBLE_LICENSE
+python () {
+    if ((d.getVar("INCOMPATIBLE_LICENSE", True) or "").find("GPLv3") != -1):
+       # GPLv3, drop perf
+       d.setVar("BUILDPERF", "no")
+       d.setVar("PERFDEPENDS", "")
 }
-do_compile_perf() {
+
+do_compile_perf () {
+    if [ "${BUILDPERF}" = "yes" ]; then
        oe_runmake -C ${S}/tools/perf CC="${CC}" LD="${LD}" prefix=${prefix} NO_NEWT=1 NO_DWARF=1
+    fi
 }
 
-fakeroot do_install_perf() {
+fakeroot do_install_perf () {
+    if [ "${BUILDPERF}" = "yes" ]; then
        oe_runmake -C ${S}/tools/perf CC="${CC}" LD="${LD}" prefix=${prefix} DESTDIR=${D} install NO_NEWT=1 NO_DWARF=1
+    fi
 }
 
 
@@ -26,5 +36,6 @@ PERFDEPENDS = "virtual/${MLPREFIX}libc:do_populate_sysroot ${MLPREFIX}elfutils:d
 PERFDEPENDS_libc-uclibc = ""
 PERFRDEPENDS = "python perl elfutils"
 PERFRDEPENDS_libc-uclibc = ""
+
 do_compile_perf[depends] = "${PERFDEPENDS}"
 RDEPENDS_perf += "${PERFRDEPENDS}"
index 34e563cffd4a9bb7365ea86a286a80fd159f8c02..ce7139352c648ff7e5697058ee18fbe22d783597 100644 (file)
@@ -20,7 +20,7 @@ SRCREV_machine_qemux86-64 = "af2bfbe5f757361b5b027a24d67a93bfdfaaf33c"
 SRCREV_machine = "4ae8f8605c81c39b959948e23f7123294a5dfb3f"
 SRCREV_meta = "aeea99683c7283f1f3320bf2ee7085ee252d4e7e"
 
-PR = "r21"
+PR = "r22"
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
 SRC_URI = "git://git.yoctoproject.org/linux-yocto-2.6.37;protocol=git;nocheckout=1;branch=${KBRANCH},meta;name=machine,meta"
index 10859e70666dc7cfe0310019fdd1afd5f1f0ccb3..9d51bd017c1dc3622c6bc0e47e1af81fcf67a459 100644 (file)
@@ -21,7 +21,7 @@ SRCREV_machine_qemux86-64 ?= "3551fd0412965b1f6b0b2f6ba35f7fecdaddb58a"
 SRCREV_machine ?= "6f5b11830deba4a6262c8c4abf67e608924f649e"
 SRCREV_meta ?= "665fea1c249b4f335cb1c9a46a9f2c138d611f1a"
 
-PR = "r2"
+PR = "r3"
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
 SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.0;protocol=git;nocheckout=1;branch=${KBRANCH},meta;name=machine,meta"