tsmd: install also a little helper script to control the touchscreen daemon
[openembedded.git] / recipes / binutils / binutils.inc
blobab9e457fb71da1851f833b6d0d623c21918d3b1b
1 DESCRIPTION = "A GNU collection of binary utilities"
2 HOMEPAGE = "http://www.gnu.org/software/binutils/"
3 SECTION = "devel"
4 LICENSE = "GPL"
6 INC_PR = "r13"
8 COMPATIBLE_TARGET_SYS ?= "(?!nios2)"
10 inherit autotools gettext
12 PACKAGES += "${PN}-symlinks"
14 FILES_${PN} = " \
15         ${bindir}/${TARGET_PREFIX}* \
16         ${libdir}/lib*-*.so \
17         ${prefix}/${TARGET_SYS}/bin/*"
19 FILES_${PN}-dev = " \
20         ${includedir} \
21         ${libdir}/*.a \
22         ${libdir}/*.la \
23         ${libdir}/libbfd.so \
24         ${libdir}/libopcodes.so"
26 FILES_${PN}-symlinks = " \
27         ${bindir}/addr2line \
28         ${bindir}/as \
29         ${bindir}/c++filt \
30         ${bindir}/gprof \
31         ${bindir}/ld \
32         ${bindir}/nm \
33         ${bindir}/objcopy \
34         ${bindir}/objdump \
35         ${bindir}/ranlib \
36         ${bindir}/readelf \
37         ${bindir}/size \
38         ${bindir}/strip"
40 S = "${WORKDIR}/binutils-${PV}"
41 B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
43 EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
44                 --enable-shared"
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}"
70 do_configure () {
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'
77         oe_runconf
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
84         done
87 do_install () {
88         autotools_do_install
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
95                 rm -f $l
96                 ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
97                         | tr -s / \
98                         | sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
99         done
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}
106         cd ${D}${bindir}
108         # Symlinks for ease of running these on the native target
109         for p in ${TARGET_SYS}-* ; do
110                 ln -sf $p `echo $p | sed -e s,${TARGET_SYS}-,,`
111         done
113         rm ${D}${bindir}/ar ${D}${bindir}/strings
117 pkg_postinst_${PN}-symlinks () {
118         update-alternatives --install ${bindir}/ar ar ${TARGET_SYS}-ar 100
119         update-alternatives --install ${bindir}/strings strings ${TARGET_SYS}-strings 100
123 pkg_prerm_${PN}-symlinks () {
124         update-alternatives --remove ar ${TARGET_SYS}-ar
125         update-alternatives --remove strings ${TARGET_SYS}-strings