diff options
Diffstat (limited to 'toolchain-layer/recipes-devtools/binutils/binutils.inc')
| -rw-r--r-- | toolchain-layer/recipes-devtools/binutils/binutils.inc | 149 |
1 files changed, 149 insertions, 0 deletions
diff --git a/toolchain-layer/recipes-devtools/binutils/binutils.inc b/toolchain-layer/recipes-devtools/binutils/binutils.inc new file mode 100644 index 0000000000..f8fc7b8898 --- /dev/null +++ b/toolchain-layer/recipes-devtools/binutils/binutils.inc | |||
| @@ -0,0 +1,149 @@ | |||
| 1 | SUMMARY = "A GNU collection of binary utilities" | ||
| 2 | DESCRIPTION = "The GNU Binutils are a collection of binary tools. \ | ||
| 3 | The main ones are ld (GNU Linker), and as (GNU Assembler). This \ | ||
| 4 | package also includes addition tools such as addr2line (Converts \ | ||
| 5 | addresses into filenames and line numbers), ar (utility for creating, \ | ||
| 6 | modifying and extracting archives), nm (list symbols in object \ | ||
| 7 | files), objcopy (copy and translate object files), objdump (Display \ | ||
| 8 | object information), and other tools and related libraries." | ||
| 9 | HOMEPAGE = "http://www.gnu.org/software/binutils/" | ||
| 10 | BUGTRACKER = "http://sourceware.org/bugzilla/" | ||
| 11 | SECTION = "devel" | ||
| 12 | LICENSE = "GPLv3" | ||
| 13 | |||
| 14 | DEPENDS = "flex-native bison-native" | ||
| 15 | |||
| 16 | inherit autotools gettext | ||
| 17 | |||
| 18 | PACKAGES += "${PN}-symlinks" | ||
| 19 | |||
| 20 | FILES_${PN} = " \ | ||
| 21 | ${bindir}/${TARGET_PREFIX}* \ | ||
| 22 | ${libdir}/lib*-*.so \ | ||
| 23 | ${prefix}/${TARGET_SYS}/bin/*" | ||
| 24 | |||
| 25 | FILES_${PN}-dev = " \ | ||
| 26 | ${includedir} \ | ||
| 27 | ${libdir}/*.a \ | ||
| 28 | ${libdir}/*.la \ | ||
| 29 | ${libdir}/libbfd.so \ | ||
| 30 | ${libdir}/libopcodes.so" | ||
| 31 | |||
| 32 | FILES_${PN}-symlinks = " \ | ||
| 33 | ${bindir}/addr2line \ | ||
| 34 | ${bindir}/as \ | ||
| 35 | ${bindir}/c++filt \ | ||
| 36 | ${bindir}/gprof \ | ||
| 37 | ${bindir}/ld \ | ||
| 38 | ${bindir}/nm \ | ||
| 39 | ${bindir}/objcopy \ | ||
| 40 | ${bindir}/objdump \ | ||
| 41 | ${bindir}/ranlib \ | ||
| 42 | ${bindir}/readelf \ | ||
| 43 | ${bindir}/size \ | ||
| 44 | ${bindir}/strip" | ||
| 45 | |||
| 46 | B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" | ||
| 47 | |||
| 48 | EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \ | ||
| 49 | --enable-install-libbfd \ | ||
| 50 | --enable-shared" | ||
| 51 | |||
| 52 | EXTRA_OECONF_virtclass-native = "--enable-target=all --enable-64-bit-bfd --enable-install-libbfd" | ||
| 53 | |||
| 54 | # This is necessary due to a bug in the binutils Makefiles | ||
| 55 | # EXTRA_OEMAKE = "configure-build-libiberty all" | ||
| 56 | |||
| 57 | export AR = "${HOST_PREFIX}ar" | ||
| 58 | export AS = "${HOST_PREFIX}as" | ||
| 59 | export LD = "${HOST_PREFIX}ld" | ||
| 60 | export NM = "${HOST_PREFIX}nm" | ||
| 61 | export RANLIB = "${HOST_PREFIX}ranlib" | ||
| 62 | export OBJCOPY = "${HOST_PREFIX}objcopy" | ||
| 63 | export OBJDUMP = "${HOST_PREFIX}objdump" | ||
| 64 | |||
| 65 | export AR_FOR_TARGET = "${TARGET_PREFIX}ar" | ||
| 66 | export AS_FOR_TARGET = "${TARGET_PREFIX}as" | ||
| 67 | export LD_FOR_TARGET = "${TARGET_PREFIX}ld" | ||
| 68 | export NM_FOR_TARGET = "${TARGET_PREFIX}nm" | ||
| 69 | export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib" | ||
| 70 | |||
| 71 | export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}" | ||
| 72 | export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}" | ||
| 73 | |||
| 74 | export CC_FOR_BUILD = "${BUILD_CC}" | ||
| 75 | export CPP_FOR_BUILD = "${BUILD_CPP}" | ||
| 76 | export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}" | ||
| 77 | |||
| 78 | do_configure () { | ||
| 79 | (cd ${S}; gnu-configize) || die "Failed to run gnu-configize" | ||
| 80 | oe_runconf | ||
| 81 | # | ||
| 82 | # must prime config.cache to ensure the build of libiberty | ||
| 83 | # | ||
| 84 | mkdir -p ${B}/build-${BUILD_SYS} | ||
| 85 | for i in ${CONFIG_SITE}; do | ||
| 86 | cat $i >> ${B}/build-${BUILD_SYS}/config.cache | ||
| 87 | done | ||
| 88 | } | ||
| 89 | |||
| 90 | do_install () { | ||
| 91 | autotools_do_install | ||
| 92 | |||
| 93 | # We don't really need these, so we'll remove them... | ||
| 94 | rm -rf ${D}${libdir}/ldscripts | ||
| 95 | |||
| 96 | # Fix the /usr/${TARGET_SYS}/bin/* links | ||
| 97 | for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do | ||
| 98 | rm -f $l | ||
| 99 | ln -sf `echo ${prefix}/${TARGET_SYS}/bin \ | ||
| 100 | | tr -s / \ | ||
| 101 | | sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l | ||
| 102 | done | ||
| 103 | |||
| 104 | # Install the libiberty header | ||
| 105 | install -d ${D}${includedir} | ||
| 106 | install -m 644 ${S}/include/ansidecl.h ${D}${includedir} | ||
| 107 | install -m 644 ${S}/include/libiberty.h ${D}${includedir} | ||
| 108 | |||
| 109 | cd ${D}${bindir} | ||
| 110 | |||
| 111 | # Symlinks for ease of running these on the native target | ||
| 112 | for p in ${TARGET_PREFIX}* ; do | ||
| 113 | ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,` | ||
| 114 | done | ||
| 115 | |||
| 116 | rm ${D}${bindir}/ar ${D}${bindir}/strings | ||
| 117 | } | ||
| 118 | |||
| 119 | do_install_virtclass-native () { | ||
| 120 | autotools_do_install | ||
| 121 | |||
| 122 | # Install the libiberty header | ||
| 123 | install -d ${D}${includedir} | ||
| 124 | install -m 644 ${S}/include/ansidecl.h ${D}${includedir} | ||
| 125 | install -m 644 ${S}/include/libiberty.h ${D}${includedir} | ||
| 126 | |||
| 127 | # We only want libiberty, libbfd and libopcodes | ||
| 128 | rm -rf ${D}${bindir} | ||
| 129 | rm -rf ${D}${prefix}/${TARGET_SYS} | ||
| 130 | rm -rf ${D}${prefix}/lib/ldscripts | ||
| 131 | rm -rf ${D}${prefix}/share/info | ||
| 132 | rm -rf ${D}${prefix}/share/locale | ||
| 133 | rm -rf ${D}${prefix}/share/man | ||
| 134 | rmdir ${D}${prefix}/share || : | ||
| 135 | rmdir ${D}/${libdir}/gcc-lib || : | ||
| 136 | rmdir ${D}/${libdir}64/gcc-lib || : | ||
| 137 | rmdir ${D}/${libdir} || : | ||
| 138 | rmdir ${D}/${libdir}64 || : | ||
| 139 | } | ||
| 140 | |||
| 141 | pkg_postinst_${PN}-symlinks () { | ||
| 142 | update-alternatives --install ${bindir}/ar ar ${TARGET_SYS}-ar 100 | ||
| 143 | update-alternatives --install ${bindir}/strings strings ${TARGET_SYS}-strings 100 | ||
| 144 | } | ||
| 145 | |||
| 146 | pkg_prerm_${PN}-symlinks () { | ||
| 147 | update-alternatives --remove ar ${TARGET_SYS}-ar | ||
| 148 | update-alternatives --remove strings ${TARGET_SYS}-strings | ||
| 149 | } | ||
