summaryrefslogblamecommitdiffstats
path: root/md/writeup/kconf2h.md
blob: d8ae040d9946907e8d736753c3acaa586c2fa0e4 (plain) (tree)
1
2

                                                      

















































                                                                            
     




                                                   
     






                                                     
     



                
title: kconf2h - kernel config transltion to C headers

# 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

```text
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

```text
#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

```sh
git clone http://git.main.lv/cgit.cgi/kconfig2h.git
```

or 

```sh
git clone https://github.com/FreeArtMan/kconfig2h.git
```

## Compile

just 

```sh
make
```

should be enought