v01d opened a new pull request #1786: URL: https://github.com/apache/incubator-nuttx/pull/1786
## Summary This works by having the build system look for nuttx/external/Kconfig to determine whether this directory is present or not. nuttx/external is gitignored in order to be added by the final user but not to be commited into the repo. Tipically this will by a symbolic link, just like apps/external. Inside external/ a Makefile should be placed with the same structure than any nuttx/ subdirectory (eg: nuttx/drivers/). The nuttx/external/Kconfig will be sourced and any options defined there will appear at the bottom of menuconfig (unless options are conditioned on menus, in which case they will appear accordingly). The purpose is to allow arch/board independent code, which for any reason is not to be upstreamed (propietary, not relevant for mainline, testing, etc), to be built into the OS during OS building stage. This way the user does not need to fork the NuttX repo to do so. This feature complements well with external apps and custom board support. ## Impact This is implemented by extending the build to consider one extra subdirectory `external` depending on if `external/Kconfig` is present. The build process for this directory will be the same as for any of the nuttx top-level subdirectories. There's one tricky part which is that as Kconfig cannot conditionally include a file, in order to include include external/Kconfig when it exists, a similar strategy that is used for including ../apps/Kconfig is used. This works by defining an environment variable `EXTERNALDIR` which is set to `external` (when external/Kconfig exists) or to `.external-dummy` (if not). Inside this directory there's an empty Kconfig which will then be included when `external` is not present. This strategy avoids the need for autogenerated Kconfig file, as it is done for `apps/Kconfig` and thus I think it is a bit cleaner. ## Testing I tested building either with external and without it and it works correctly. Also, Kconfig options are exposed as expected. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
