Unify the way GNU Make is invoked.
This commit is contained in:
parent
3f40fcde34
commit
33611fc4b2
69
common.py
69
common.py
|
@ -303,25 +303,30 @@ def env(**kwargs):
|
||||||
os.environ[key] = value
|
os.environ[key] = value
|
||||||
|
|
||||||
|
|
||||||
def check_stamp(fn):
|
def recipe(name, nargs=0):
|
||||||
@fill_in_args
|
def real_decorator(fn):
|
||||||
def wrapper(*args, **kwargs):
|
@fill_in_args
|
||||||
name = fn.func_name.replace('_', '-')
|
def wrapper(*args, **kwargs):
|
||||||
if len(args) > 0:
|
target = [str(arg) for arg in args[:min(nargs, len(args))]]
|
||||||
name = name + "-" + str(fill_in(args[0]))
|
if len(target) > 0:
|
||||||
stamp = path.join('{stamps}', name)
|
target = [target[0], name] + target[1:]
|
||||||
if not path.exists('{stamps}'):
|
target = '-'.join(target)
|
||||||
mkdir('{stamps}')
|
else:
|
||||||
if not path.exists(stamp):
|
target = name
|
||||||
fn(*args, **kwargs)
|
target = target.replace('_', '-')
|
||||||
touch(stamp)
|
stamp = path.join('{stamps}', target)
|
||||||
else:
|
if not path.exists('{stamps}'):
|
||||||
info('already done "%s"', name)
|
mkdir('{stamps}')
|
||||||
|
if not path.exists(stamp):
|
||||||
return wrapper
|
fn(*args, **kwargs)
|
||||||
|
touch(stamp)
|
||||||
|
else:
|
||||||
|
info('already done "%s"', target)
|
||||||
|
return wrapper
|
||||||
|
return real_decorator
|
||||||
|
|
||||||
|
|
||||||
@check_stamp
|
@recipe('fetch', 1)
|
||||||
def fetch(name, url):
|
def fetch(name, url):
|
||||||
if url.startswith('http') or url.startswith('ftp'):
|
if url.startswith('http') or url.startswith('ftp'):
|
||||||
if not path.exists(name):
|
if not path.exists(name):
|
||||||
|
@ -344,7 +349,7 @@ def fetch(name, url):
|
||||||
panic('URL "%s" not recognized!', url)
|
panic('URL "%s" not recognized!', url)
|
||||||
|
|
||||||
|
|
||||||
@check_stamp
|
@recipe('unpack', 1)
|
||||||
def unpack(name, work_dir='{sources}', top_dir=None, dst_dir=None):
|
def unpack(name, work_dir='{sources}', top_dir=None, dst_dir=None):
|
||||||
try:
|
try:
|
||||||
src = glob(path.join('{archives}', name) + '*')[0]
|
src = glob(path.join('{archives}', name) + '*')[0]
|
||||||
|
@ -367,7 +372,7 @@ def unpack(name, work_dir='{sources}', top_dir=None, dst_dir=None):
|
||||||
rmtree(tmpdir)
|
rmtree(tmpdir)
|
||||||
|
|
||||||
|
|
||||||
@check_stamp
|
@recipe('patch', 1)
|
||||||
def patch(name, work_dir='{sources}'):
|
def patch(name, work_dir='{sources}'):
|
||||||
with cwd(work_dir):
|
with cwd(work_dir):
|
||||||
for name in find(path.join('{patches}', name),
|
for name in find(path.join('{patches}', name),
|
||||||
|
@ -380,7 +385,7 @@ def patch(name, work_dir='{sources}'):
|
||||||
copy(name, dst)
|
copy(name, dst)
|
||||||
|
|
||||||
|
|
||||||
@check_stamp
|
@recipe('configure', 1)
|
||||||
def configure(name, *confopts, **kwargs):
|
def configure(name, *confopts, **kwargs):
|
||||||
info('configuring "%s"', name)
|
info('configuring "%s"', name)
|
||||||
|
|
||||||
|
@ -399,28 +404,18 @@ def configure(name, *confopts, **kwargs):
|
||||||
execute(path.join(from_dir, 'configure'), *confopts)
|
execute(path.join(from_dir, 'configure'), *confopts)
|
||||||
|
|
||||||
|
|
||||||
@check_stamp
|
@recipe('make', 2)
|
||||||
def build(name, *targets, **makevars):
|
def make(name, target=None, **makevars):
|
||||||
info('building "%s"', name)
|
info('running make "%s"', target)
|
||||||
|
|
||||||
with cwd(path.join('{build}', name)):
|
with cwd(path.join('{build}', name)):
|
||||||
args = list(targets) + ['%s=%s' % item for item in makevars.items()]
|
args = ['%s=%s' % item for item in makevars.items()]
|
||||||
execute('make', *args)
|
if target is not None:
|
||||||
|
args = [target] + args
|
||||||
|
|
||||||
@check_stamp
|
|
||||||
def install(name, *targets, **makevars):
|
|
||||||
info('installing "%s"', name)
|
|
||||||
|
|
||||||
if not targets:
|
|
||||||
targets = ['install']
|
|
||||||
|
|
||||||
with cwd(path.join('{build}', name)):
|
|
||||||
args = list(targets) + ['%s=%s' % item for item in makevars.items()]
|
|
||||||
execute('make', *args)
|
execute('make', *args)
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['setvar', 'panic', 'cmpver', 'find_executable', 'chmod', 'execute',
|
__all__ = ['setvar', 'panic', 'cmpver', 'find_executable', 'chmod', 'execute',
|
||||||
'rmtree', 'mkdir', 'copy', 'copytree', 'unarc', 'fetch', 'cwd',
|
'rmtree', 'mkdir', 'copy', 'copytree', 'unarc', 'fetch', 'cwd',
|
||||||
'symlink', 'remove', 'move', 'find', 'textfile', 'env', 'path',
|
'symlink', 'remove', 'move', 'find', 'textfile', 'env', 'path',
|
||||||
'check_stamp', 'unpack', 'patch', 'configure', 'build', 'install']
|
'recipe', 'unpack', 'patch', 'configure', 'make']
|
||||||
|
|
|
@ -21,7 +21,7 @@ URLS = \
|
||||||
from common import * # NOQA
|
from common import * # NOQA
|
||||||
|
|
||||||
|
|
||||||
def make():
|
def build():
|
||||||
for var in environ.keys():
|
for var in environ.keys():
|
||||||
if var not in ['_', 'LOGNAME', 'HOME', 'SHELL', 'TMPDIR', 'PWD']:
|
if var not in ['_', 'LOGNAME', 'HOME', 'SHELL', 'TMPDIR', 'PWD']:
|
||||||
del environ[var]
|
del environ[var]
|
||||||
|
@ -59,16 +59,16 @@ def make():
|
||||||
configure('{gmp}',
|
configure('{gmp}',
|
||||||
'--disable-shared',
|
'--disable-shared',
|
||||||
'--prefix={host}')
|
'--prefix={host}')
|
||||||
build('{gmp}')
|
make('{gmp}')
|
||||||
install('{gmp}')
|
make('{gmp}', 'install')
|
||||||
|
|
||||||
unpack('{mpfr}')
|
unpack('{mpfr}')
|
||||||
configure('{mpfr}',
|
configure('{mpfr}',
|
||||||
'--disable-shared',
|
'--disable-shared',
|
||||||
'--prefix={host}',
|
'--prefix={host}',
|
||||||
'--with-gmp={host}')
|
'--with-gmp={host}')
|
||||||
build('{mpfr}')
|
make('{mpfr}')
|
||||||
install('{mpfr}')
|
make('{mpfr}', 'install')
|
||||||
|
|
||||||
unpack('{mpc}')
|
unpack('{mpc}')
|
||||||
configure('{mpc}',
|
configure('{mpc}',
|
||||||
|
@ -76,16 +76,16 @@ def make():
|
||||||
'--prefix={host}',
|
'--prefix={host}',
|
||||||
'--with-gmp={host}',
|
'--with-gmp={host}',
|
||||||
'--with-mpfr={host}')
|
'--with-mpfr={host}')
|
||||||
build('{mpc}')
|
make('{mpc}')
|
||||||
install('{mpc}')
|
make('{mpc}', 'install')
|
||||||
|
|
||||||
unpack('{isl}')
|
unpack('{isl}')
|
||||||
configure('{isl}',
|
configure('{isl}',
|
||||||
'--disable-shared',
|
'--disable-shared',
|
||||||
'--prefix={host}',
|
'--prefix={host}',
|
||||||
'--with-gmp-prefix={host}')
|
'--with-gmp-prefix={host}')
|
||||||
build('{isl}')
|
make('{isl}')
|
||||||
install('{isl}')
|
make('{isl}', 'install')
|
||||||
|
|
||||||
unpack('{cloog}')
|
unpack('{cloog}')
|
||||||
configure('{cloog}',
|
configure('{cloog}',
|
||||||
|
@ -94,8 +94,8 @@ def make():
|
||||||
'--with-isl=system',
|
'--with-isl=system',
|
||||||
'--with-gmp-prefix={host}',
|
'--with-gmp-prefix={host}',
|
||||||
'--with-isl-prefix={host}')
|
'--with-isl-prefix={host}')
|
||||||
build('{cloog}')
|
make('{cloog}')
|
||||||
install('{cloog}')
|
make('{cloog}', 'install')
|
||||||
|
|
||||||
with env(CFLAGS='-Wno-error'):
|
with env(CFLAGS='-Wno-error'):
|
||||||
configure('binutils',
|
configure('binutils',
|
||||||
|
@ -103,8 +103,8 @@ def make():
|
||||||
'--with-isl={host}',
|
'--with-isl={host}',
|
||||||
'--target=m68k-elf',
|
'--target=m68k-elf',
|
||||||
from_dir='{archives}/binutils')
|
from_dir='{archives}/binutils')
|
||||||
build('binutils')
|
make('binutils')
|
||||||
install('binutils')
|
make('binutils', 'install')
|
||||||
|
|
||||||
configure('gcc',
|
configure('gcc',
|
||||||
'--target=m68k-elf',
|
'--target=m68k-elf',
|
||||||
|
@ -116,8 +116,8 @@ def make():
|
||||||
'--enable-languages=c',
|
'--enable-languages=c',
|
||||||
'--without-headers',
|
'--without-headers',
|
||||||
from_dir='{archives}/gcc')
|
from_dir='{archives}/gcc')
|
||||||
build('gcc', 'all-gcc')
|
make('gcc', 'all-gcc')
|
||||||
install('gcc', 'install-gcc')
|
make('gcc', 'install-gcc')
|
||||||
|
|
||||||
|
|
||||||
def clean():
|
def clean():
|
||||||
|
@ -140,7 +140,7 @@ if __name__ == "__main__":
|
||||||
panic('Build on %s architecture not supported!', platform.machine())
|
panic('Build on %s architecture not supported!', platform.machine())
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Build cross toolchain.')
|
parser = argparse.ArgumentParser(description='Build cross toolchain.')
|
||||||
parser.add_argument('action', choices=['make', 'clean'], default='make',
|
parser.add_argument('action', choices=['build', 'clean'], default='build',
|
||||||
help='perform action')
|
help='perform action')
|
||||||
parser.add_argument('--prefix', type=str, default=None,
|
parser.add_argument('--prefix', type=str, default=None,
|
||||||
help='installation directory')
|
help='installation directory')
|
||||||
|
|
|
@ -42,7 +42,7 @@ URLS = \
|
||||||
from common import * # NOQA
|
from common import * # NOQA
|
||||||
|
|
||||||
|
|
||||||
@check_stamp
|
@recipe('target-prepare')
|
||||||
def prepare_target():
|
def prepare_target():
|
||||||
info('preparing target')
|
info('preparing target')
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ def prepare_target():
|
||||||
symlink('../lib', 'lib')
|
symlink('../lib', 'lib')
|
||||||
|
|
||||||
|
|
||||||
@check_stamp
|
@recipe('{NDK}-install')
|
||||||
def install_ndk():
|
def install_ndk():
|
||||||
info('installing ndk')
|
info('installing ndk')
|
||||||
|
|
||||||
|
@ -79,14 +79,14 @@ def install_ndk():
|
||||||
'--output={target}/os-include/lvo/' + base + '_lib.i', name)
|
'--output={target}/os-include/lvo/' + base + '_lib.i', name)
|
||||||
|
|
||||||
|
|
||||||
@check_stamp
|
@recipe('libamiga-install')
|
||||||
def install_libamiga():
|
def install_libamiga():
|
||||||
info('installing libamiga')
|
info('installing libamiga')
|
||||||
|
|
||||||
copytree('{sources}/libamiga/lib', '{target}/lib')
|
copytree('{sources}/libamiga/lib', '{target}/lib')
|
||||||
|
|
||||||
|
|
||||||
@check_stamp
|
@recipe('vbcc-build')
|
||||||
def build_vbcc():
|
def build_vbcc():
|
||||||
copytree('{sources}/vbcc', '{build}/vbcc')
|
copytree('{sources}/vbcc', '{build}/vbcc')
|
||||||
mkdir('{build}/vbcc/bin')
|
mkdir('{build}/vbcc/bin')
|
||||||
|
@ -101,17 +101,17 @@ def build_vbcc():
|
||||||
'n', 'y', 'unsigned long',
|
'n', 'y', 'unsigned long',
|
||||||
'n', 'y', 'float',
|
'n', 'y', 'float',
|
||||||
'n', 'y', 'double')
|
'n', 'y', 'double')
|
||||||
build('vbcc', TARGET='m68k', ETCDIR='\\"{target}/etc\\"', CONFIG=config)
|
make('vbcc', TARGET='m68k', ETCDIR='\\"{target}/etc\\"', CONFIG=config)
|
||||||
remove(config)
|
remove(config)
|
||||||
|
|
||||||
|
|
||||||
@check_stamp
|
@recipe('vlink-build')
|
||||||
def build_vlink():
|
def build_vlink():
|
||||||
mkdir('{build}/vlink/objects')
|
mkdir('{build}/vlink/objects')
|
||||||
build('vlink')
|
make('vlink')
|
||||||
|
|
||||||
|
|
||||||
@check_stamp
|
@recipe('vbcc-install')
|
||||||
def install_vbcc_toolchain():
|
def install_vbcc_toolchain():
|
||||||
info('installing vasm')
|
info('installing vasm')
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ def install_vbcc_toolchain():
|
||||||
move(config, '{target}/etc/vc.config')
|
move(config, '{target}/etc/vc.config')
|
||||||
|
|
||||||
|
|
||||||
def make():
|
def build():
|
||||||
for var in environ.keys():
|
for var in environ.keys():
|
||||||
if var not in ['_', 'LOGNAME', 'HOME', 'SHELL', 'TMPDIR', 'PWD']:
|
if var not in ['_', 'LOGNAME', 'HOME', 'SHELL', 'TMPDIR', 'PWD']:
|
||||||
del environ[var]
|
del environ[var]
|
||||||
|
@ -219,43 +219,43 @@ def make():
|
||||||
'--disable-shared',
|
'--disable-shared',
|
||||||
'--prefix={host}',
|
'--prefix={host}',
|
||||||
copy_source=True)
|
copy_source=True)
|
||||||
build('{lha}')
|
make('{lha}')
|
||||||
install('{lha}')
|
make('{lha}', 'install')
|
||||||
|
|
||||||
unpack('{m4}')
|
unpack('{m4}')
|
||||||
configure('{m4}', '--prefix={host}')
|
configure('{m4}', '--prefix={host}')
|
||||||
build('{m4}')
|
make('{m4}')
|
||||||
install('{m4}')
|
make('{m4}', 'install')
|
||||||
|
|
||||||
unpack('{gawk}')
|
unpack('{gawk}')
|
||||||
configure('{gawk}', '--prefix={host}')
|
configure('{gawk}', '--prefix={host}')
|
||||||
build('{gawk}')
|
make('{gawk}')
|
||||||
install('{gawk}')
|
make('{gawk}', 'install')
|
||||||
|
|
||||||
unpack('{flex}')
|
unpack('{flex}')
|
||||||
configure('{flex}', '--prefix={host}')
|
configure('{flex}', '--prefix={host}')
|
||||||
build('{flex}')
|
make('{flex}')
|
||||||
install('{flex}')
|
make('{flex}', 'install')
|
||||||
|
|
||||||
unpack('{bison}')
|
unpack('{bison}')
|
||||||
configure('{bison}', '--prefix={host}')
|
configure('{bison}', '--prefix={host}')
|
||||||
build('{bison}')
|
make('{bison}')
|
||||||
install('{bison}')
|
make('{bison}', 'install')
|
||||||
|
|
||||||
unpack('{texinfo}')
|
unpack('{texinfo}')
|
||||||
configure('{texinfo}', '--prefix={host}')
|
configure('{texinfo}', '--prefix={host}')
|
||||||
build('{texinfo}')
|
make('{texinfo}')
|
||||||
install('{texinfo}')
|
make('{texinfo}', 'install')
|
||||||
|
|
||||||
unpack('{autoconf}')
|
unpack('{autoconf}')
|
||||||
configure('{autoconf}', '--prefix={host}')
|
configure('{autoconf}', '--prefix={host}')
|
||||||
build('{autoconf}')
|
make('{autoconf}')
|
||||||
install('{autoconf}')
|
make('{autoconf}', 'install')
|
||||||
|
|
||||||
prepare_target()
|
prepare_target()
|
||||||
|
|
||||||
unpack('vasm', work_dir='{build}')
|
unpack('vasm', work_dir='{build}')
|
||||||
build('vasm', CPU='m68k', SYNTAX='mot')
|
make('vasm', CPU='m68k', SYNTAX='mot')
|
||||||
|
|
||||||
unpack('vlink', work_dir='{build}')
|
unpack('vlink', work_dir='{build}')
|
||||||
build_vlink()
|
build_vlink()
|
||||||
|
@ -280,8 +280,8 @@ def make():
|
||||||
'--prefix={target}',
|
'--prefix={target}',
|
||||||
'--host=i686-linux-gnu',
|
'--host=i686-linux-gnu',
|
||||||
'--target=m68k-amigaos')
|
'--target=m68k-amigaos')
|
||||||
build('{binutils}')
|
make('{binutils}')
|
||||||
install('{binutils}')
|
make('{binutils}', 'install')
|
||||||
|
|
||||||
unpack('{ixemul}', top_dir='ixemul')
|
unpack('{ixemul}', top_dir='ixemul')
|
||||||
patch('{ixemul}')
|
patch('{ixemul}')
|
||||||
|
@ -298,20 +298,20 @@ def make():
|
||||||
'--target=m68k-amigaos',
|
'--target=m68k-amigaos',
|
||||||
'--enable-languages=c',
|
'--enable-languages=c',
|
||||||
'--with-headers={sources}/{ixemul}/include')
|
'--with-headers={sources}/{ixemul}/include')
|
||||||
build('{gcc}', MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
|
make('{gcc}', MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
|
||||||
install('{gcc}', MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
|
make('{gcc}', 'install', MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
|
||||||
|
|
||||||
unpack('fd2sfd')
|
unpack('fd2sfd')
|
||||||
patch('fd2sfd')
|
patch('fd2sfd')
|
||||||
configure('fd2sfd', '--prefix={target}', copy_source=True)
|
configure('fd2sfd', '--prefix={target}', copy_source=True)
|
||||||
build('fd2sfd')
|
make('fd2sfd')
|
||||||
install('fd2sfd')
|
make('fd2sfd', 'install')
|
||||||
|
|
||||||
unpack('sfdc')
|
unpack('sfdc')
|
||||||
patch('sfdc')
|
patch('sfdc')
|
||||||
configure('sfdc', '--prefix={target}', copy_source=True)
|
configure('sfdc', '--prefix={target}', copy_source=True)
|
||||||
build('sfdc')
|
make('sfdc')
|
||||||
install('sfdc')
|
make('sfdc', 'install')
|
||||||
|
|
||||||
unpack('{NDK}')
|
unpack('{NDK}')
|
||||||
patch('{NDK}')
|
patch('{NDK}')
|
||||||
|
@ -325,14 +325,14 @@ def make():
|
||||||
'--prefix={target}',
|
'--prefix={target}',
|
||||||
'--host=i686-linux-gnu',
|
'--host=i686-linux-gnu',
|
||||||
'--target=m68k-amigaos')
|
'--target=m68k-amigaos')
|
||||||
build('libnix',
|
make('libnix',
|
||||||
CC='m68k-amigaos-gcc',
|
CC='m68k-amigaos-gcc',
|
||||||
CPP='m68k-amigaos-gcc -E',
|
CPP='m68k-amigaos-gcc -E',
|
||||||
AR='m68k-amigaos-ar',
|
AR='m68k-amigaos-ar',
|
||||||
AS='m68k-amigaos-as',
|
AS='m68k-amigaos-as',
|
||||||
RANLIB='m68k-amigaos-ranlib',
|
RANLIB='m68k-amigaos-ranlib',
|
||||||
LD='m68k-amigaos-ld')
|
LD='m68k-amigaos-ld')
|
||||||
install('libnix')
|
make('libnix', 'install')
|
||||||
|
|
||||||
copy('{sources}/libnix/sources/headers/stabs.h',
|
copy('{sources}/libnix/sources/headers/stabs.h',
|
||||||
'{target}/m68k-amigaos/sys-include')
|
'{target}/m68k-amigaos/sys-include')
|
||||||
|
@ -345,8 +345,8 @@ def make():
|
||||||
'--prefix={target}',
|
'--prefix={target}',
|
||||||
'--host=i686-linux-gnu',
|
'--host=i686-linux-gnu',
|
||||||
'--target=m68k-amigaos')
|
'--target=m68k-amigaos')
|
||||||
build('{libm}')
|
make('{libm}')
|
||||||
install('{libm}')
|
make('{libm}', 'install')
|
||||||
|
|
||||||
with cwd('{sources}'):
|
with cwd('{sources}'):
|
||||||
remove('{gpp}')
|
remove('{gpp}')
|
||||||
|
@ -361,8 +361,8 @@ def make():
|
||||||
'--target=m68k-amigaos',
|
'--target=m68k-amigaos',
|
||||||
'--enable-languages=c++',
|
'--enable-languages=c++',
|
||||||
'--with-headers={sources}/{ixemul}/include')
|
'--with-headers={sources}/{ixemul}/include')
|
||||||
build('{gpp}', MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
|
make('{gpp}', MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
|
||||||
install('{gpp}', MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
|
make('{gpp}', 'install', MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
|
||||||
|
|
||||||
|
|
||||||
def clean():
|
def clean():
|
||||||
|
@ -387,7 +387,7 @@ if __name__ == "__main__":
|
||||||
panic('Build on %s architecture not supported!', platform.machine())
|
panic('Build on %s architecture not supported!', platform.machine())
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Build cross toolchain.')
|
parser = argparse.ArgumentParser(description='Build cross toolchain.')
|
||||||
parser.add_argument('action', choices=['make', 'clean'], default='make',
|
parser.add_argument('action', choices=['build', 'clean'], default='build',
|
||||||
help='perform action')
|
help='perform action')
|
||||||
parser.add_argument('--binutils', choices=['2.9.1'], default='2.9.1',
|
parser.add_argument('--binutils', choices=['2.9.1'], default='2.9.1',
|
||||||
help='desired binutils version')
|
help='desired binutils version')
|
||||||
|
|
|
@ -9,6 +9,7 @@ from os import environ
|
||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
import platform
|
import platform
|
||||||
|
import sys
|
||||||
|
|
||||||
URLS = \
|
URLS = \
|
||||||
['ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.3.tar.bz2',
|
['ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.3.tar.bz2',
|
||||||
|
@ -30,9 +31,9 @@ URLS = \
|
||||||
from common import * # NOQA
|
from common import * # NOQA
|
||||||
|
|
||||||
|
|
||||||
@check_stamp
|
@recipe('{sdk}-prepare')
|
||||||
def prepare_sdk():
|
def prepare_sdk():
|
||||||
info('preparing SDK')
|
info('preparing {sdk}')
|
||||||
|
|
||||||
base = ''
|
base = ''
|
||||||
clib2 = ''
|
clib2 = ''
|
||||||
|
@ -41,7 +42,7 @@ def prepare_sdk():
|
||||||
with cwd('{sources}'):
|
with cwd('{sources}'):
|
||||||
for arc in ['base.lha', 'clib2-*.lha', 'newlib-*.lha']:
|
for arc in ['base.lha', 'clib2-*.lha', 'newlib-*.lha']:
|
||||||
info('extracting "%s"' % arc)
|
info('extracting "%s"' % arc)
|
||||||
execute('lha', '-xifq', path.join('{archives}', 'SDK_53.24.lha'),
|
execute('lha', '-xifq', path.join('{archives}', '{sdk}.lha'),
|
||||||
path.join('SDK_Install', arc))
|
path.join('SDK_Install', arc))
|
||||||
base = path.join('{sources}', glob('base*.lha')[0])
|
base = path.join('{sources}', glob('base*.lha')[0])
|
||||||
clib2 = path.join('{sources}', glob('clib2*.lha')[0])
|
clib2 = path.join('{sources}', glob('clib2*.lha')[0])
|
||||||
|
@ -54,7 +55,7 @@ def prepare_sdk():
|
||||||
move('Include', 'include')
|
move('Include', 'include')
|
||||||
|
|
||||||
|
|
||||||
def make():
|
def build():
|
||||||
for var in environ.keys():
|
for var in environ.keys():
|
||||||
if var not in ['_', 'LOGNAME', 'HOME', 'SHELL', 'TMPDIR', 'PWD']:
|
if var not in ['_', 'LOGNAME', 'HOME', 'SHELL', 'TMPDIR', 'PWD']:
|
||||||
del environ[var]
|
del environ[var]
|
||||||
|
@ -94,29 +95,29 @@ def make():
|
||||||
'--disable-shared',
|
'--disable-shared',
|
||||||
'--prefix={host}',
|
'--prefix={host}',
|
||||||
copy_source=True)
|
copy_source=True)
|
||||||
build('{lha}')
|
make('{lha}')
|
||||||
install('{lha}')
|
make('{lha}', 'install')
|
||||||
|
|
||||||
unpack('{texinfo}')
|
unpack('{texinfo}')
|
||||||
configure('{texinfo}',
|
configure('{texinfo}',
|
||||||
'--prefix={host}')
|
'--prefix={host}')
|
||||||
build('{texinfo}')
|
make('{texinfo}')
|
||||||
install('{texinfo}')
|
make('{texinfo}', 'install')
|
||||||
|
|
||||||
unpack('{gmp}')
|
unpack('{gmp}')
|
||||||
configure('{gmp}',
|
configure('{gmp}',
|
||||||
'--disable-shared',
|
'--disable-shared',
|
||||||
'--prefix={host}')
|
'--prefix={host}')
|
||||||
build('{gmp}')
|
make('{gmp}')
|
||||||
install('{gmp}')
|
make('{gmp}', 'install')
|
||||||
|
|
||||||
unpack('{mpfr}')
|
unpack('{mpfr}')
|
||||||
configure('{mpfr}',
|
configure('{mpfr}',
|
||||||
'--disable-shared',
|
'--disable-shared',
|
||||||
'--prefix={host}',
|
'--prefix={host}',
|
||||||
'--with-gmp={host}')
|
'--with-gmp={host}')
|
||||||
build('{mpfr}')
|
make('{mpfr}')
|
||||||
install('{mpfr}')
|
make('{mpfr}', 'install')
|
||||||
|
|
||||||
unpack('{mpc}')
|
unpack('{mpc}')
|
||||||
configure('{mpc}',
|
configure('{mpc}',
|
||||||
|
@ -124,16 +125,16 @@ def make():
|
||||||
'--prefix={host}',
|
'--prefix={host}',
|
||||||
'--with-gmp={host}',
|
'--with-gmp={host}',
|
||||||
'--with-mpfr={host}')
|
'--with-mpfr={host}')
|
||||||
build('{mpc}')
|
make('{mpc}')
|
||||||
install('{mpc}')
|
make('{mpc}', 'install')
|
||||||
|
|
||||||
unpack('{isl}')
|
unpack('{isl}')
|
||||||
configure('{isl}',
|
configure('{isl}',
|
||||||
'--disable-shared',
|
'--disable-shared',
|
||||||
'--prefix={host}',
|
'--prefix={host}',
|
||||||
'--with-gmp-prefix={host}')
|
'--with-gmp-prefix={host}')
|
||||||
build('{isl}')
|
make('{isl}')
|
||||||
install('{isl}')
|
make('{isl}', 'install')
|
||||||
|
|
||||||
unpack('{cloog}')
|
unpack('{cloog}')
|
||||||
configure('{cloog}',
|
configure('{cloog}',
|
||||||
|
@ -142,8 +143,8 @@ def make():
|
||||||
'--with-isl=system',
|
'--with-isl=system',
|
||||||
'--with-gmp-prefix={host}',
|
'--with-gmp-prefix={host}',
|
||||||
'--with-isl-prefix={host}')
|
'--with-isl-prefix={host}')
|
||||||
build('{cloog}')
|
make('{cloog}')
|
||||||
install('{cloog}')
|
make('{cloog}', 'install')
|
||||||
|
|
||||||
binutils_env = {}
|
binutils_env = {}
|
||||||
if cmpver('eq', '{binutils_ver}', '2.18'):
|
if cmpver('eq', '{binutils_ver}', '2.18'):
|
||||||
|
@ -156,8 +157,8 @@ def make():
|
||||||
configure('{binutils}',
|
configure('{binutils}',
|
||||||
'--prefix={target}',
|
'--prefix={target}',
|
||||||
'--target=ppc-amigaos')
|
'--target=ppc-amigaos')
|
||||||
build('{binutils}')
|
make('{binutils}')
|
||||||
install('{binutils}')
|
make('{binutils}', 'install')
|
||||||
|
|
||||||
prepare_sdk()
|
prepare_sdk()
|
||||||
|
|
||||||
|
@ -182,8 +183,8 @@ def make():
|
||||||
'--enable-sjlj-exceptions'
|
'--enable-sjlj-exceptions'
|
||||||
'--disable-libstdcxx-pch'
|
'--disable-libstdcxx-pch'
|
||||||
'--disable-tls')
|
'--disable-tls')
|
||||||
build('{gcc}')
|
make('{gcc}')
|
||||||
install('{gcc}')
|
make('{gcc}', 'install')
|
||||||
|
|
||||||
|
|
||||||
def clean():
|
def clean():
|
||||||
|
@ -207,7 +208,7 @@ if __name__ == "__main__":
|
||||||
panic('Build on %s architecture not supported!', platform.machine())
|
panic('Build on %s architecture not supported!', platform.machine())
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Build cross toolchain.')
|
parser = argparse.ArgumentParser(description='Build cross toolchain.')
|
||||||
parser.add_argument('action', choices=['make', 'clean'], default='make',
|
parser.add_argument('action', choices=['build', 'clean'], default='build',
|
||||||
help='perform action')
|
help='perform action')
|
||||||
parser.add_argument('--binutils', choices=['2.18', '2.23.2'], default='2.18',
|
parser.add_argument('--binutils', choices=['2.18', '2.23.2'], default='2.18',
|
||||||
help='desired binutils version')
|
help='desired binutils version')
|
||||||
|
@ -229,6 +230,7 @@ if __name__ == "__main__":
|
||||||
cloog='cloog-0.18.4',
|
cloog='cloog-0.18.4',
|
||||||
texinfo='texinfo-4.12',
|
texinfo='texinfo-4.12',
|
||||||
binutils='binutils-{binutils_ver}',
|
binutils='binutils-{binutils_ver}',
|
||||||
|
sdk='SDK_53.29',
|
||||||
gcc='gcc-{gcc_ver}',
|
gcc='gcc-{gcc_ver}',
|
||||||
patches=path.join('{top}', 'patches'),
|
patches=path.join('{top}', 'patches'),
|
||||||
stamps=path.join('{top}', '.build-ppc', 'stamps'),
|
stamps=path.join('{top}', '.build-ppc', 'stamps'),
|
||||||
|
|
Loading…
Reference in New Issue