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