waf: Install arch-specific header files

This commit is contained in:
Sebastian Huber 2017-06-27 08:34:53 +02:00
parent e846288593
commit 33d82be1e6
3 changed files with 13 additions and 7 deletions

View File

@ -223,6 +223,7 @@ def headerPaths():
# local path wildcard dest path
return [('rtemsbsd/include', '**/*.h', ''),
('rtemsbsd/\' + bld.env.RTEMS_ARCH + \'/include', '**/*.h', ''),
('rtemsbsd/mghttpd', 'mongoose.h', 'mghttpd'),
('freebsd/include', '**/*.h', ''),
('freebsd/sys/bsm', '**/*.h', 'bsm'),

View File

@ -2345,6 +2345,7 @@ def build(bld):
# Installs.
bld.install_files("${PREFIX}/" + rtems.arch_bsp_lib_path(bld.env.RTEMS_VERSION, bld.env.RTEMS_ARCH_BSP), ["libbsd.a"])
header_paths = [('rtemsbsd/include', '**/*.h', ''),
('rtemsbsd/' + bld.env.RTEMS_ARCH + '/include', '**/*.h', ''),
('rtemsbsd/mghttpd', 'mongoose.h', 'mghttpd'),
('freebsd/include', '**/*.h', ''),
('freebsd/sys/bsm', '**/*.h', 'bsm'),
@ -2425,6 +2426,7 @@ def build(bld):
for headers in header_paths:
ipath = os.path.join(rtems.arch_bsp_include_path(bld.env.RTEMS_VERSION, bld.env.RTEMS_ARCH_BSP), headers[2])
start_dir = bld.path.find_dir(headers[0])
if start_dir != None:
bld.install_files("${PREFIX}/" + ipath,
start_dir.ant_glob(headers[1]),
cwd = start_dir,

View File

@ -181,6 +181,9 @@ class YaccFragmentComposer(builder.BuildSystemFragmentComposer):
d['includes'] = self.includes
return ['yacc', path, ('default', None)], d
def headerPathSpec(headerPath):
return '(\'%s\', \'%s\', \'%s\')' % (headerPath[0], headerPath[1], headerPath[2])
# Module Manager - Collection of Modules
class ModuleManager(builder.ModuleManager):
@ -644,10 +647,10 @@ class ModuleManager(builder.ModuleManager):
self.add(' # Installs. ')
self.add(' bld.install_files("${PREFIX}/" + rtems.arch_bsp_lib_path(bld.env.RTEMS_VERSION, bld.env.RTEMS_ARCH_BSP), ["libbsd.a"])')
headerPaths = builder.headerPaths()
self.add(' header_paths = [%s,' % (str(headerPaths[0])))
self.add(' header_paths = [%s,' % (headerPathSpec(headerPaths[0])))
for hp in headerPaths[1:-1]:
self.add(' %s,' % (str(hp)))
self.add(' %s]' % (str(headerPaths[-1])))
self.add(' %s,' % (headerPathSpec(hp)))
self.add(' %s]' % (headerPathSpec(headerPaths[-1])))
self.add(' for headers in header_paths:')
self.add(' ipath = os.path.join(rtems.arch_bsp_include_path(bld.env.RTEMS_VERSION, bld.env.RTEMS_ARCH_BSP), headers[2])')
self.add(' start_dir = bld.path.find_dir(headers[0])')