easyblock = 'EB_GCC'

name = 'GCCcore'
version = '4.9.4'

homepage = 'http://gcc.gnu.org/'
description = """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada,
 as well as libraries for these languages (libstdc++, libgcj,...)."""

toolchain = {'name': 'dummy', 'version': ''}

mpfr_version = '3.1.4'

source_urls = [
    'http://ftpmirror.gnu.org/gcc/gcc-%s' % version,  # GCC auto-resolving HTTP mirror
    'http://ftpmirror.gnu.org/gmp',  # idem for GMP
    'http://ftpmirror.gnu.org/mpfr',  # idem for MPFR
    'http://www.multiprecision.org/mpc/download',  # MPC official
]
sources = [
    'gcc-%(version)s.tar.bz2',
    'gmp-6.1.1.tar.bz2',
    'mpfr-%s.tar.gz' % mpfr_version,
    'mpc-1.0.3.tar.gz',
]

builddependencies = [
    ('Autotools', '20150215'),
    ('binutils', '2.25'),
]

patches = [('mpfr-%s-allpatches-20160601.patch' % mpfr_version, '../mpfr-%s' % mpfr_version)]

checksums = [
    '87c24a4090c1577ba817ec6882602491',     # gcc-4.9.4.tar.bz2
    '4c175f86e11eb32d8bf9872ca3a8e11d',     # gmp-6.1.1.tar.bz2
    '482ab3c120ffc959f631b4ba9ec59a46',     # mpfr-3.1.4.tar.gz
    'd6a1d5f8ddea3abd2cc3e98f58352d26',     # mpc-1.0.3.tar.gz
    '22164533561142b70fda09af4e775acc',     # mpfr-3.1.4-allpatches-20160601.patch
]

languages = ['c', 'c++', 'fortran']

# building GCC sometimes fails if make parallelism is too high, so let's limit it
maxparallel = 4

moduleclass = 'compiler'
