From 6156041560c75831e003202b790ab3f435bbb388 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Thu, 20 Sep 2018 13:33:59 +0200 Subject: Add support for user-defined Python preprocessor functions Allow preprocessor functions to be defined in Python by putting a module called 'kconfigfunctions' into sys.path. Internally, this simply adds the functions to the predefined functions in Kconfig._functions. User-defined Python functions make it simple to integrate information from existing Python tools into Kconfig, e.g. to have Kconfig symbols depend on hardware information stored in some other format. This might be used to get device tree information into Kconfig in Zephyr. Piggyback module docstring documentation for some extensions that were previously only mentioned in the README. --- README.rst | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'README.rst') diff --git a/README.rst b/README.rst index 4600304..a2f66c9 100644 --- a/README.rst +++ b/README.rst @@ -207,6 +207,15 @@ The following Kconfig extensions are available: are specified relative to the directory of the current Kconfig file. An ``orsource`` statement is available as well, analogous to ``osource``. +- Preprocessor user functions can be defined in Python, which makes it simple + to integrate information from existing Python tools into Kconfig (e.g. to + have Kconfig symbols depend on hardware information stored in some other + format). + + See the *Kconfig extensions* section in the + `kconfiglib.py `_ + module docstring for more information. + - ``def_int``, ``def_hex``, and ``def_string`` are available in addition to ``def_bool`` and ``def_tristate``, allowing ``int``, ``hex``, and ``string`` symbols to be given a type and a default at the same time. -- cgit v1.2.3