Skip to content

Commit 15aec2f

Browse files
committed
Build extra tools with standard compiler settings.
1 parent 32615c8 commit 15aec2f

File tree

2 files changed

+27
-29
lines changed

2 files changed

+27
-29
lines changed

common.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,15 @@ def unarc(name):
291291

292292

293293
@fill_in_args
294-
def add_site_dir(dirname):
294+
def find_site_dir(dirname):
295295
prefix = sysconfig.EXEC_PREFIX
296296
destlib = sysconfig.get_config_var('DESTLIB')
297-
dirname = path.join(dirname, destlib[len(prefix) + 1:], 'site-packages')
297+
return path.join(dirname, destlib[len(prefix) + 1:], 'site-packages')
298+
299+
300+
@fill_in_args
301+
def add_site_dir(dirname):
302+
dirname = find_site_dir(dirname)
298303
info('adding "%s" to python site dirs', topdir(dirname))
299304
site.addsitedir(dirname)
300305

@@ -356,10 +361,11 @@ def wrapper(*args, **kwargs):
356361

357362

358363
@recipe('python-setup', 1)
359-
def python_setup(name):
364+
def python_setup(name, **kwargs):
365+
dest_dir = kwargs.get('dest_dir', '{host}')
360366
with cwd(path.join('{build}', name)):
361367
execute(sys.executable, 'setup.py', 'build')
362-
execute(sys.executable, 'setup.py', 'install', '--prefix={host}')
368+
execute(sys.executable, 'setup.py', 'install', '--prefix=' + dest_dir)
363369

364370

365371
@recipe('fetch', 1)
@@ -491,5 +497,5 @@ def require_header(headers, lang='c', errmsg='', symbol=None, value=None):
491497
__all__ = ['setvar', 'panic', 'cmpver', 'find_executable', 'chmod', 'execute',
492498
'rmtree', 'mkdir', 'copy', 'copytree', 'unarc', 'fetch', 'cwd',
493499
'symlink', 'remove', 'move', 'find', 'textfile', 'env', 'path',
494-
'add_site_dir', 'python_setup', 'recipe', 'unpack', 'patch',
495-
'configure', 'make', 'require_header', 'touch']
500+
'add_site_dir', 'find_site_dir', 'python_setup', 'recipe',
501+
'unpack', 'patch', 'configure', 'make', 'require_header', 'touch']

toolchain-m68k

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -362,38 +362,29 @@ def build():
362362
"""
363363

364364
ARCH = '-m32' if platform.machine() == 'x86_64' else ''
365-
366-
environ['CC'] = CC + ' ' + ARCH
367-
environ['CXX'] = CXX + ' ' + ARCH
368-
369-
setvar(cc=environ['CC'], cxx=environ['CXX'])
365+
CC = ' '.join([CC, ARCH, '-std=gnu11'])
366+
CXX = ' '.join([CXX, ARCH, '-std=gnu++11'])
370367

371368
"""
372369
Older gcc compilers (i.e. 2.95.3 and 3.4.6) and binutils have to be tricked
373370
into thinking that they're being compiled on Linux IA-32 machine. Theirs
374371
config.guess script knows nothing about x86-64 or darwin.
375372
"""
376373

377-
with env(CC=environ['CC'] + ' -std=gnu11',
378-
CXX=environ['CXX'] + ' -std=gnu++11',
379-
CFLAGS='-g -O2 -Wall',
380-
CXXFLAGS='-g -O2 -Wall'):
374+
with env(CC=CC, CXX=CXX, CFLAGS='-g -O2 -Wall', CXXFLAGS='-g -O2 -Wall'):
381375
configure('{binutils}',
382376
'--prefix={target}',
383377
'--host=i686-linux-gnu',
384378
'--target=m68k-amigaos',
385379
from_dir='{submodules}/{binutils}')
386-
touch_genfiles('{submodules}/{binutils}')
387-
make('{binutils}')
388-
make('{binutils}', 'install')
380+
touch_genfiles('{submodules}/{binutils}')
381+
make('{binutils}')
382+
make('{binutils}', 'install')
389383

390384
unpack('{ixemul}', top_dir='ixemul')
391385
patch('{ixemul}')
392386

393-
with env(CC=environ['CC'] + ' -std=gnu11',
394-
CXX=environ['CXX'] + ' -std=gnu++11',
395-
CFLAGS='-g -O2 -Wall',
396-
CXXFLAGS='-g -O2 -Wall'):
387+
with env(CC=CC, CXX=CXX, CFLAGS='-g -O2 -Wall', CXXFLAGS='-g -O2 -Wall'):
397388
configure('{gcc}',
398389
'--prefix={target}',
399390
'--host=i686-linux-gnu',
@@ -403,11 +394,11 @@ def build():
403394
'--enable-version-specific-runtime-libs',
404395
'--with-headers={sources}/{ixemul}/include',
405396
from_dir='{submodules}/{gcc}')
406-
touch_genfiles('{submodules}/{gcc}')
407-
make('{gcc}', 'all-gcc',
408-
MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
409-
make('{gcc}', 'install-gcc',
410-
MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
397+
touch_genfiles('{submodules}/{gcc}')
398+
make('{gcc}', 'all-gcc',
399+
MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
400+
make('{gcc}', 'install-gcc',
401+
MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
411402

412403
headers_install()
413404

@@ -457,8 +448,9 @@ def build():
457448
make('{clib2}', makefile='GNUmakefile.68k')
458449
install_clib2()
459450

460-
make('{gcc}', MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
461-
make('{gcc}', 'install', MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
451+
with env(CC=CC, CXX=CXX, CFLAGS='-g -O2 -Wall', CXXFLAGS='-g -O2 -Wall'):
452+
make('{gcc}', MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
453+
make('{gcc}', 'install', MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
462454

463455
unpack('ira', top_dir='.', work_dir='{build}')
464456
patch('ira', work_dir='{build}')

0 commit comments

Comments
 (0)