diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-common.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-common.inc | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc new file mode 100644 index 0000000000..d5155fea02 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-common.inc | |||
@@ -0,0 +1,126 @@ | |||
1 | SUMMARY = "GNU cc and gcc C compilers" | ||
2 | HOMEPAGE = "http://www.gnu.org/software/gcc/" | ||
3 | SECTION = "devel" | ||
4 | LICENSE = "GPL" | ||
5 | |||
6 | NATIVEDEPS = "" | ||
7 | |||
8 | inherit autotools gettext ptest | ||
9 | |||
10 | def get_gcc_fpu_setting(bb, d): | ||
11 | if d.getVar('ARMPKGSFX_EABI', True) == "hf" and d.getVar('TRANSLATED_TARGET_ARCH', True) == "arm": | ||
12 | return "--with-float=hard" | ||
13 | if d.getVar('TARGET_FPU', True) in [ 'soft' ]: | ||
14 | return "--with-float=soft" | ||
15 | if d.getVar('TARGET_FPU', True) in [ 'ppc-efd' ]: | ||
16 | return "--enable-e500_double" | ||
17 | return "" | ||
18 | |||
19 | get_gcc_fpu_setting[vardepvalue] = "${@get_gcc_fpu_setting(bb, d)}" | ||
20 | |||
21 | def get_gcc_mips_plt_setting(bb, d): | ||
22 | if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'mips', 'mipsel' ] and oe.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d): | ||
23 | return "--with-mips-plt" | ||
24 | return "" | ||
25 | |||
26 | def get_gcc_multiarch_setting(bb, d): | ||
27 | target_arch = d.getVar('TRANSLATED_TARGET_ARCH', True) | ||
28 | multiarch_options = { | ||
29 | "i586": "--enable-targets=all", | ||
30 | "powerpc": "--enable-targets=powerpc64", | ||
31 | "mips": "--enable-targets=all", | ||
32 | "sparc": "--enable-targets=all", | ||
33 | } | ||
34 | |||
35 | if oe.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d): | ||
36 | if target_arch in multiarch_options : | ||
37 | return multiarch_options[target_arch] | ||
38 | return "" | ||
39 | |||
40 | # this is used by the multilib setup of gcc | ||
41 | def get_tune_parameters(tune, d): | ||
42 | availtunes = d.getVar('AVAILTUNES', True) | ||
43 | if tune not in availtunes.split(): | ||
44 | bb.error('The tune: %s is not one of the available tunes: %s', tune or None, availtunes) | ||
45 | |||
46 | localdata = bb.data.createCopy(d) | ||
47 | override = ':tune-' + tune | ||
48 | localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override) | ||
49 | bb.data.update_data(localdata) | ||
50 | |||
51 | retdict = {} | ||
52 | retdict['tune'] = tune | ||
53 | retdict['ccargs'] = localdata.getVar('TUNE_CCARGS', True) | ||
54 | retdict['features'] = localdata.getVar('TUNE_FEATURES', True) | ||
55 | # BASELIB is used by the multilib code to change library paths | ||
56 | retdict['baselib'] = localdata.getVar('BASE_LIB', True) or localdata.getVar('BASELIB', True) | ||
57 | retdict['arch'] = localdata.getVar('TUNE_ARCH', True) | ||
58 | retdict['abiextension'] = localdata.getVar('ABIEXTENSION', True) | ||
59 | retdict['target_fpu'] = localdata.getVar('TARGET_FPU', True) | ||
60 | retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH', True) | ||
61 | retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS', True) | ||
62 | return retdict | ||
63 | |||
64 | get_tune_parameters[vardepsexclude] = "AVAILTUNES" | ||
65 | |||
66 | DEBIANNAME_${MLPREFIX}libgcc = "libgcc1" | ||
67 | |||
68 | MIRRORS =+ "\ | ||
69 | ${GNU_MIRROR}/gcc ftp://gcc.gnu.org/pub/gcc/releases/ \n \ | ||
70 | ${GNU_MIRROR}/gcc ftp://gd.tuwien.ac.at/gnu/gcc/ \n \ | ||
71 | ${GNU_MIRROR}/gcc http://mirrors.rcn.net/pub/sourceware/gcc/releases/ \n \ | ||
72 | ${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \ | ||
73 | ${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \ | ||
74 | " | ||
75 | |||
76 | # | ||
77 | # Set some default values | ||
78 | # | ||
79 | gcclibdir = "${libdir}/gcc" | ||
80 | BINV = "${PV}" | ||
81 | #S = "${WORKDIR}/gcc-${PV}" | ||
82 | S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" | ||
83 | B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}" | ||
84 | |||
85 | # SS means Shared Stamps directory | ||
86 | SS = "${TMPDIR}/stamps/work-shared/gcc-${PV}-${PR}" | ||
87 | do_fetch[stamp-base] = "${SS}" | ||
88 | do_unpack[stamp-base] = "${SS}" | ||
89 | do_patch[stamp-base] = "${SS}" | ||
90 | SSCLEAN = "${TMPDIR}/stamps/work-shared/gcc-[0-9]*-*" | ||
91 | do_fetch[stamp-base-clean] = "${SSCLEAN}" | ||
92 | do_unpack[stamp-base-clean] = "${SSCLEAN}" | ||
93 | do_unpack[umask] = "022" | ||
94 | do_patch[stamp-base-clean] = "${SSCLEAN}" | ||
95 | |||
96 | # SW means Shared Work directory | ||
97 | SW = "${TMPDIR}/work-shared/gcc-${PV}-${PR}" | ||
98 | SSTATE_SWSPEC = "sstate:gcc::${PV}:${PR}::${SSTATE_VERSION}:" | ||
99 | WORKDIR_task-unpack = "${SW}" | ||
100 | WORKDIR_task-patch = "${SW}" | ||
101 | |||
102 | target_includedir ?= "${includedir}" | ||
103 | target_libdir ?= "${libdir}" | ||
104 | target_base_libdir ?= "${base_libdir}" | ||
105 | target_prefix ?= "${prefix}" | ||
106 | |||
107 | CLEANFUNCS += "workshared_clean" | ||
108 | # The do_clean should be exclusive since share ${S} | ||
109 | do_clean[lockfiles] = "${SW}.clean.lock" | ||
110 | |||
111 | python workshared_clean () { | ||
112 | """clear the source directory""" | ||
113 | dir = d.expand("${SW}") | ||
114 | bb.note("Removing " + dir) | ||
115 | oe.path.remove(dir) | ||
116 | |||
117 | """clear the the stamps in work-shared""" | ||
118 | dir = "%s.*" % bb.data.expand(d.getVarFlag('do_fetch', 'stamp-base', True), d) | ||
119 | bb.note("Removing " + dir) | ||
120 | oe.path.remove(dir) | ||
121 | } | ||
122 | |||
123 | # We need to ensure that for the shared work directory, the do_patch singatures match | ||
124 | # The real WORKDIR location isn't a dependency for the shared workdir. | ||
125 | src_patches[vardepsexclude] = "WORKDIR" | ||
126 | should_apply[vardepsexclude] += "PN" | ||