-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmingw.py
55 lines (48 loc) · 1.38 KB
/
mingw.py
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
#!/bin/env python3
from cross_definitions import CrossDefinitions
# Base definitions for MinGW
def mingw_base(bitsize):
if bitsize == 32:
cpu = 'i686'
mingw = 'mingw32'
prefix = 'i686-w64-mingw32'
if bitsize == 64:
cpu = 'x86_64'
mingw = 'mingw64'
prefix = 'x86_64-w64-mingw64'
return CrossDefinitions(
'mingw/' + mingw + '_base',
'Base for MinGW builds with prefix ' + prefix,
binaries={
'c': prefix + '-gcc',
'cpp': prefix + '-g++',
'ar': prefix + '-ar',
'strip': prefix + '-strip',
'pkgconfig': mingw + '-pkg-config',
'exe_wrapper': 'wine',
},
properties={
'root': '/usr/' + prefix,
},
host_machine={
'system': 'windows',
'cpu_family': 'x86',
'cpu': cpu,
'endian': 'little',
},
)
mingw_base(32).write_to_file()
mingw_base(64).write_to_file()
mingw_cross_osx = CrossDefinitions(
'mingw/mingw64_cross_osx',
'Something crazy: compiling on Linux a crosscompiler that\n'
'runs on Windows and generates code for OSX.',
based_on=mingw_base(64),
target_machine={
'system': 'darwin',
'cpu_family': 'arm',
'cpu': 'armv7h',
'endian': 'little',
},
)
mingw_cross_osx.write_to_file()