binutils-cross: Do not install libibery.a in wrong place
authorKhem Raj <raj.khem@gmail.com>
Wed, 9 Sep 2009 03:45:43 +0000 (20:45 -0700)
committerKhem Raj <raj.khem@gmail.com>
Fri, 11 Sep 2009 02:26:08 +0000 (19:26 -0700)
* This interferes with canadian cross build of binutils
  because it finds cross libiberty.a where as it needs the
  target one.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
recipes/binutils/binutils-cross.inc
recipes/binutils/binutils_cvs.bb

index 384d18c..5808c1f 100644 (file)
@@ -22,13 +22,6 @@ do_stage () {
        rmdir ${CROSS_DIR}/${libdir} || :
        rmdir ${CROSS_DIR}/${libdir}64 || :
        rmdir ${CROSS_DIR}/${prefix} || :
-
-       # We want to move this into the target specific location
-       mkdir -p ${STAGING_DIR_TARGET}/lib
-       mv -f ${CROSS_DIR}/lib/libiberty.a ${STAGING_DIR_TARGET}/lib || \
-               mv -f ${CROSS_DIR}/lib64/libiberty.a ${STAGING_DIR_TARGET}/lib
-       rmdir ${CROSS_DIR}/lib || :
-       rmdir ${CROSS_DIR}/lib64 || :
 }
 
 do_install () {
index ad4dd2b..88dcd78 100644 (file)
@@ -21,8 +21,34 @@ do_compile () {
        oe_runmake all-ld all-binutils all-gas
 }
 do_install () {
-       oe_runmake install-ld install-binutils install-gas
+        autotools_do_install install-ld install-binutils install-gas
+
+        # We don't really need these, so we'll remove them...
+        rm -rf ${D}${libdir}/ldscripts
+
+        # Fix the /usr/${TARGET_SYS}/bin/* links
+        for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do
+                rm -f $l
+                ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
+                        | tr -s / \
+                        | sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
+        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}
+
+        cd ${D}${bindir}
+
+        # Symlinks for ease of running these on the native target
+        for p in ${TARGET_SYS}-* ; do
+                ln -sf $p `echo $p | sed -e s,${TARGET_SYS}-,,`
+        done
+
+        rm ${D}${bindir}/ar ${D}${bindir}/strings
 }
+
 do_stage () {
         oe_libinstall -so -a -C opcodes libopcodes ${STAGING_LIBDIR}/
         oe_libinstall -a -C libiberty libiberty ${STAGING_LIBDIR}/