Some random fixes.

This commit is contained in:
Krystian Bacławski 2015-08-29 16:53:05 +02:00
parent d6ba93c1cc
commit 6364dc5c2d
4 changed files with 36 additions and 29 deletions

View File

@ -173,7 +173,7 @@ def mkdir(*names):
@fill_in_args
def copy(src, dst):
debug('copy "%s" to "%s"', topdir(src), topdir(dst))
shutil.copy(src, dst)
shutil.copy2(src, dst)
@fill_in_args
@ -183,10 +183,11 @@ def copytree(src, dst, **kwargs):
mkdir(dst)
for name in find(src, **kwargs):
target = path.join(dst, path.relpath(name, src))
if path.isdir(name):
mkdir(path.join(dst, path.relpath(name, src)))
mkdir(target)
else:
copy(name, path.join(dst, path.relpath(name, src)))
copy(name, target)
@fill_in_args
@ -383,12 +384,15 @@ def patch(name, work_dir='{sources}'):
def configure(name, *confopts, **kwargs):
info('configuring "%s"', name)
if 'from_dir' in kwargs:
from_dir = kwargs['from_dir']
else:
from_dir = path.join('{sources}', name)
if kwargs.get('copy_source', False):
rmtree(path.join('{build}', name))
copytree(path.join('{sources}', name), path.join('{build}', name))
from_dir = '.'
else:
from_dir = path.join('{sources}', name)
with cwd(path.join('{build}', name)):
remove(find('.', include=['config.cache']))

View File

@ -2,8 +2,6 @@
# Build development cross toolchain for m68k-elf target.
from glob import glob
from logging import info
from os import environ
import argparse
import logging
@ -98,29 +96,31 @@ def make():
build('{cloog}')
install('{cloog}')
unpack('binutils')
configure('binutils',
'--prefix={target}',
'--target=m68k-elf')
build('binutils')
install('binutils')
with env(CFLAGS='-Wno-error'):
configure('binutils',
'--prefix={target}',
'--with-isl={host}',
'--target=m68k-elf',
from_dir='{archives}/binutils')
build('binutils')
install('binutils')
unpack('gcc')
configure('gcc',
'--target=m68k-elf',
'--with-gmp={host}',
'--with-mpfr={host}',
'--with-cloog={host}',
'--prefix={target}',
'--enable-languages=c',
'--without-headers')
build('gcc', 'all-gcc')
install('gcc', 'install-gcc')
configure('gcc',
'--target=m68k-elf',
'--with-gmp={host}',
'--with-mpfr={host}',
'--with-isl={host}',
'--with-cloog={host}',
'--prefix={target}',
'--enable-languages=c',
'--without-headers',
from_dir='{archives}/gcc')
build('gcc', 'all-gcc')
install('gcc', 'install-gcc')
def clean():
rmtree('{stamps}')
rmtree('{sources}')
rmtree('{host}')
rmtree('{build}')
@ -154,6 +154,7 @@ if __name__ == "__main__":
build=path.join('{top}', '.build-dev', 'build'),
sources=path.join('{top}', '.build-dev', 'sources'),
host=path.join('{top}', '.build-dev', 'host'),
tmpdir=path.join('{top}', '.build-dev', 'tmp'),
target=path.join('{top}', 'm68k-elf'),
archives=path.join('{top}', '.build-dev', 'archives'))

View File

@ -197,8 +197,6 @@ def make():
environ['CXX'] = ' '.join([find_executable(CXX), '-std=gnu++98', ARCH])
find_executable('patch')
find_executable('bison')
find_executable('flex')
find_executable('make')
find_executable('git')
find_executable('svn')

View File

@ -70,9 +70,11 @@ def make():
environ['CC'] = find_executable(cc)
environ['CXX'] = find_executable(cxx)
find_executable('patch')
find_executable('bison')
find_executable('flex')
find_executable('make')
find_executable('git')
find_executable('svn')
environ['PATH'] = ":".join([path.join('{target}', 'bin'),
@ -87,10 +89,11 @@ def make():
name = path.basename(url)
fetch(name, url)
unpack('{lha}', copy=path.join('{build}', '{lha}'))
unpack('{lha}')
configure('{lha}',
'--disable-shared',
'--prefix={host}')
'--prefix={host}',
copy_source=True)
build('{lha}')
install('{lha}')
@ -229,6 +232,7 @@ if __name__ == "__main__":
build=path.join('{top}', '.build-ppc', 'build'),
sources=path.join('{top}', '.build-ppc', 'sources'),
host=path.join('{top}', '.build-ppc', 'host'),
tmpdir=path.join('{top}', '.build-ppc', 'tmpdir'),
target=path.join('{top}', 'ppc-amigaos'),
archives=path.join('{top}', '.build-ppc', 'archives'))