]> git.baikalelectronics.ru Git - kernel.git/commit
kconfig: add 'shell' built-in function
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 28 May 2018 09:21:46 +0000 (18:21 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 28 May 2018 18:31:19 +0000 (03:31 +0900)
commitec3bf06ad18658019b73fd100ad8a3be5fd5c6ae
tree712cb918bbc6c7f58314e03330ea51bec6612905
parentf4a236146f5632084baaf3d70179500cb953d325
kconfig: add 'shell' built-in function

This accepts a single command to execute.  It returns the standard
output from it.

[Example code]

  config HELLO
          string
          default "$(shell,echo hello world)"

  config Y
          def_bool $(shell,echo y)

[Result]

  $ make -s alldefconfig && tail -n 2 .config
  CONFIG_HELLO="hello world"
  CONFIG_Y=y

Caveat:
Like environments, functions are expanded in the lexer.  You cannot
pass symbols to function arguments.  This is a limitation to simplify
the implementation.  I want to avoid the dynamic function evaluation,
which would introduce much more complexity.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/kconfig/preprocess.c