summaryrefslogtreecommitdiffstats
path: root/samples/Kconfig
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-06-04 06:13:59 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-06-15 06:57:01 -0400
commite949f4c2d6a3df2b7fd00e56c0f081b15284906f (patch)
treec5b592d884e6eef3680177e384dfd567cc6e03e5 /samples/Kconfig
parentc6509a24d6ba0f8560a81c032c30d169ba467b0a (diff)
kbuild: add CONFIG_HEADERS_INSTALL and loosen the dependency of samples
Commit 5318321d367c ("samples: disable CONFIG_SAMPLES for UML") used a big hammer to fix the build errors under the samples/ directory. Only some samples actually include uapi headers from usr/include. Introduce CONFIG_HEADERS_INSTALL since 'depends on HEADERS_INSTALL' is clearer than 'depends on !UML'. If this option is enabled, uapi headers are installed before starting directory descending. I added 'depends on HEADERS_INSTALL' to per-sample CONFIG options. This allows UML to compile some samples. $ make ARCH=um allmodconfig samples/ [ snip ] CC [M] samples/configfs/configfs_sample.o CC [M] samples/kfifo/bytestream-example.o CC [M] samples/kfifo/dma-example.o CC [M] samples/kfifo/inttype-example.o CC [M] samples/kfifo/record-example.o CC [M] samples/kobject/kobject-example.o CC [M] samples/kobject/kset-example.o CC [M] samples/trace_events/trace-events-sample.o CC [M] samples/trace_printk/trace-printk.o AR samples/vfio-mdev/built-in.a AR samples/built-in.a Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'samples/Kconfig')
-rw-r--r--samples/Kconfig14
1 files changed, 11 insertions, 3 deletions
diff --git a/samples/Kconfig b/samples/Kconfig
index d63cc8a3e0df..71b5e833dd9e 100644
--- a/samples/Kconfig
+++ b/samples/Kconfig
@@ -1,7 +1,6 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: GPL-2.0-only
2menuconfig SAMPLES 2menuconfig SAMPLES
3 bool "Sample kernel code" 3 bool "Sample kernel code"
4 depends on !UML
5 help 4 help
6 You can build and test sample kernel code here. 5 You can build and test sample kernel code here.
7 6
@@ -95,16 +94,24 @@ config SAMPLE_CONFIGFS
95 94
96config SAMPLE_CONNECTOR 95config SAMPLE_CONNECTOR
97 tristate "Build connector sample -- loadable modules only" 96 tristate "Build connector sample -- loadable modules only"
98 depends on CONNECTOR && m 97 depends on CONNECTOR && HEADERS_INSTALL && m
99 help 98 help
100 When enabled, this builds both a sample kernel module for 99 When enabled, this builds both a sample kernel module for
101 the connector interface and a user space tool to communicate 100 the connector interface and a user space tool to communicate
102 with it. 101 with it.
103 See also Documentation/connector/connector.txt 102 See also Documentation/connector/connector.txt
104 103
104config SAMPLE_HIDRAW
105 bool "hidraw sample"
106 depends on HEADERS_INSTALL
107
108config SAMPLE_PIDFD
109 bool "pidfd sample"
110 depends on HEADERS_INSTALL
111
105config SAMPLE_SECCOMP 112config SAMPLE_SECCOMP
106 bool "Build seccomp sample code" 113 bool "Build seccomp sample code"
107 depends on SECCOMP_FILTER 114 depends on SECCOMP_FILTER && HEADERS_INSTALL
108 help 115 help
109 Build samples of seccomp filters using various methods of 116 Build samples of seccomp filters using various methods of
110 BPF filter construction. 117 BPF filter construction.
@@ -156,6 +163,7 @@ config SAMPLE_ANDROID_BINDERFS
156 163
157config SAMPLE_VFS 164config SAMPLE_VFS
158 bool "Build example programs that use new VFS system calls" 165 bool "Build example programs that use new VFS system calls"
166 depends on HEADERS_INSTALL
159 help 167 help
160 Build example userspace programs that use new VFS system calls such 168 Build example userspace programs that use new VFS system calls such
161 as mount API and statx(). Note that this is restricted to the x86 169 as mount API and statx(). Note that this is restricted to the x86