kconf2h - kernel config transltion to C headers

Kernel menuconfig is cool way how to configure files and enable/disable some flag/constants inside source here is small tool that converts files like

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
CONFIG_CORE=y
CONFIG_OS_LINUX=y
# CONFIG_OS_NETBSD is not set
# CONFIG_FUTURE is not set
CONFIG_DRAW=y
CONFIG_GL=y
CONFIG_SDL2=y
CONFIG_TUI=y
CONFIG_HW=y
CONFIG_HW_LIB_ORIG=y
# CONFIG_HW_LIB_R820T is not set
CONFIG_HW_ALSA=y
# CONFIG_HW_NO_AUDIO is not set
CONFIG_MOD=y
CONFIG_MOD_FM_DEMOD=y
# CONFIG_PROTO is not set

to just c headers

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#define CONFIG_CORE
#define CONFIG_OS_LINUX
#define CONFIG_DRAW
#define CONFIG_GL
#define CONFIG_SDL2
#define CONFIG_TUI
#define CONFIG_HW
#define CONFIG_HW_LIB_ORIG
#define CONFIG_HW_ALSA
#define CONFIG_MOD
#define CONFIG_MOD_FM_DEMOD

doesnt support anything else except yes/no

Tested

OS Arch
Linux 32/64bit intel

Source

1
git clone http://git.main.lv/cgit.cgi/kconfig2h.git

or

1
git clone https://github.com/FreeArtMan/kconfig2h.git

Compile

just

1
make

should be enought