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:
Kinsey Moore 2022-10-17 13:16:10 -05:00 committed by Joel Sherrill
parent 7170d1ed14
commit 01b04a01da

View File

@ -2,7 +2,7 @@
"""LibBSD build configuration to waf integration module. """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. # 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: if flag not in current_flags:
current_flags.append(flag) 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. # The waf builder for libbsd.
# #
@ -194,12 +187,6 @@ class Builder(builder.ModuleManager):
conf.env['HAVE_%s' % l.upper()] = True conf.env['HAVE_%s' % l.upper()] = True
else: else:
bld.fatal('invalid config test: %s' % (configTest)) 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"] section_flags = ["-fdata-sections", "-ffunction-sections"]
_add_flags_if_not_present(conf.env.CFLAGS, section_flags) _add_flags_if_not_present(conf.env.CFLAGS, section_flags)
_add_flags_if_not_present(conf.env.CXXFLAGS, 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 = sorted(include_paths)
inc_paths.remove('build') inc_paths.remove('build')
inc_paths.remove('cpu') inc_paths.remove('cpu')
includes = { 'bsp': [p[2:] for p in bld.env.IFLAGS] } includes = {}
for inc in inc_paths: for inc in inc_paths:
includes[inc] = include_paths[inc] includes[inc] = include_paths[inc]
# cpu include paths must be the first searched # cpu include paths must be the first searched
@ -445,7 +432,7 @@ class Builder(builder.ModuleManager):
bld.objects(target='kvmsymbols', bld.objects(target='kvmsymbols',
features='c', features='c',
cflags=cflags, cflags=cflags,
includes=kvmsymbols_includes + includes['kernel'] + includes['bsp'], includes=kvmsymbols_includes + includes['kernel'],
source=kvmsymbols['files']['all']['default'][0]) source=kvmsymbols['files']['all']['default'][0])
libbsd_use += ["kvmsymbols"] libbsd_use += ["kvmsymbols"]
@ -500,7 +487,7 @@ class Builder(builder.ModuleManager):
bld.objects(target='lex_%s' % (lex['sym']), bld.objects(target='lex_%s' % (lex['sym']),
features='c', features='c',
cflags=cflags, cflags=cflags,
includes=lexIncludes + includes['user'] + includes['bsp'], includes=lexIncludes + includes['user'],
defines=defines + lexDefines, defines=defines + lexDefines,
source=lex['file'][:-2] + '.c') source=lex['file'][:-2] + '.c')
libbsd_use += ['lex_%s' % (lex['sym'])] libbsd_use += ['lex_%s' % (lex['sym'])]
@ -540,7 +527,7 @@ class Builder(builder.ModuleManager):
bld.objects(target='yacc_%s' % (yaccSym), bld.objects(target='yacc_%s' % (yaccSym),
features='c', features='c',
cflags=cflags, cflags=cflags,
includes=yaccIncludes + includes['user'] + includes['bsp'], includes=yaccIncludes + includes['user'],
defines=defines + yaccDefines, defines=defines + yaccDefines,
source=yaccFile[:-2] + '.c') source=yaccFile[:-2] + '.c')
libbsd_use += ['yacc_%s' % (yaccSym)] libbsd_use += ['yacc_%s' % (yaccSym)]
@ -574,7 +561,7 @@ class Builder(builder.ModuleManager):
cflags=cflags + bld_cflags, cflags=cflags + bld_cflags,
cxxflags=cxxflags, cxxflags=cxxflags,
includes=sorted(build.get('includes', [])) + includes=sorted(build.get('includes', [])) +
includes[space] + includes['bsp'], includes[space],
defines=defines, defines=defines,
source=bld_sources) source=bld_sources)
libbsd_use += [target] libbsd_use += [target]
@ -594,7 +581,7 @@ class Builder(builder.ModuleManager):
features='c cxx', features='c cxx',
cflags=cflags, cflags=cflags,
cxxflags=cxxflags, cxxflags=cxxflags,
includes=includes['kernel'] + includes['bsp'], includes=includes['kernel'],
defines=defines, defines=defines,
source=bld_sources, source=bld_sources,
use=libbsd_use) use=libbsd_use)
@ -671,7 +658,7 @@ class Builder(builder.ModuleManager):
bld.program(target='%s.exe' % (testName), bld.program(target='%s.exe' % (testName),
features='cprogram', features='cprogram',
cflags=cflags, cflags=cflags,
includes=includes['user'] + includes['bsp'], includes=includes['user'],
source=test_sources, source=test_sources,
use=['bsd'], use=['bsd'],
lib=libs, lib=libs,