blob: e4fd4d6f70f8d7ee0b81a63cdb9f05c2c7bef62b [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "GNU cc and gcc C compilers"
2HOMEPAGE = "http://www.gnu.org/software/gcc/"
3SECTION = "devel"
4LICENSE = "GPL"
5
6NATIVEDEPS = ""
7
8inherit autotools gettext texinfo
9
10BPN = "gcc"
11
12def 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
21get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}"
22
23def 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
Patrick Williamsf1e5d692016-03-30 15:21:19 -050028def get_gcc_ppc_plt_settings(bb, d):
29 if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'powerpc' ] and not bb.utils.contains('DISTRO_FEATURES', 'bssplt', True, False, d):
30 return "--enable-secureplt"
31 return ""
32
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033def get_long_double_setting(bb, d):
34 if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'powerpc', 'powerpc64' ] and d.getVar('TCLIBC', True) in [ 'uclibc', 'glibc' ]:
35 return "--with-long-double-128"
36 return ""
37
38def get_gcc_multiarch_setting(bb, d):
39 target_arch = d.getVar('TRANSLATED_TARGET_ARCH', True)
40 multiarch_options = {
41 "i586": "--enable-targets=all",
42 "i686": "--enable-targets=all",
43 "powerpc": "--enable-targets=powerpc64",
44 "mips": "--enable-targets=all",
45 "sparc": "--enable-targets=all",
46 }
47
48 if bb.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d):
49 if target_arch in multiarch_options :
50 return multiarch_options[target_arch]
51 return ""
52
53# this is used by the multilib setup of gcc
54def get_tune_parameters(tune, d):
55 availtunes = d.getVar('AVAILTUNES', True)
56 if tune not in availtunes.split():
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050057 bb.error('The tune: %s is not one of the available tunes: %s' % (tune or None, availtunes))
Patrick Williamsc124f4f2015-09-15 14:41:29 -050058
59 localdata = bb.data.createCopy(d)
60 override = ':tune-' + tune
61 localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override)
62 bb.data.update_data(localdata)
63
64 retdict = {}
65 retdict['tune'] = tune
66 retdict['ccargs'] = localdata.getVar('TUNE_CCARGS', True)
67 retdict['features'] = localdata.getVar('TUNE_FEATURES', True)
68 # BASELIB is used by the multilib code to change library paths
69 retdict['baselib'] = localdata.getVar('BASE_LIB', True) or localdata.getVar('BASELIB', True)
70 retdict['arch'] = localdata.getVar('TUNE_ARCH', True)
71 retdict['abiextension'] = localdata.getVar('ABIEXTENSION', True)
72 retdict['target_fpu'] = localdata.getVar('TARGET_FPU', True)
73 retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH', True)
74 retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS', True)
75 return retdict
76
77get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS"
78
79DEBIANNAME_${MLPREFIX}libgcc = "libgcc1"
80
81MIRRORS =+ "\
82${GNU_MIRROR}/gcc ftp://gcc.gnu.org/pub/gcc/releases/ \n \
83${GNU_MIRROR}/gcc ftp://gd.tuwien.ac.at/gnu/gcc/ \n \
84${GNU_MIRROR}/gcc http://mirrors.rcn.net/pub/sourceware/gcc/releases/ \n \
85${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \
86${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \
87"
88#
89# Set some default values
90#
91gcclibdir = "${libdir}/gcc"
92BINV = "${PV}"
93#S = "${WORKDIR}/gcc-${PV}"
94S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
95B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
96
97target_includedir ?= "${includedir}"
98target_libdir ?= "${libdir}"
99target_base_libdir ?= "${base_libdir}"
100target_prefix ?= "${prefix}"
101
102# We need to ensure that for the shared work directory, the do_patch signatures match
103# The real WORKDIR location isn't a dependency for the shared workdir.
104src_patches[vardepsexclude] = "WORKDIR"
105should_apply[vardepsexclude] += "PN"