0518a98ac3
While the autotools infrastructure was using FOO_MAKE_OPT, generic packages were typically using FOO_MAKE_OPTS. This inconsistency becomes a problem when a new infrastructure is introduced that wants to make use of FOO_MAKE_OPT(S), and can live alongside either generic-package or autotools-package. The new infrastructure will have to choose between either OPT or OPTS, and thus rule out transparent usage by respectively generic packages or generic packages. An example of such an infrastructure is kconfig-package, which provides kconfig-related make targets. The OPTS variant is more logical, as there are typically multiple options. This patch renames all occurrences of FOO_MAKE_OPT in FOO_MAKE_OPTS. Sed command used: find * -type f | xargs sed -i 's#_MAKE_OPT\>#&S#g' Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
57 lines
2.3 KiB
Plaintext
57 lines
2.3 KiB
Plaintext
// -*- mode:doc; -*-
|
|
// vim: set syntax=asciidoc:
|
|
|
|
=== Infrastructure for packages using kconfig for configuration files
|
|
|
|
A popular way for a software package to handle user-specified
|
|
configuration is +kconfig+. Among others, it is used by the Linux
|
|
kernel, Busybox, and Buildroot itself. The presence of a .config file
|
|
and a +menuconfig+ target are two well-known symptoms of kconfig being
|
|
used.
|
|
|
|
Buildroot features an infrastructure for packages that use kconfig for
|
|
their configuration. This infrastructure provides the necessary logic to
|
|
expose the package's +menuconfig+ target as +foo-menuconfig+ in
|
|
Buildroot, and to handle the copying back and forth of the configuration
|
|
file in a correct way.
|
|
|
|
The +kconfig-package+ infrastructure is based on the +generic-package+
|
|
infrastructure. All variables supported by +generic-package+ are
|
|
available in +kconfig-package+ as well. See
|
|
xref:generic-package-reference[] for more details.
|
|
|
|
In order to use the +kconfig-package+ infrastructure for a Buildroot
|
|
package, the minimally required lines in the +.mk+ file, in addition to
|
|
the variables required by the +generic-package+ infrastructure, are:
|
|
|
|
------------------------------
|
|
FOO_KCONFIG_FILE = reference-to-source-configuration-file
|
|
|
|
$(eval $(kconfig-package))
|
|
------------------------------
|
|
|
|
This snippet creates the following make targets:
|
|
|
|
* +foo-menuconfig+, which calls the package's +menuconfig+ target
|
|
|
|
* +foo-update-config+, which copies the configuration back to the source
|
|
configuration file.
|
|
|
|
and ensures that the source configuration file is copied to the build
|
|
directory at the right moment.
|
|
|
|
In addition to these minimally required lines, several optional variables can
|
|
be set to suit the needs of the package under consideration:
|
|
|
|
* +FOO_KCONFIG_EDITORS+: a space-separated list of kconfig editors to
|
|
support, for example 'menuconfig xconfig'. By default, 'menuconfig'.
|
|
|
|
* +FOO_KCONFIG_OPT+: extra options to pass when calling the kconfig
|
|
editors. This may need to include '$(FOO_MAKE_OPTS)', for example. By
|
|
default, empty.
|
|
|
|
* +FOO_KCONFIG_FIXUP_CMDS+: a list of shell commands needed to fixup the
|
|
configuration file after copying it or running a kconfig editor. Such
|
|
commands may be needed to ensure a configuration consistent with other
|
|
configuration of Buildroot, for example. By default, empty.
|