mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-13 02:54:30 +08:00
Revert "waf: Move the tools/BSP include path to be last"
This reverts commit 6ee31ae968323c71c478b2f52ec5a5cbff8c8f5d. A fix has been committed to RTEMS pkgcfg and Makefile generation to handle this issue and having this in place with the fix in RTEMS causes a failure to build.
This commit is contained in:
parent
7170d1ed14
commit
01b04a01da
@ -2,7 +2,7 @@
|
||||
"""LibBSD build configuration to waf integration module.
|
||||
"""
|
||||
|
||||
# Copyright (c) 2015, 2021 Chris Johns <chrisj@rtems.org>. All rights reserved.
|
||||
# Copyright (c) 2015, 2020 Chris Johns <chrisj@rtems.org>. All rights reserved.
|
||||
#
|
||||
# Copyright (c) 2009, 2015 embedded brains GmbH. All rights reserved.
|
||||
#
|
||||
@ -62,13 +62,6 @@ def _add_flags_if_not_present(current_flags, addional_flags):
|
||||
if flag not in current_flags:
|
||||
current_flags.append(flag)
|
||||
|
||||
def _remove_bsp_include_path(bsp_include_path, current_flags):
|
||||
# this does not handle quted strings; maybe needed
|
||||
for bsp_path in bsp_include_path:
|
||||
if bsp_path in current_flags:
|
||||
current_flags = [flag for flag in current_flags if flag != bsp_path]
|
||||
return current_flags
|
||||
|
||||
#
|
||||
# The waf builder for libbsd.
|
||||
#
|
||||
@ -194,12 +187,6 @@ class Builder(builder.ModuleManager):
|
||||
conf.env['HAVE_%s' % l.upper()] = True
|
||||
else:
|
||||
bld.fatal('invalid config test: %s' % (configTest))
|
||||
conf.env.CFLAGS = _remove_bsp_include_path(conf.env.IFLAGS,
|
||||
conf.env.CFLAGS)
|
||||
conf.env.CXXFLAGS = _remove_bsp_include_path(conf.env.IFLAGS,
|
||||
conf.env.CXXFLAGS)
|
||||
conf.env.LINKFLAGS = _remove_bsp_include_path(conf.env.IFLAGS,
|
||||
conf.env.LINKFLAGS)
|
||||
section_flags = ["-fdata-sections", "-ffunction-sections"]
|
||||
_add_flags_if_not_present(conf.env.CFLAGS, section_flags)
|
||||
_add_flags_if_not_present(conf.env.CXXFLAGS, section_flags)
|
||||
@ -250,7 +237,7 @@ class Builder(builder.ModuleManager):
|
||||
inc_paths = sorted(include_paths)
|
||||
inc_paths.remove('build')
|
||||
inc_paths.remove('cpu')
|
||||
includes = { 'bsp': [p[2:] for p in bld.env.IFLAGS] }
|
||||
includes = {}
|
||||
for inc in inc_paths:
|
||||
includes[inc] = include_paths[inc]
|
||||
# cpu include paths must be the first searched
|
||||
@ -445,7 +432,7 @@ class Builder(builder.ModuleManager):
|
||||
bld.objects(target='kvmsymbols',
|
||||
features='c',
|
||||
cflags=cflags,
|
||||
includes=kvmsymbols_includes + includes['kernel'] + includes['bsp'],
|
||||
includes=kvmsymbols_includes + includes['kernel'],
|
||||
source=kvmsymbols['files']['all']['default'][0])
|
||||
libbsd_use += ["kvmsymbols"]
|
||||
|
||||
@ -500,7 +487,7 @@ class Builder(builder.ModuleManager):
|
||||
bld.objects(target='lex_%s' % (lex['sym']),
|
||||
features='c',
|
||||
cflags=cflags,
|
||||
includes=lexIncludes + includes['user'] + includes['bsp'],
|
||||
includes=lexIncludes + includes['user'],
|
||||
defines=defines + lexDefines,
|
||||
source=lex['file'][:-2] + '.c')
|
||||
libbsd_use += ['lex_%s' % (lex['sym'])]
|
||||
@ -540,7 +527,7 @@ class Builder(builder.ModuleManager):
|
||||
bld.objects(target='yacc_%s' % (yaccSym),
|
||||
features='c',
|
||||
cflags=cflags,
|
||||
includes=yaccIncludes + includes['user'] + includes['bsp'],
|
||||
includes=yaccIncludes + includes['user'],
|
||||
defines=defines + yaccDefines,
|
||||
source=yaccFile[:-2] + '.c')
|
||||
libbsd_use += ['yacc_%s' % (yaccSym)]
|
||||
@ -574,7 +561,7 @@ class Builder(builder.ModuleManager):
|
||||
cflags=cflags + bld_cflags,
|
||||
cxxflags=cxxflags,
|
||||
includes=sorted(build.get('includes', [])) +
|
||||
includes[space] + includes['bsp'],
|
||||
includes[space],
|
||||
defines=defines,
|
||||
source=bld_sources)
|
||||
libbsd_use += [target]
|
||||
@ -594,7 +581,7 @@ class Builder(builder.ModuleManager):
|
||||
features='c cxx',
|
||||
cflags=cflags,
|
||||
cxxflags=cxxflags,
|
||||
includes=includes['kernel'] + includes['bsp'],
|
||||
includes=includes['kernel'],
|
||||
defines=defines,
|
||||
source=bld_sources,
|
||||
use=libbsd_use)
|
||||
@ -671,7 +658,7 @@ class Builder(builder.ModuleManager):
|
||||
bld.program(target='%s.exe' % (testName),
|
||||
features='cprogram',
|
||||
cflags=cflags,
|
||||
includes=includes['user'] + includes['bsp'],
|
||||
includes=includes['user'],
|
||||
source=test_sources,
|
||||
use=['bsd'],
|
||||
lib=libs,
|
||||
|
Loading…
x
Reference in New Issue
Block a user