aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-30 03:17:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-30 03:17:06 -0400
commit1d3fe4a75b691285cded47c9f1a91b30d25287b0 (patch)
treed967425c1e961133ff0df98b986e81fae9162ba7 /include
parent664a41b8a91bf78a01a751e15175e0008977685a (diff)
parent2a11c8ea20bf850b3a2c60db8c2e7497d28aba99 (diff)
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: (25 commits) kconfig: Introduce IS_ENABLED(), IS_BUILTIN() and IS_MODULE() xconfig: Abort close if configuration cannot be saved kconfig: fix missing "0x" prefix from S_HEX symbol in autoconf.h kconfig/nconf: remove useless conditionnal kconfig/nconf: prevent segfault on empty menu kconfig/nconf: use the generic menu_get_ext_help() nconfig: Avoid Wunused-but-set warning kconfig/conf: mark xfgets() private kconfig: remove pending prototypes for kconfig_load() kconfig/conf: add command line options' description kconfig/conf: reduce the scope of `defconfig_file' kconfig: use calloc() for expr allocation kconfig: introduce specialized printer kconfig: do not overwrite symbol direct dependency in assignment kconfig/gconf: silent missing prototype warnings kconfig/gconf: kill deadcode kconfig: nuke LKC_DIRECT_LINK cruft kconfig: nuke reference to SWIG kconfig: add missing <stdlib.h> inclusion kconfig: add missing <ctype.h> inclusion ... Fix up conflicts in scripts/kconfig/Makefile
Diffstat (limited to 'include')
-rw-r--r--include/linux/kconfig.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
new file mode 100644
index 000000000000..067eda0e4b32
--- /dev/null
+++ b/include/linux/kconfig.h
@@ -0,0 +1,32 @@
1#ifndef __LINUX_KCONFIG_H
2#define __LINUX_KCONFIG_H
3
4#include <generated/autoconf.h>
5
6/*
7 * Helper macros to use CONFIG_ options in C expressions. Note that
8 * these only work with boolean and tristate options.
9 */
10
11/*
12 * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
13 * 0 otherwise.
14 *
15 */
16#define IS_ENABLED(option) \
17 (__enabled_ ## option || __enabled_ ## option ## _MODULE)
18
19/*
20 * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
21 * otherwise. For boolean options, this is equivalent to
22 * IS_ENABLED(CONFIG_FOO).
23 */
24#define IS_BUILTIN(option) __enabled_ ## option
25
26/*
27 * IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0
28 * otherwise.
29 */
30#define IS_MODULE(option) __enabled_ ## option ## _MODULE
31
32#endif /* __LINUX_KCONFIG_H */