aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-03-20 22:03:47 +0200
committerGitHub <noreply@github.com>2019-03-20 22:03:47 +0200
commited5992a10d8b71733361130a12c08f92207ae075 (patch)
treef5bac307d9de5cce2135fc87b0a613a8e5641b77 /docs
parentc6abca289bc2d72cd054615bc68a4f6b448814d8 (diff)
parent49076d719cf28886ad66fc13cbba8d3d94afb332 (diff)
downloadmeson-ed5992a10d8b71733361130a12c08f92207ae075.zip
meson-ed5992a10d8b71733361130a12c08f92207ae075.tar.gz
meson-ed5992a10d8b71733361130a12c08f92207ae075.tar.bz2
Merge pull request #5031 from bonzini/kconfig
Kconfig Module
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Kconfig-module.md52
-rw-r--r--docs/markdown/snippets/kconfig.md5
-rw-r--r--docs/sitemap.txt1
3 files changed, 58 insertions, 0 deletions
diff --git a/docs/markdown/Kconfig-module.md b/docs/markdown/Kconfig-module.md
new file mode 100644
index 0000000..c361b5b
--- /dev/null
+++ b/docs/markdown/Kconfig-module.md
@@ -0,0 +1,52 @@
+---
+short-description: Unstable kconfig module
+authors:
+ - name: Mark Schulte, Paolo Bonzini
+ years: [2017, 2019]
+ has-copyright: false
+...
+
+# Unstable kconfig module
+
+This module parses Kconfig output files to allow use of kconfig
+configurations in meson projects.
+
+**Note**: this does not provide kconfig frontend tooling to generate a
+configuration. You still need something such as kconfig frontends (see
+link below) to parse your Kconfig files, and then (after you've
+choosen the configuration options), output a ".config" file.
+
+ [kconfig-frontends]: http://ymorin.is-a-geek.org/projects/kconfig-frontends
+
+## Usage
+
+The module may be imported as follows:
+
+``` meson
+kconfig = import('unstable-kconfig')
+```
+
+The following functions will then be available as methods on the object
+with the name `kconfig`. You can, of course, replace the name
+`kconfig` with anything else.
+
+### kconfig.load()
+
+This function loads a kconfig output file and returns a dictionary object.
+
+`kconfig.load()` makes no attempt at parsing the values in the
+file. Therefore, true boolean values will be represented as the string "y"
+and integer values will have to be converted with `.to_int()`.
+
+Kconfig frontends usually have ".config" as the default name for the
+configuration file. However, placing the configuration file in the source
+directory limits the user to one configuration per source directory.
+In order to allow separate configurations for each build directory, as is
+the Meson standard, `meson.build` should not hardcode ".config" as the
+argument to `kconfig.load()`, and should instead make the argument to
+`kconfig.load()` a [project build option](Build-options.md).
+
+* The first (and only) argument is the path to the configuration file to
+ load (usually ".config").
+
+**Returns**: a [dictionary object](Reference-manual.md#dictionary-object).
diff --git a/docs/markdown/snippets/kconfig.md b/docs/markdown/snippets/kconfig.md
new file mode 100644
index 0000000..d4d5c9b
--- /dev/null
+++ b/docs/markdown/snippets/kconfig.md
@@ -0,0 +1,5 @@
+## New module to parse kconfig output files
+
+The new module `unstable-kconfig` adds the ability to parse and use kconfig output
+files from `meson.build`.
+
diff --git a/docs/sitemap.txt b/docs/sitemap.txt
index bea2a31..2e6eb68 100644
--- a/docs/sitemap.txt
+++ b/docs/sitemap.txt
@@ -45,6 +45,7 @@ index.md
Simd-module.md
Windows-module.md
Cuda-module.md
+ Kconfig-module.md
Java.md
Vala.md
D.md