mirror of
https://github.com/cahirwpz/amigaos-cross-toolchain
synced 2026-09-12 12:10:43 +00:00
Merge branch 'master' of github.com:cahirwpz/amigaos-cross-toolchain
This commit is contained in:
@@ -451,8 +451,38 @@ def make(name, target=None, **makevars):
|
||||
execute('make', *args)
|
||||
|
||||
|
||||
def require_header(header, lang, msg = '', symbol = False, value = False):
|
||||
debug('require_header "%s"', header)
|
||||
|
||||
cmd = {'c':'{cc}', 'c++':'{cxx}'}[lang]
|
||||
cmd = fill_in(cmd).split() + ['-fsyntax-only', '-x', lang, '-']
|
||||
proc = subprocess.Popen(cmd, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
|
||||
|
||||
stdin_line = '#include <' + header + '>'
|
||||
if symbol:
|
||||
if value:
|
||||
stdin_line += """\n#if %s != %s
|
||||
#error
|
||||
#endif """ % (symbol, value)
|
||||
else:
|
||||
stdin_line += """\n#ifndef %s
|
||||
#error
|
||||
#endif """ % (symbol)
|
||||
|
||||
(result_stdout, result_stderr) = proc.communicate(stdin_line)
|
||||
proc.wait()
|
||||
|
||||
cmd = ' '.join(cmd)
|
||||
|
||||
if proc.returncode == 0:
|
||||
debug('output from "%s":\n%s', cmd, result_stdout)
|
||||
else:
|
||||
debug('error output from "%s":\n%s', cmd, result_stderr)
|
||||
panic('require_header failed: %s', msg)
|
||||
|
||||
|
||||
__all__ = ['setvar', 'panic', 'cmpver', 'find_executable', 'chmod', 'execute',
|
||||
'rmtree', 'mkdir', 'copy', 'copytree', 'unarc', 'fetch', 'cwd',
|
||||
'symlink', 'remove', 'move', 'find', 'textfile', 'env', 'path',
|
||||
'add_site_dir', 'python_setup', 'recipe', 'unpack', 'patch',
|
||||
'configure', 'make']
|
||||
'configure', 'make', 'require_header']
|
||||
|
||||
+11
-2
@@ -117,8 +117,8 @@ def build_vbcc():
|
||||
'n', 'y', 'unsigned short',
|
||||
'n', 'y', 'signed int',
|
||||
'n', 'y', 'unsigned int',
|
||||
'n', 'y', 'signed long',
|
||||
'n', 'y', 'unsigned long',
|
||||
'n', 'y', 'signed long long',
|
||||
'n', 'y', 'unsigned long long',
|
||||
'n', 'y', 'float',
|
||||
'n', 'y', 'double')
|
||||
make('vbcc', TARGET='m68k', ETCDIR='\\"{target}/etc/\\"', CONFIG=config)
|
||||
@@ -241,6 +241,15 @@ def build():
|
||||
path.join('{host}', 'bin'),
|
||||
environ['PATH']])
|
||||
|
||||
setvar(cc = environ['CC'], cxx = environ['CXX'])
|
||||
|
||||
"""
|
||||
When we have a working compiler in our path, we can also check if the
|
||||
required headers/libraries are present.
|
||||
"""
|
||||
|
||||
require_header('ncurses.h', 'c', 'libncurses-dev 5.x missing', 'NCURSES_VERSION_MAJOR', 5)
|
||||
|
||||
unpack('{m4}')
|
||||
configure('{m4}', '--prefix={host}')
|
||||
make('{m4}')
|
||||
|
||||
Reference in New Issue
Block a user