1 DESCRIPTION = "A GNU collection of binary utilities"
2 HOMEPAGE = "http://www.gnu.org/software/binutils/"
8 COMPATIBLE_TARGET_SYS ?= "(?!nios2)"
10 inherit autotools gettext
12 PACKAGES += "${PN}-symlinks"
15 ${bindir}/${TARGET_PREFIX}* \
17 ${prefix}/${TARGET_SYS}/bin/*"
24 ${libdir}/libopcodes.so"
26 FILES_${PN}-symlinks = " \
40 S = "${WORKDIR}/binutils-${PV}"
41 B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
43 EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
46 # This is necessary due to a bug in the binutils Makefiles
47 EXTRA_OEMAKE = "configure-build-libiberty all"
49 export AR = "${HOST_PREFIX}ar"
50 export AS = "${HOST_PREFIX}as"
51 export LD = "${HOST_PREFIX}ld"
52 export NM = "${HOST_PREFIX}nm"
53 export RANLIB = "${HOST_PREFIX}ranlib"
54 export OBJCOPY = "${HOST_PREFIX}objcopy"
55 export OBJDUMP = "${HOST_PREFIX}objdump"
57 export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
58 export AS_FOR_TARGET = "${TARGET_PREFIX}as"
59 export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
60 export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
61 export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
63 export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
64 export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
66 export CC_FOR_BUILD = "${BUILD_CC}"
67 export CPP_FOR_BUILD = "${BUILD_CPP}"
68 export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
71 (cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
73 # Fix for issues when system's texinfo version >= 4.10
74 # (See https://bugzilla.redhat.com/show_bug.cgi?id=345621)
75 sed -i -e "s@egrep 'texinfo.*'@egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|4.[1-9][0-9]+|[5-9])'@" '${S}/configure'
79 # must prime config.cache to ensure the build of libiberty
81 mkdir -p ${B}/build-${BUILD_SYS}
82 for i in ${CONFIG_SITE}; do
83 cat $i >> ${B}/build-${BUILD_SYS}/config.cache
90 # We don't really need these, so we'll remove them...
91 rm -rf ${D}${libdir}/ldscripts
93 # Fix the /usr/${TARGET_SYS}/bin/* links
94 for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do
96 ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
98 | sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
101 # Install the libiberty header
102 install -d ${D}${includedir}
103 install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
104 install -m 644 ${S}/include/libiberty.h ${D}${includedir}
108 # Symlinks for ease of running these on the native target
109 for p in ${TARGET_PREFIX}* ; do
110 ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,`
113 rm ${D}${bindir}/ar ${D}${bindir}/strings
117 pkg_postinst_${PN}-symlinks () {
118 update-alternatives --install ${bindir}/ar ar ${TARGET_PREFIX}ar 100
119 update-alternatives --install ${bindir}/strings strings ${TARGET_PREFIX}strings 100
123 pkg_prerm_${PN}-symlinks () {
124 update-alternatives --remove ar ${TARGET_PREFIX}ar
125 update-alternatives --remove strings ${TARGET_PREFIX}strings