build: Separate the kernel and user land include paths

- Provide support for separate user and kernel include paths in
  libbsd.py.

- Update all added files with a suitable context to build them
  with. Supported contexts are `kernel` and `user`.

- Kernel source use the kernel, CPU, and build header paths in
  this order.

- User source use the user, kernel, CPU and build header paths
  in this order. The FreeBSD /usr/include tree has some kernel
  header files installed as well as user land header files. This
  complicates the separation as some kernel header files are not
  visible to user land code while other are. This is handled by
  appending the kernel header paths to the user header paths so
  user land code will include a user header with the same name as
  a kernel header over the kernel header but will find a kernel
  header if there is no matching user header file.

Closes #4067
This commit is contained in:
Chris Johns
2020-09-03 09:54:27 +10:00
parent 43742834c2
commit c38f93b0c6
6 changed files with 617 additions and 441 deletions

View File

@@ -152,6 +152,18 @@ try:
libbsd.load(build)
build.generateBuild(only_enabled=False)
dups = build.duplicateCheck()
if len(dups) > 0:
print()
print('Duplicates: %d' % (len(dups)))
mods = list(set([dup[0] for dup in dups]))
max_mod_len = max(len(dup[1]) for dup in dups)
for mod in mods:
print(' %s:' % (mod))
for dup in [dup for dup in dups if dup[0] == mod]:
print(' %-*s %s %s' % (max_mod_len, dup[1], dup[3][0].upper(), dup[2]))
print()
if isConfig:
print()
print(build)