public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Erik Andersen <andersen@codepoet.org>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Where's the documentation for Kconfig?
Date: Sat, 2 Nov 2002 06:51:09 -0700	[thread overview]
Message-ID: <20021102135109.GA6321@codepoet.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0210311452531.13258-100000@serv>

On Thu Oct 31, 2002 at 03:43:26PM +0100, Roman Zippel wrote:
> kconfig:
> config /symbol/
> 	bool /prompt/
> 	default /word/

Suppose at some time we wished to move things like architecture
specific CFLAGS into Kconfig.  It would be implemented as a
"string" object and would look something like:

config CPU_CFLAGS
        string
        default "-march=i386" if M386
        default "-march=i486" if M486
        default "-march=i586" if M586
        default "-march=i686 -malign-functions=4" if MK7

This is terribly simplified, but I think you get the idea.
Suppose someone selects MK7.  The resulting .config file
would then have:

    CONFIG_CPU_CFLAGS="-march=i686 -malign-functions=4"

Since this file is sourced into the Makefile, we could then
append CONFIG_CPU_CFLAGS onto the CFLAGS.  This would also
be kindof cool, since we could add in Makefile macros into the
strings and they would actually be evaluated...

So for the K7 case, we could expand it to something much more
sneaky later on, something like:
    default "$(call check_gcc,-march=athlon,-march=i686 -malign-functions=4)" if MK7
and the check_gcc macro could be correctly evaluated by make.
Neat stuff.  (Such a check_gcc macro does not yet exist in the 
kernel Makefiles, but surely will sometime).

Ok, everything looks fine so far.  But now we see a problem...

String objects always contain quotes (") around them.  So when
included into a Makefile, we would end up with something like:

    gcc -Wall "-march=i686 -malign-functions=4" foo.c -o bar

or similar being run.  Because the entire string object value is
quoted, gcc will try to set arch="i686 -malign-functions=4" and
will blow up.  Not what we want at all...  Dropping the quotes
from the .config file would work, but would probably screw up
other things that need the quotes to work properly.  Creating a
new "unquoted_string" data type would work nicely.  

Any interest in adding an "unquoted_string" data type ?  I dunno
if such a data type is anything you care about, but I can imagine
cool things being done with it, such as the above.

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--

  parent reply	other threads:[~2002-11-02 13:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-31 13:43 Where's the documentation for Kconfig? Matthew Wilcox
2002-10-31 14:43 ` Roman Zippel
2002-10-31 15:27   ` Christoph Hellwig
2002-10-31 16:03     ` Roman Zippel
2002-11-01  8:23       ` Rusty Russell
2002-11-01 12:52   ` Russell King
2002-11-01 13:50     ` Roman Zippel
2002-11-01 19:31       ` Russell King
2002-11-01 20:30         ` Tom Rini
2002-11-01 20:35           ` Russell King
2002-11-01 20:42             ` Tom Rini
2002-11-01 20:46               ` Russell King
2002-11-01 23:32                 ` Tom Rini
2002-11-01 23:52                   ` Roman Zippel
2002-11-02  0:07                     ` Tom Rini
2002-11-02  0:46                       ` Roman Zippel
2002-11-01 20:35         ` Roman Zippel
     [not found]           ` <20020625221306.GA439@free.fr>
     [not found]             ` <Pine.LNX.4.44.0211021254420.6949-100000@serv>
2002-11-02 13:20               ` Kconfig (qt) -> Gconfig (gtk+) Romain Lievin
2002-11-02 14:45                 ` Roman Zippel
2002-11-02 18:56                   ` qconf buglet James H. Cloos Jr.
2002-11-02 19:48                     ` Roman Zippel
2002-11-02 23:40                       ` James H. Cloos Jr.
2002-11-02 13:51   ` Erik Andersen [this message]
2002-11-02 19:26     ` Where's the documentation for Kconfig? Roman Zippel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021102135109.GA6321@codepoet.org \
    --to=andersen@codepoet.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zippel@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox