blob: d63c07f68a2130b7bed193c1b72d77f04a1634c7 [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
28def 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
33def get_gcc_multiarch_setting(bb, d):
34 target_arch = d.getVar('TRANSLATED_TARGET_ARCH', True)
35 multiarch_options = {
36 "i586": "--enable-targets=all",
37 "i686": "--enable-targets=all",
38 "powerpc": "--enable-targets=powerpc64",
39 "mips": "--enable-targets=all",
40 "sparc": "--enable-targets=all",
41 }
42
43 if bb.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d):
44 if target_arch in multiarch_options :
45 return multiarch_options[target_arch]
46 return ""
47
48# this is used by the multilib setup of gcc
49def get_tune_parameters(tune, d):
50 availtunes = d.getVar('AVAILTUNES', True)
51 if tune not in availtunes.split():
52 bb.error('The tune: %s is not one of the available tunes: %s', tune or None, availtunes)
53
54 localdata = bb.data.createCopy(d)
55 override = ':tune-' + tune
56 localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override)
57 bb.data.update_data(localdata)
58
59 retdict = {}
60 retdict['tune'] = tune
61 retdict['ccargs'] = localdata.getVar('TUNE_CCARGS', True)
62 retdict['features'] = localdata.getVar('TUNE_FEATURES', True)
63 # BASELIB is used by the multilib code to change library paths
64 retdict['baselib'] = localdata.getVar('BASE_LIB', True) or localdata.getVar('BASELIB', True)
65 retdict['arch'] = localdata.getVar('TUNE_ARCH', True)
66 retdict['abiextension'] = localdata.getVar('ABIEXTENSION', True)
67 retdict['target_fpu'] = localdata.getVar('TARGET_FPU', True)
68 retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH', True)
69 retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS', True)
70 return retdict
71
72get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS"
73
74DEBIANNAME_${MLPREFIX}libgcc = "libgcc1"
75
76MIRRORS =+ "\
77${GNU_MIRROR}/gcc ftp://gcc.gnu.org/pub/gcc/releases/ \n \
78${GNU_MIRROR}/gcc ftp://gd.tuwien.ac.at/gnu/gcc/ \n \
79${GNU_MIRROR}/gcc http://mirrors.rcn.net/pub/sourceware/gcc/releases/ \n \
80${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \
81${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \
82"
83#
84# Set some default values
85#
86gcclibdir = "${libdir}/gcc"
87BINV = "${PV}"
88#S = "${WORKDIR}/gcc-${PV}"
89S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
90B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
91
92target_includedir ?= "${includedir}"
93target_libdir ?= "${libdir}"
94target_base_libdir ?= "${base_libdir}"
95target_prefix ?= "${prefix}"
96
97# We need to ensure that for the shared work directory, the do_patch signatures match
98# The real WORKDIR location isn't a dependency for the shared workdir.
99src_patches[vardepsexclude] = "WORKDIR"
100should_apply[vardepsexclude] += "PN"