Skip to content

Commit c3ff91d

Browse files
committed
The toolchain builds again on Cygwin and MSYS2 (32-bit).
1 parent 90261e0 commit c3ff91d

File tree

2 files changed

+29
-12
lines changed

2 files changed

+29
-12
lines changed

common.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,18 @@ def find_executable(name):
108108
@fill_in_args
109109
def find(root, **kwargs):
110110
only_files = kwargs.get('only_files', False)
111-
include = kwargs.get('include', None)
112-
exclude = kwargs.get('exclude', None)
111+
include = kwargs.get('include', ['*'])
112+
exclude = kwargs.get('exclude', [''])
113113
lst = []
114114
for name in sorted(os.listdir(root)):
115-
if exclude and any(fnmatch(name, pat) for pat in exclude):
116-
continue
117-
if include and not any(fnmatch(name, pat) for pat in include):
118-
continue
119115
fullname = path.join(root, name)
120-
if not (path.isdir(fullname) and only_files):
121-
lst.append(fullname)
122-
if path.isdir(fullname):
116+
is_dir = path.isdir(fullname)
117+
excluded = any(fnmatch(name, pat) for pat in exclude)
118+
included = any(fnmatch(name, pat) for pat in include)
119+
if included and not excluded:
120+
if not (is_dir and only_files):
121+
lst.append(fullname)
122+
if is_dir and not excluded:
123123
lst.extend(find(fullname, **kwargs))
124124
return lst
125125

toolchain-m68k

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Build cross toolchain for AmigaOS <= 3.9 / M68k target.
44

55
from fnmatch import fnmatch
6+
from glob import glob
67
from logging import info
78
from os import environ
89
import argparse
@@ -207,6 +208,20 @@ def update_autotools(dst):
207208
copy('{archives}/automake/lib/config.sub', path.join(dst, 'config.sub'))
208209

209210

211+
def touch_genfiles(dst):
212+
"""
213+
For binutils and gcc we want to make sure C source & headers file doesn't get
214+
regenerated. Otherwise it can cause weird errors later in the build process
215+
(e.g. in ldexp.c:560)
216+
"""
217+
for name in find(dst, include=['*.l', '*.y']):
218+
basename = path.splitext(name)[0]
219+
for c_file in glob(basename + '.c'):
220+
touch(c_file)
221+
for h_file in glob(basename + '.h'):
222+
touch(h_file)
223+
224+
210225
def build():
211226
for var in environ.keys():
212227
if var not in ['_', 'LOGNAME', 'HOME', 'SHELL', 'TMPDIR', 'PWD']:
@@ -365,6 +380,7 @@ def build():
365380

366381
unpack('{binutils}')
367382
update_autotools('{sources}/{binutils}')
383+
touch_genfiles('{sources}/{binutils}')
368384
with env(CC=environ['CC'] + ' -std=gnu11',
369385
CXX=environ['CXX'] + ' -std=gnu++11',
370386
CFLAGS='-g -O2 -Wall',
@@ -383,6 +399,7 @@ def build():
383399
update_autotools('{sources}/{gcc}')
384400
update_autotools('{sources}/{gcc}/gcc')
385401
update_autotools('{sources}/{gcc}/texinfo')
402+
touch_genfiles('{sources}/{gcc}')
386403
with env(CC=environ['CC'] + ' -std=gnu11',
387404
CXX=environ['CXX'] + ' -std=gnu++11',
388405
CFLAGS='-g -O2 -Wall',
@@ -498,7 +515,7 @@ def read_sdk(filename):
498515
def list_sdk():
499516
print 'Available SDKs:'
500517

501-
for filename in find('{top}/sdk', include='*.sdk'):
518+
for filename in find('{top}/sdk', include=['*.sdk']):
502519
info, _ = read_sdk(filename)
503520
name = path.splitext(path.basename(filename))[0]
504521
print ' - %s %s : %s' % (name, info['version'], info['short'])
@@ -646,8 +663,8 @@ if __name__ == "__main__":
646663
if not sys.version_info[:2] == (2, 7):
647664
panic('I need Python 2.7 to run!')
648665

649-
if not (platform.system() in ['Darwin', 'Linux'] or
650-
fnmatch(platform.system(), 'MSYS_NT*')):
666+
if not any(fnmatch(platform.system(), pat)
667+
for pat in ['Darwin', 'Linux', 'CYGWIN_NT*', 'MSYS_NT*']):
651668
panic('Build on %s not supported!', platform.system())
652669

653670
if platform.machine() not in ['i686', 'x86_64']:

0 commit comments

Comments
 (0)