summaryrefslogtreecommitdiffstats
path: root/toolchain-layer/recipes-devtools/binutils/binutils.inc
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain-layer/recipes-devtools/binutils/binutils.inc')
-rw-r--r--toolchain-layer/recipes-devtools/binutils/binutils.inc149
1 files changed, 0 insertions, 149 deletions
diff --git a/toolchain-layer/recipes-devtools/binutils/binutils.inc b/toolchain-layer/recipes-devtools/binutils/binutils.inc
deleted file mode 100644
index f8fc7b889..000000000
--- a/toolchain-layer/recipes-devtools/binutils/binutils.inc
+++ /dev/null
@@ -1,149 +0,0 @@
1SUMMARY = "A GNU collection of binary utilities"
2DESCRIPTION = "The GNU Binutils are a collection of binary tools. \
3The main ones are ld (GNU Linker), and as (GNU Assembler). This \
4package also includes addition tools such as addr2line (Converts \
5addresses into filenames and line numbers), ar (utility for creating, \
6modifying and extracting archives), nm (list symbols in object \
7files), objcopy (copy and translate object files), objdump (Display \
8object information), and other tools and related libraries."
9HOMEPAGE = "http://www.gnu.org/software/binutils/"
10BUGTRACKER = "http://sourceware.org/bugzilla/"
11SECTION = "devel"
12LICENSE = "GPLv3"
13
14DEPENDS = "flex-native bison-native"
15
16inherit autotools gettext
17
18PACKAGES += "${PN}-symlinks"
19
20FILES_${PN} = " \
21 ${bindir}/${TARGET_PREFIX}* \
22 ${libdir}/lib*-*.so \
23 ${prefix}/${TARGET_SYS}/bin/*"
24
25FILES_${PN}-dev = " \
26 ${includedir} \
27 ${libdir}/*.a \
28 ${libdir}/*.la \
29 ${libdir}/libbfd.so \
30 ${libdir}/libopcodes.so"
31
32FILES_${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
46B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
47
48EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
49 --enable-install-libbfd \
50 --enable-shared"
51
52EXTRA_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
57export AR = "${HOST_PREFIX}ar"
58export AS = "${HOST_PREFIX}as"
59export LD = "${HOST_PREFIX}ld"
60export NM = "${HOST_PREFIX}nm"
61export RANLIB = "${HOST_PREFIX}ranlib"
62export OBJCOPY = "${HOST_PREFIX}objcopy"
63export OBJDUMP = "${HOST_PREFIX}objdump"
64
65export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
66export AS_FOR_TARGET = "${TARGET_PREFIX}as"
67export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
68export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
69export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
70
71export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
72export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
73
74export CC_FOR_BUILD = "${BUILD_CC}"
75export CPP_FOR_BUILD = "${BUILD_CPP}"
76export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
77
78do_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
90do_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
119do_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
141pkg_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
146pkg_prerm_${PN}-symlinks () {
147 update-alternatives --remove ar ${TARGET_SYS}-ar
148 update-alternatives --remove strings ${TARGET_SYS}-strings
149}