Skip to contentSkip to conversation

kbuild/kconfig for non-Linux projects

DISCUSSION Alexander Kriegisch 2 participants 3 messages Oct 2, 2011 Kbuild

lore
Share & tools
lore
#0 lore raw

I am new to this list, but trying to reply to an older thread, re-using its title/subject. I am going to quote Arnaud's message because my question relates to it.

@Arnaud: I have successfully downloaded, installed and built a tarball from your 2.6.39 branch. So far, so good. What I am trying to do, though, is to refresh an older kbuild version, taken from Buildroot some about years ago. It works nicely and I especially like the warnings for cyclic references and missing direct dependencies.

There is one issue we are facing in our open source project (http://freetz.org), though: Our previous kconfig version used symbols which were identical in .config with the names in Config.in, i.e. they had no "CONFIG_" prefixes. Now kconfig writes .config files with those prefixes, so in order not to break our build system we had to add scripts replacing names back and forth before we start conf/mconf and after they terminate.

Question: Is there a straightforward way to make kconfig read/write symbols *without* "CONFIG_" prefixes? As I am not a C programmer, would you mind providing a patch if necessary?

Respectfully

Signature · 1 line
Alexander Kriegisch
Quoted 14 lines

using kconfig outside the linux kernel tree should be trivial, normally, as you said, all the Linux "branding" should have been made configurable. The trick might be to have the correct Makefile glue to let it build. If you want some of the work pre-done, I just pushed an old repository of mine on github. It should contains only what's needed to build the various part of kconfig:

https://github.com/lacombar/kconfig/

I did not really touch it since October 2010, so it is certainly missing parts (especially bug fixes). Moreover, it squashes commit to keep the history clean, but I tried to keep the shortlog to have an idea what has been going on. Last warning, I do not guarantee the tree integrity (ie. I love rebasing :))

#1 lore raw

Okay, another developer in our project found the place where to configure this (Arnaud, please correct us if this is wrong):

kconfig/lkc.h +1 -1
@@ -42,7 +42,7 @@
 #define N_(text) (text)
 
 #ifndef CONFIG_
-#define CONFIG_ "CONFIG_"
+#define CONFIG_ ""
 #endif
 
 #define TF_COMMAND	0x0001

Just in case anyone else wonders how to do this... --
Alexander Kriegisch

Alexander Kriegisch, 02.10.2011 11:30:

Quoted 37 lines

I am new to this list, but trying to reply to an older thread, re-using its title/subject. I am going to quote Arnaud's message because my question relates to it.

@Arnaud: I have successfully downloaded, installed and built a tarball from your 2.6.39 branch. So far, so good. What I am trying to do, though, is to refresh an older kbuild version, taken from Buildroot some about years ago. It works nicely and I especially like the warnings for cyclic references and missing direct dependencies.

There is one issue we are facing in our open source project
(http://freetz.org), though: Our previous kconfig version used symbols which were identical in .config with the names in Config.in, i.e. they had no "CONFIG_" prefixes. Now kconfig writes .config files with those prefixes, so in order not to break our build system we had to add scripts replacing names back and forth before we start conf/mconf and after they terminate.

Question: Is there a straightforward way to make kconfig read/write symbols*without* "CONFIG_" prefixes? As I am not a C programmer, would you mind providing a patch if necessary?

Quoted 14 lines

using kconfig outside the linux kernel tree should be trivial, normally, as you said, all the Linux "branding" should have been made configurable. The trick might be to have the correct Makefile glue to let it build. If you want some of the work pre-done, I just pushed an old repository of mine on github. It should contains only what's needed to build the various part of kconfig:

https://github.com/lacombar/kconfig/

I did not really touch it since October 2010, so it is certainly missing parts (especially bug fixes). Moreover, it squashes commit to keep the history clean, but I tried to keep the shortlog to have an idea what has been going on. Last warning, I do not guarantee the tree integrity (ie. I love rebasing :))

#2 lore raw

Alexander, All,

Quoted 7 lines · On Sunday 02 October 2011 12:56:46 Alexander Kriegisch wrote:

Okay, another developer in our project found the place where to configure this (Arnaud, please correct us if this is wrong):

kconfig/lkc.h line 48

Quoted 8 lines
kconfig/lkc.h +1 -1
@@ -42,7 +42,7 @@
  #define N_(text) (text)
 
  #ifndef CONFIG_
-#define CONFIG_ "CONFIG_"
+#define CONFIG_ ""
  #endif
 
  #define TF_COMMAND	0x0001

The proper way to do it is to pass it to the compiler with the -D option:

    -DCONFIG_=\"\"

You should put it in your Makefile, in the proper CFLAGS (or CPPFLAGS).

If you change the code, you may have /merge/ issues later if you have to resync again.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'