summaryrefslogtreecommitdiff
path: root/recipes-toolchain/mingw-w64-crt.recipe
blob: 31db8013505a1b1af17f6017e6e996901e785f58 (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
class Recipe(recipe.Recipe):
    name = 'mingw-w64-crt'
    version = 'v6.0.0'
    licenses = [License.LGPLv2Plus]
    stype = SourceType.CUSTOM
    add_host_build_target = False
    configure_options = ' --with-default-msvcrt=ucrtbase '
    deps = ['mingw-w64-sources', 'binutils']

    def prepare(self):
        if self.config.target_arch == Architecture.X86:
            raise InvalidRecipeError(self)
        if self.config.target_platform == Platform.LINUX:
            self.deps.append('gcc-bootstrap')
        # Since we are cross-compiling we have to reset all the env
        # variables set by cerbero (eg: we don't want -m64 overriding
        # a i386 build or gcc being used instead of x86_64-mingw32-w64-gcc)
        for v in ['CC', 'LD', 'CPP', 'AS', 'RC', 'CXX','CFLAGS', 'LDFLAGS',
                'CXXFLAGS', 'CCASFLAGS']:
            self.set_env(v)
        self.host = 'x86_64-w64-mingw32'
        sysroot = os.path.join(self.config.prefix, self.host, 'sysroot')
        self.configure_options += ' --host=%s' % self.host
        self.configure_options += ' --with-sysroot=%s ' % sysroot
        self.make_install = ['make', 'install', 'DESTDIR=' + sysroot]
        self.build_dir = os.path.join(self.config.sources,
                'mingw-w64-%s' % self.version)
        self.make_dir = os.path.join(self.build_dir, 'mingw-w64-crt')
        self.configure_tpl = "%%(config-sh)s --prefix /usr/%(host)s "\
                "--libdir /usr/%(host)s/lib %%(options)s" % {'host': self.host}