diff options
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils.inc')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils.inc | 67 |
1 files changed, 41 insertions, 26 deletions
diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc index 5e78dc03df..05cbc6f3be 100644 --- a/meta/recipes-devtools/binutils/binutils.inc +++ b/meta/recipes-devtools/binutils/binutils.inc | |||
@@ -22,31 +22,49 @@ FILES_${PN} = " \ | |||
22 | ${libdir}/lib*-*.so \ | 22 | ${libdir}/lib*-*.so \ |
23 | ${prefix}/${TARGET_SYS}/bin/*" | 23 | ${prefix}/${TARGET_SYS}/bin/*" |
24 | 24 | ||
25 | # Use alternatives rather than actual symlinks. | ||
26 | FILES_${PN}-symlinks = "" | ||
27 | |||
28 | ALLOW_EMPTY_${PN}-symlinks = "1" | ||
29 | |||
25 | FILES_${PN}-dev = " \ | 30 | FILES_${PN}-dev = " \ |
26 | ${includedir} \ | 31 | ${includedir} \ |
27 | ${libdir}/*.la \ | 32 | ${libdir}/*.la \ |
28 | ${libdir}/libbfd.so \ | 33 | ${libdir}/libbfd.so \ |
29 | ${libdir}/libopcodes.so" | 34 | ${libdir}/libopcodes.so" |
30 | 35 | ||
31 | FILES_${PN}-symlinks = " \ | 36 | # Rather than duplicating multiple entries for these, make one |
32 | ${bindir}/addr2line \ | 37 | # list and reuse it. |
33 | ${bindir}/as \ | 38 | |
34 | ${bindir}/c++filt \ | 39 | USE_ALTERNATIVES_FOR = " \ |
35 | ${bindir}/embedspu \ | 40 | addr2line \ |
36 | ${bindir}/gprof \ | 41 | ar \ |
37 | ${bindir}/ld \ | 42 | as \ |
38 | ${bindir}/ld.bfd \ | 43 | c++filt \ |
39 | ${bindir}/ld.gold \ | 44 | elfedit \ |
40 | ${bindir}/nm \ | 45 | gprof \ |
41 | ${bindir}/objcopy \ | 46 | ld \ |
42 | ${bindir}/objdump \ | 47 | ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', 'ld.gold', 'ld.bfd', d)} \ |
43 | ${bindir}/ranlib \ | 48 | nm \ |
44 | ${bindir}/readelf \ | 49 | objcopy \ |
45 | ${bindir}/elfedit \ | 50 | objdump \ |
46 | ${bindir}/size \ | 51 | ranlib \ |
47 | ${bindir}/strip" | 52 | readelf \ |
48 | 53 | size \ | |
49 | FILES_${PN}-dbg += "${prefix}/${TARGET_SYS}/bin/.debug" | 54 | strings \ |
55 | strip \ | ||
56 | " | ||
57 | |||
58 | python do_package_prepend() { | ||
59 | make_alts = d.getVar("USE_ALTERNATIVES_FOR", True) or "" | ||
60 | prefix = d.getVar("TARGET_PREFIX", True) | ||
61 | bindir = d.getVar("bindir", True) | ||
62 | for alt in make_alts.split(): | ||
63 | d.setVarFlag('ALTERNATIVE_TARGET', alt, bindir + "/" + prefix + alt) | ||
64 | d.setVarFlag('ALTERNATIVE_LINK_NAME', alt, bindir + "/" + alt) | ||
65 | } | ||
66 | |||
67 | # FILES_${PN}-dbg = "${prefix}/${TARGET_SYS}/bin/.debug ${prefix}/${libdir}/.debug" | ||
50 | 68 | ||
51 | B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" | 69 | B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" |
52 | 70 | ||
@@ -120,7 +138,9 @@ do_install () { | |||
120 | ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,` | 138 | ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,` |
121 | done | 139 | done |
122 | 140 | ||
123 | rm -f ${D}${bindir}/ar ${D}${bindir}/strings | 141 | for alt in ${USE_ALTERNATIVES_FOR}; do |
142 | rm -f ${D}${bindir}/$alt | ||
143 | done | ||
124 | 144 | ||
125 | oe_multilib_header bfd.h | 145 | oe_multilib_header bfd.h |
126 | } | 146 | } |
@@ -129,10 +149,5 @@ inherit update-alternatives | |||
129 | 149 | ||
130 | ALTERNATIVE_PRIORITY = "100" | 150 | ALTERNATIVE_PRIORITY = "100" |
131 | 151 | ||
132 | ALTERNATIVE_${PN}-symlinks = "ar strings" | 152 | ALTERNATIVE_${PN}-symlinks_class-target = "${USE_ALTERNATIVES_FOR}" |
133 | |||
134 | ALTERNATIVE_LINK_NAME[ar] = "${bindir}/ar" | ||
135 | ALTERNATIVE_TARGET[ar] = "${bindir}/${TARGET_PREFIX}ar" | ||
136 | 153 | ||
137 | ALTERNATIVE_LINK_NAME[strings] = "${bindir}/strings" | ||
138 | ALTERNATIVE_TARGET[strings] = "${bindir}/${TARGET_PREFIX}strings" | ||