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 # local path wildcard dest path
return [('rtemsbsd/include', '**/*.h', ''), return [('rtemsbsd/include', '**/*.h', ''),
('rtemsbsd/\' + bld.env.RTEMS_ARCH + \'/include', '**/*.h', ''),
('rtemsbsd/mghttpd', 'mongoose.h', 'mghttpd'), ('rtemsbsd/mghttpd', 'mongoose.h', 'mghttpd'),
('freebsd/include', '**/*.h', ''), ('freebsd/include', '**/*.h', ''),
('freebsd/sys/bsm', '**/*.h', 'bsm'), ('freebsd/sys/bsm', '**/*.h', 'bsm'),

View File

@ -2345,6 +2345,7 @@ def build(bld):
# Installs. # Installs.
bld.install_files("${PREFIX}/" + rtems.arch_bsp_lib_path(bld.env.RTEMS_VERSION, bld.env.RTEMS_ARCH_BSP), ["libbsd.a"]) 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', ''), header_paths = [('rtemsbsd/include', '**/*.h', ''),
('rtemsbsd/' + bld.env.RTEMS_ARCH + '/include', '**/*.h', ''),
('rtemsbsd/mghttpd', 'mongoose.h', 'mghttpd'), ('rtemsbsd/mghttpd', 'mongoose.h', 'mghttpd'),
('freebsd/include', '**/*.h', ''), ('freebsd/include', '**/*.h', ''),
('freebsd/sys/bsm', '**/*.h', 'bsm'), ('freebsd/sys/bsm', '**/*.h', 'bsm'),
@ -2425,10 +2426,11 @@ def build(bld):
for headers in header_paths: 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]) 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]) start_dir = bld.path.find_dir(headers[0])
bld.install_files("${PREFIX}/" + ipath, if start_dir != None:
start_dir.ant_glob(headers[1]), bld.install_files("${PREFIX}/" + ipath,
cwd = start_dir, start_dir.ant_glob(headers[1]),
relative_trick = True) cwd = start_dir,
relative_trick = True)
# Tests # Tests
test_arphole = ['testsuite/arphole/test_main.c'] test_arphole = ['testsuite/arphole/test_main.c']

View File

@ -181,6 +181,9 @@ class YaccFragmentComposer(builder.BuildSystemFragmentComposer):
d['includes'] = self.includes d['includes'] = self.includes
return ['yacc', path, ('default', None)], d return ['yacc', path, ('default', None)], d
def headerPathSpec(headerPath):
return '(\'%s\', \'%s\', \'%s\')' % (headerPath[0], headerPath[1], headerPath[2])
# Module Manager - Collection of Modules # Module Manager - Collection of Modules
class ModuleManager(builder.ModuleManager): class ModuleManager(builder.ModuleManager):
@ -644,10 +647,10 @@ class ModuleManager(builder.ModuleManager):
self.add(' # Installs. ') 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"])') 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() 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]: for hp in headerPaths[1:-1]:
self.add(' %s,' % (str(hp))) self.add(' %s,' % (headerPathSpec(hp)))
self.add(' %s]' % (str(headerPaths[-1]))) self.add(' %s]' % (headerPathSpec(headerPaths[-1])))
self.add(' for headers in header_paths:') 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(' 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])') self.add(' start_dir = bld.path.find_dir(headers[0])')