summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/binutils/binutils.inc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/binutils/binutils.inc')
-rw-r--r--recipes-devtools/binutils/binutils.inc151
1 files changed, 0 insertions, 151 deletions
diff --git a/recipes-devtools/binutils/binutils.inc b/recipes-devtools/binutils/binutils.inc
deleted file mode 100644
index 79e2a12..0000000
--- a/recipes-devtools/binutils/binutils.inc
+++ /dev/null
@@ -1,151 +0,0 @@
1SUMMARY = "GNU 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 zlib-native gnu-config-native autoconf-native"
15
16inherit autotools gettext multilib_header texinfo
17
18FILES_${PN} = " \
19 ${bindir}/${TARGET_PREFIX}* \
20 ${libdir}/lib*-*.so \
21 ${prefix}/${TARGET_SYS}/bin/* \
22 ${bindir}/embedspu"
23
24RPROVIDES_${PN} += "${PN}-symlinks"
25
26FILES_${PN}-dev = " \
27 ${includedir} \
28 ${libdir}/*.la \
29 ${libdir}/libbfd.so \
30 ${libdir}/libopcodes.so"
31
32# Rather than duplicating multiple entries for these, make one
33# list and reuse it.
34
35USE_ALTERNATIVES_FOR = " \
36 addr2line \
37 ar \
38 as \
39 c++filt \
40 elfedit \
41 gprof \
42 ld \
43 ld.bfd \
44 ld.gold dwp \
45 nm \
46 objcopy \
47 objdump \
48 ranlib \
49 readelf \
50 size \
51 strings \
52 strip \
53"
54
55python do_package_prepend() {
56 make_alts = d.getVar("USE_ALTERNATIVES_FOR", True) or ""
57 prefix = d.getVar("TARGET_PREFIX", True)
58 bindir = d.getVar("bindir", True)
59 for alt in make_alts.split():
60 d.setVarFlag('ALTERNATIVE_TARGET', alt, bindir + "/" + prefix + alt)
61 d.setVarFlag('ALTERNATIVE_LINK_NAME', alt, bindir + "/" + alt)
62}
63
64B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
65
66EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
67 --disable-werror \
68 --enable-plugins \
69 ${LDGOLD} \
70 ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}"
71
72LDGOLD_class-native = ""
73LDGOLD_class-crosssdk = ""
74LDGOLD ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '--enable-gold --enable-ld=default', d)}"
75
76# This is necessary due to a bug in the binutils Makefiles
77# EXTRA_OEMAKE = "configure-build-libiberty all"
78
79export AR = "${HOST_PREFIX}ar"
80export AS = "${HOST_PREFIX}as"
81export LD = "${HOST_PREFIX}ld"
82export NM = "${HOST_PREFIX}nm"
83export RANLIB = "${HOST_PREFIX}ranlib"
84export OBJCOPY = "${HOST_PREFIX}objcopy"
85export OBJDUMP = "${HOST_PREFIX}objdump"
86
87export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
88export AS_FOR_TARGET = "${TARGET_PREFIX}as"
89export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
90export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
91export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
92
93export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
94export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
95
96# autotools.bbclass sets the _FOR_BUILD variables, but for some reason we need
97# to unset LD_LIBRARY_PATH.
98export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}"
99
100MULTIARCH := "${@bb.utils.contains("DISTRO_FEATURES", "multiarch", "yes", "no", d)}"
101do_configure[vardeps] += "MULTIARCH"
102do_configure () {
103 (cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
104 oe_runconf
105#
106# must prime config.cache to ensure the build of libiberty
107#
108 mkdir -p ${B}/build-${BUILD_SYS}
109 for i in ${CONFIG_SITE}; do
110 cat $i >> ${B}/build-${BUILD_SYS}/config.cache || true
111 done
112}
113
114do_install () {
115 autotools_do_install
116
117 # We don't really need these, so we'll remove them...
118 rm -rf ${D}${libdir}/ldscripts
119
120 # Fix the /usr/${TARGET_SYS}/bin/* links
121 for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do
122 rm -f $l
123 ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
124 | tr -s / \
125 | sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
126 done
127
128 # Install the libiberty header
129 install -d ${D}${includedir}
130 install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
131 install -m 644 ${S}/include/libiberty.h ${D}${includedir}
132
133 cd ${D}${bindir}
134
135 # Symlinks for ease of running these on the native target
136 for p in ${TARGET_PREFIX}* ; do
137 ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,`
138 done
139
140 for alt in ${USE_ALTERNATIVES_FOR}; do
141 rm -f ${D}${bindir}/$alt
142 done
143
144 oe_multilib_header bfd.h
145}
146
147inherit update-alternatives
148
149ALTERNATIVE_PRIORITY = "100"
150
151ALTERNATIVE_${PN}_class-target = "${USE_ALTERNATIVES_FOR}"