Kconfig.py is not following the de-facto (real?) coding standards of
Zephyr. This commit refactors kconfig.py with two changes:
Use __main__ and def main().
Use argparse instead of sys.argv.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
The warning from Kconfiglib might be hard to spot, and the problem is
easily fixed right away (note that malformed .config lines are different
from assignments to undefined symbols).
Do not make malformed .config lines an error in Kconfiglib itself (just
a warning), as you end up with messy "half-loaded" configurations.
Suggested by Marti Bolivar.
Piggyback some minor cleanups in kconfig.py. Make the warning for
configuration settings that didn't match the final value go to stderr,
for consistency.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Warnings from Kconfiglib itself always give symbol locations, but the
custom value mismatch warning in kconfig.py doesn't. Make it print the
symbol location(s) too. This is helpful when debugging.
Before:
warning: UART_QMSI_0_HW_FC was assigned the value "y" but got the
value "n" -- check dependencies
After:
warning: UART_QMSI_0_HW_FC (defined at
.../drivers/serial/Kconfig.qmsi:35,
.../arch/x86/soc/intel_quark/quark_se/Kconfig.defconfig.series:194)
was assigned the value "y" but got the value "n" -- check
dependencies
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Decode Kconfig sources as UTF-8 instead of decoding them according to
the system locale (which might be ascii-only).
This resolves an issue that can be reproduced like this:
$ export LANG=C
$ echo '# Sebastian Bøe' >> ~/zephyr/Kconfig
$ build_any_zephyr_app
See the Python comment for details.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
We have been using a fork of the Linux kernel's Kconfig system to
configure the Zephyr tree. The issue is that this is a native tool
written in C that is not easy to compile for Windows. This patch
replaces the use of the conf executable with kconfig.py, a script that
uses Kconfiglib to generate the .config and autoconf.h files required to
compile Zephyr.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>