summaryrefslogtreecommitdiff
path: root/recipes/toolchain/gcc-core.recipe
blob: 632beff2c234587678120fff94cadd1cf78ec534 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python

from cerbero.utils import shell

class Recipe(recipe.Recipe):
    name = 'gcc-core'
    version = '4.9.1'
    package_name = 'gcc-%s' % version
    licenses = [License.GPLv3]
    url = 'http://ftp.gnu.org/gnu/gcc/gcc-4.9.1/gcc-4.9.1.tar.bz2'
    stype = SourceType.TARBALL
    configure_options = '--disable-multilib ' \
                        '--with-sysroot=$CERBERO_PREFIX ' \
                        '--enable-fully-dynamic-string ' \
                        '--enable-libstdcxx-time ' \
                        '--enable-threads=posix ' \
                        '--enable-languages=c,c++ ' \
                        '--enable-sjlj-exceptions ' \
                        '--without-dwarf2 ' \
                        '--enable-libgomp ' \
                        '--disable-nls ' \
                        '--disable-werror ' \
                        '--enable-checking=release ' \
                        '--enable-libgomp ' \
                        '--enable-cloog-backend=isl ' \
                        '--disable-cloog-version-check ' \

    make = 'make all-gcc'
    make_install = 'make install-gcc'
    use_system_libs = True
    requires_non_src_build = True
    add_host_build_target = False
    deps = ['mingw-w64-headers', 'gmp-toolchain', 'mpfr', 'mpc', 'cloog']
    new_env = {'CPP': None}

    def prepare(self):
        self.repo_dir = os.path.join(self.config.local_sources, 'gcc')
        self.build_dir = os.path.join(self.config.sources, 'gcc-%s' %
                                      self.version)
        self.download_path = os.path.join(self.repo_dir, self.tarball_name)

        if self.config.target_arch == Architecture.X86:
            self._target = 'i686-w64-mingw32'
        else:
            self._target = 'x86_64-w64-mingw32'
        self.configure_options += ' --target=%s' % self._target
        if self.config.target_platform == Platform.WINDOWS:
            self.configure_options += ' --host=%s' % self._target
        self.configure_options += ' --oldincludedir=%s/%s/include ' % \
                (self.config.prefix, self._target)
        if self.config.target_platform == Platform.WINDOWS:
            self.allow_parallel_build = False

    def configure(self):
        # Create the winsup directory
        if self.config.target_platform == Platform.WINDOWS:
            winsup = os.path.join(self.build_dir, 'gcc', 'winsup', 'mingw')
            if not os.path.exists(winsup):
                os.makedirs(winsup)
            shell.call('ln -s %s/%s/include include' %
                    (self.config.toolchain_prefix, self.config.host), winsup,
                    fail=False)
        super(Recipe, self).configure()