diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-devtools/gcc/gcc-common.inc | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-common.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-common.inc | 99 |
1 files changed, 99 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..5696671e1b --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-common.inc | |||
@@ -0,0 +1,99 @@ | |||
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 texinfo ptest | ||
9 | |||
10 | BPN = "gcc" | ||
11 | |||
12 | def get_gcc_float_setting(bb, d): | ||
13 | if d.getVar('ARMPKGSFX_EABI', True) == "hf" and d.getVar('TRANSLATED_TARGET_ARCH', True) == "arm": | ||
14 | return "--with-float=hard" | ||
15 | if d.getVar('TARGET_FPU', True) in [ 'soft' ]: | ||
16 | return "--with-float=soft" | ||
17 | if d.getVar('TARGET_FPU', True) in [ 'ppc-efd' ]: | ||
18 | return "--enable-e500_double" | ||
19 | return "" | ||
20 | |||
21 | get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}" | ||
22 | |||
23 | def get_gcc_mips_plt_setting(bb, d): | ||
24 | if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d): | ||
25 | return "--with-mips-plt" | ||
26 | return "" | ||
27 | |||
28 | def get_long_double_setting(bb, d): | ||
29 | if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'powerpc', 'powerpc64' ] and d.getVar('TCLIBC', True) in [ 'uclibc', 'glibc' ]: | ||
30 | return "--with-long-double-128" | ||
31 | return "" | ||
32 | |||
33 | def get_gcc_multiarch_setting(bb, d): | ||
34 | target_arch = d.getVar('TRANSLATED_TARGET_ARCH', True) | ||
35 | multiarch_options = { | ||
36 | "i586": "--enable-targets=all", | ||
37 | "powerpc": "--enable-targets=powerpc64", | ||
38 | "mips": "--enable-targets=all", | ||
39 | "sparc": "--enable-targets=all", | ||
40 | } | ||
41 | |||
42 | if bb.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d): | ||
43 | if target_arch in multiarch_options : | ||
44 | return multiarch_options[target_arch] | ||
45 | return "" | ||
46 | |||
47 | # this is used by the multilib setup of gcc | ||
48 | def get_tune_parameters(tune, d): | ||
49 | availtunes = d.getVar('AVAILTUNES', True) | ||
50 | if tune not in availtunes.split(): | ||
51 | bb.error('The tune: %s is not one of the available tunes: %s', tune or None, availtunes) | ||
52 | |||
53 | localdata = bb.data.createCopy(d) | ||
54 | override = ':tune-' + tune | ||
55 | localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override) | ||
56 | bb.data.update_data(localdata) | ||
57 | |||
58 | retdict = {} | ||
59 | retdict['tune'] = tune | ||
60 | retdict['ccargs'] = localdata.getVar('TUNE_CCARGS', True) | ||
61 | retdict['features'] = localdata.getVar('TUNE_FEATURES', True) | ||
62 | # BASELIB is used by the multilib code to change library paths | ||
63 | retdict['baselib'] = localdata.getVar('BASE_LIB', True) or localdata.getVar('BASELIB', True) | ||
64 | retdict['arch'] = localdata.getVar('TUNE_ARCH', True) | ||
65 | retdict['abiextension'] = localdata.getVar('ABIEXTENSION', True) | ||
66 | retdict['target_fpu'] = localdata.getVar('TARGET_FPU', True) | ||
67 | retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH', True) | ||
68 | retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS', True) | ||
69 | return retdict | ||
70 | |||
71 | get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS" | ||
72 | |||
73 | DEBIANNAME_${MLPREFIX}libgcc = "libgcc1" | ||
74 | |||
75 | MIRRORS =+ "\ | ||
76 | ${GNU_MIRROR}/gcc ftp://gcc.gnu.org/pub/gcc/releases/ \n \ | ||
77 | ${GNU_MIRROR}/gcc ftp://gd.tuwien.ac.at/gnu/gcc/ \n \ | ||
78 | ${GNU_MIRROR}/gcc http://mirrors.rcn.net/pub/sourceware/gcc/releases/ \n \ | ||
79 | ${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \ | ||
80 | ${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \ | ||
81 | " | ||
82 | # | ||
83 | # Set some default values | ||
84 | # | ||
85 | gcclibdir = "${libdir}/gcc" | ||
86 | BINV = "${PV}" | ||
87 | #S = "${WORKDIR}/gcc-${PV}" | ||
88 | S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" | ||
89 | B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}" | ||
90 | |||
91 | target_includedir ?= "${includedir}" | ||
92 | target_libdir ?= "${libdir}" | ||
93 | target_base_libdir ?= "${base_libdir}" | ||
94 | target_prefix ?= "${prefix}" | ||
95 | |||
96 | # We need to ensure that for the shared work directory, the do_patch signatures match | ||
97 | # The real WORKDIR location isn't a dependency for the shared workdir. | ||
98 | src_patches[vardepsexclude] = "WORKDIR" | ||
99 | should_apply[vardepsexclude] += "PN" | ||