]> code.ossystems Code Review - openembedded-core.git/commitdiff
binutils: Add native version and tweak
authorRichard Purdie <rpurdie@linux.intel.com>
Sat, 24 Jul 2010 00:07:54 +0000 (01:07 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Sat, 24 Jul 2010 00:07:54 +0000 (01:07 +0100)
Enable use of BBCLASSEXTEND to generate a native verison of binutils for the
libiberty, libbfd and libopcodes libs.

Also stop installing useless libs in the cross-canadian recipe.

Partially based on a patch by Mark Hatle <mhatle@windriver.com>.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
meta/packages/binutils/binutils-cross-canadian.inc
meta/packages/binutils/binutils.inc
meta/packages/binutils/binutils_2.20.1.bb

index 23dfa161ebf1e681e43d5301a76d9c008425abad..04fa6e2de08fe28cfa1313d703c0c53f7d931777 100644 (file)
@@ -13,8 +13,10 @@ do_install () {
                ln -sf "${bindir}/`basename $l`" "${D}${prefix}/${TARGET_SYS}/bin/`basename $l | sed -e 's,${TARGET_PREFIX},,'`"
        done
 
-        # Install the libiberty header
-        install -d ${D}${includedir}
-        install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
-        install -m 644 ${S}/include/libiberty.h ${D}${includedir}
+       # We're not interested in the libs or headers, these would come from the 
+       # nativesdk or target version of the binutils recipe
+       rm -f ${D}${libdir}/libbfd*
+       rm -f ${D}${libdir}/libiberty*
+       rm -f ${D}${libdir}/libopcodes*
+       rm -f ${D}${includedir}/*.h
 }
index 98ddbcfdd205c7643d316e0701c4410957cb8240..89c952b1c14b6f67f53915a23a984611fb06b929 100644 (file)
@@ -39,8 +39,11 @@ FILES_${PN}-symlinks = " \
 B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
 
 EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
+               --enable-install-libbfd \
                --enable-shared"
 
+EXTRA_OECONF_virtclass-native = "--enable-target=all --enable-64-bit-bfd --enable-install-libbfd"
+
 # This is necessary due to a bug in the binutils Makefiles
 # EXTRA_OEMAKE = "configure-build-libiberty all"
 
@@ -108,6 +111,27 @@ do_install () {
        rm ${D}${bindir}/ar ${D}${bindir}/strings
 }
 
+do_install_virtclass-native () {
+       autotools_do_install
+
+       # Install the libiberty header
+       install -d ${D}${includedir}
+       install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
+       install -m 644 ${S}/include/libiberty.h ${D}${includedir}
+
+       # We only want libiberty, libbfd and libopcodes
+       rm -rf ${D}${bindir}
+       rm -rf ${D}${prefix}/${TARGET_SYS}
+       rm -rf ${D}${prefix}/lib/ldscripts
+       rm -rf ${D}${prefix}/share/info
+       rm -rf ${D}${prefix}/share/locale
+       rm -rf ${D}${prefix}/share/man
+       rmdir ${D}${prefix}/share || :
+       rmdir ${D}/${libdir}/gcc-lib || :
+       rmdir ${D}/${libdir}64/gcc-lib || :
+       rmdir ${D}/${libdir} || :
+       rmdir ${D}/${libdir}64 || :
+}
 
 pkg_postinst_${PN}-symlinks () {
        update-alternatives --install ${bindir}/ar ar ${TARGET_SYS}-ar 100
index 3197b5efb30ef18f694e043f7aaefaa9add48389..a533bd8bb02db37bb313c5ed456fdb5314747097 100644 (file)
@@ -31,3 +31,5 @@ SRC_URI = "\
 SRC_URI += "\
      file://binutils-2.16.1-e300c2c3.patch \
      "
+
+BBCLASSEXTEND = "native"