diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-22 09:37:41 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-23 16:20:13 +0100 |
commit | deae329c3c651766fced7c2317bfcf07de068dff (patch) | |
tree | 5a1b30683b33842b1c5d03618acc83ce91b6d36d /meta/recipes-devtools/gcc/libgcc_4.7.bb | |
parent | 697102321e0aa81ac670464259167315d8b27975 (diff) | |
download | poky-deae329c3c651766fced7c2317bfcf07de068dff.tar.gz |
libgcc: Move common code to libgcc.inc
(From OE-Core rev: 3b627b0a8e91a08a3e2a44c71d312ae303fb5d62)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/libgcc_4.7.bb')
-rw-r--r-- | meta/recipes-devtools/gcc/libgcc_4.7.bb | 144 |
1 files changed, 1 insertions, 143 deletions
diff --git a/meta/recipes-devtools/gcc/libgcc_4.7.bb b/meta/recipes-devtools/gcc/libgcc_4.7.bb index 3b5bb43c00..9716e2e5ba 100644 --- a/meta/recipes-devtools/gcc/libgcc_4.7.bb +++ b/meta/recipes-devtools/gcc/libgcc_4.7.bb | |||
@@ -1,145 +1,3 @@ | |||
1 | require recipes-devtools/gcc/gcc-${PV}.inc | 1 | require recipes-devtools/gcc/gcc-${PV}.inc |
2 | require libgcc.inc | ||
2 | 3 | ||
3 | INHIBIT_DEFAULT_DEPS = "1" | ||
4 | |||
5 | DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" | ||
6 | |||
7 | PACKAGES = "\ | ||
8 | ${PN} \ | ||
9 | ${PN}-dev \ | ||
10 | ${PN}-dbg \ | ||
11 | libgcov-dev \ | ||
12 | " | ||
13 | |||
14 | FILES_${PN} = "${base_libdir}/libgcc*.so.*" | ||
15 | FILES_${PN}-dev = " \ | ||
16 | ${base_libdir}/libgcc*.so \ | ||
17 | ${libdir}/${TARGET_SYS}/${BINV}/*crt* \ | ||
18 | ${libdir}/${TARGET_SYS}/${BINV}/64 \ | ||
19 | ${libdir}/${TARGET_SYS}/${BINV}/32 \ | ||
20 | ${libdir}/${TARGET_SYS}/${BINV}/x32 \ | ||
21 | ${libdir}/${TARGET_SYS}/${BINV}/n32 \ | ||
22 | ${libdir}/${TARGET_SYS}/${BINV}/libgcc*" | ||
23 | FILES_libgcov-dev = " \ | ||
24 | ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \ | ||
25 | " | ||
26 | FILES_${PN}-dbg += "${base_libdir}/.debug/" | ||
27 | |||
28 | do_configure () { | ||
29 | target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` | ||
30 | install -d ${D}${base_libdir} ${D}${libdir} | ||
31 | cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${B} | ||
32 | mkdir -p ${B}/${BPN} | ||
33 | cd ${B}/${BPN} | ||
34 | chmod a+x ${S}/${BPN}/configure | ||
35 | ${S}/${BPN}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} | ||
36 | } | ||
37 | |||
38 | do_compile () { | ||
39 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` | ||
40 | cd ${B}/${BPN} | ||
41 | oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/ | ||
42 | } | ||
43 | |||
44 | do_install () { | ||
45 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` | ||
46 | cd ${B}/${BPN} | ||
47 | oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install | ||
48 | |||
49 | # Move libgcc_s into /lib | ||
50 | mkdir -p ${D}${base_libdir} | ||
51 | if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then | ||
52 | mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir} | ||
53 | else | ||
54 | mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true | ||
55 | fi | ||
56 | |||
57 | # install the runtime in /usr/lib/ not in /usr/lib/gcc on target | ||
58 | # so that cross-gcc can find it in the sysroot | ||
59 | |||
60 | mv ${D}${libdir}/gcc/* ${D}${libdir} | ||
61 | rm -rf ${D}${libdir}/gcc/ | ||
62 | # unwind.h is installed here which is shipped in gcc-cross | ||
63 | # as well as target gcc and they are identical so we dont | ||
64 | # ship one with libgcc here | ||
65 | rm -rf ${D}${libdir}/${TARGET_SYS}/${BINV}/include | ||
66 | } | ||
67 | |||
68 | do_package[depends] += "virtual/${MLPREFIX}libc:do_packagedata" | ||
69 | do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata" | ||
70 | do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata" | ||
71 | do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata" | ||
72 | |||
73 | BBCLASSEXTEND = "nativesdk" | ||
74 | |||
75 | INSANE_SKIP_${PN}-dev = "staticdev" | ||
76 | INSANE_SKIP_${MLPREFIX}libgcov-dev = "staticdev" | ||
77 | |||
78 | addtask multilib_install after do_install before do_package do_populate_sysroot | ||
79 | # this makes multilib gcc files findable for target gcc | ||
80 | # e.g. | ||
81 | # /usr/lib/i586-pokymllib32-linux/4.7/ | ||
82 | # by creating this symlink to it | ||
83 | # /usr/lib64/x86_64-poky-linux/4.7/32 | ||
84 | |||
85 | python do_multilib_install() { | ||
86 | import re | ||
87 | |||
88 | multilibs = d.getVar('MULTILIB_VARIANTS', True) | ||
89 | if not multilibs or bb.data.inherits_class('nativesdk', d): | ||
90 | return | ||
91 | |||
92 | binv = d.getVar('BINV', True) | ||
93 | |||
94 | mlprefix = d.getVar('MLPREFIX', True) | ||
95 | if ('%slibgcc' % mlprefix) != d.getVar('PN', True): | ||
96 | return | ||
97 | |||
98 | if mlprefix: | ||
99 | orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL', True) | ||
100 | orig_tune_params = get_tune_parameters(orig_tune, d) | ||
101 | orig_tune_baselib = orig_tune_params['baselib'] | ||
102 | orig_tune_bitness = orig_tune_baselib.replace('lib', '') | ||
103 | if not orig_tune_bitness: | ||
104 | orig_tune_bitness = '32' | ||
105 | |||
106 | src = '../../../' + orig_tune_baselib + '/' + \ | ||
107 | d.getVar('TARGET_SYS_MULTILIB_ORIGINAL', True) + '/' + binv + '/' | ||
108 | |||
109 | dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \ | ||
110 | d.getVar('TARGET_SYS', True) + '/' + binv + '/' + orig_tune_bitness | ||
111 | |||
112 | if os.path.lexists(dest): | ||
113 | os.unlink(dest) | ||
114 | os.symlink(src, dest) | ||
115 | return | ||
116 | |||
117 | |||
118 | for ml in multilibs.split(): | ||
119 | tune = d.getVar('DEFAULTTUNE_virtclass-multilib-' + ml, True) | ||
120 | if not tune: | ||
121 | bb.warn('DEFAULTTUNE_virtclass-multilib-%s is not defined. Skipping...' % ml) | ||
122 | continue | ||
123 | |||
124 | tune_parameters = get_tune_parameters(tune, d) | ||
125 | tune_baselib = tune_parameters['baselib'] | ||
126 | if not tune_baselib: | ||
127 | bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune) | ||
128 | continue | ||
129 | |||
130 | tune_arch = tune_parameters['arch'] | ||
131 | tune_bitness = tune_baselib.replace('lib', '') | ||
132 | if not tune_bitness: | ||
133 | tune_bitness = '32' # /lib => 32bit lib | ||
134 | |||
135 | src = '../../../' + tune_baselib + '/' + \ | ||
136 | tune_arch + d.getVar('TARGET_VENDOR', True) + 'ml' + ml + \ | ||
137 | '-' + d.getVar('TARGET_OS', True) + '/' + binv + '/' | ||
138 | |||
139 | dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \ | ||
140 | d.getVar('TARGET_SYS', True) + '/' + binv + '/' + tune_bitness | ||
141 | |||
142 | if os.path.lexists(dest): | ||
143 | os.unlink(dest) | ||
144 | os.symlink(src, dest) | ||
145 | } | ||