From: Simon Glass <sjg@chromium.org>
If CPP is set (e.g. to 'gcc -E') buildman currently gives an error. Add
a little more logic to handle this case.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
tools/buildman/boards.py | 4 ++--
tools/buildman/func_test.py | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
@@ -247,8 +247,8 @@ class KconfigScanner:
temp = None
if b'#include' in tools.read_file(defconfig):
- cmd = [
- os.getenv('CPP', 'cpp'),
+ cpp = os.getenv('CPP', 'cpp').split()
+ cmd = cpp + [
'-nostdinc', '-P',
'-I', self._srctree,
'-undef',
@@ -427,7 +427,8 @@ class TestFunctional(unittest.TestCase):
return self._HandleCommandSize(args)
elif cmd.endswith( 'cpp'):
return self._HandleCommandCpp(args)
-
+ elif cmd == 'gcc' and args[0] == '-E':
+ return self._HandleCommandCpp(args[1:])
if not result:
# Not handled, so abort
print('unknown command', kwargs)