linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: linux-kernel <linux-kernel@vger.kernel.org>,
	kbuild-devel <kbuild-devel@lists.sourceforge.net>
Subject: linux kernel conf 1.1
Date: Sun, 20 Oct 2002 21:45:07 +0200	[thread overview]
Message-ID: <3DB307C3.CFD755C@linux-m68k.org> (raw)

Hi,

At http://www.xs4all.nl/~zippel/lc/ you can find the latest version of
the new config system.
Smaller changes:
- update to 2.5.44
- new qconf option, which enables some debug output in the help window

The only big change this time is that I added a SWIG interface, which
allows to generate a extension library for your favourite script
language. I did this already for ruby, 'make ruby' builds the library
kconfig.so in the .ruby subdir.
I also included some examples, since they are short and fun, I included
them below.
The first example shows a working (but not very comfortable) miniconf:

-----
require "kconfig"
include Kconfig

conf_parse("arch/i386/Kconfig")
conf_read(nil)

def conf(menu)
        return unless menu.isVisible?
        prompt = menu.prompt
        if prompt.type == P_COMMENT || prompt.type == P_MENU
                print "* #{prompt.text}\n"
        end
        sym = menu.sym
        if sym
                begin
                        print "#{prompt.text} (#{sym.get_string})? "
                        unless sym.isChangable?
                                print "\n"
                                break
                        end
                        val = gets.strip
                end until val.empty? || sym.set_string(val)
        end
        menu.each do |child|
                conf(child)
        end
end

conf(Kconfig.rootmenu)

conf_write(nil)
-----

This is all you need to configure your kernel. :)
The second example prints information about a config option:

-----
require "kconfig"
include Kconfig

conf_parse("arch/i386/Kconfig")
conf_read(nil)

sym = Kconfig::Symbol.find(ARGV[0])
if !sym
        print "Symbol #{ARGV[0]} not found!\n"
        exit
end

sym.calc_value
print "symbol: #{sym.name}\n"
print "  type: #{Kconfig::Symbol.type_name(sym.type)}\n"
print "  value: #{sym.get_string}\n"
print "  choice\n" if sym.isChoice?
print "  choice value\n" if sym.isChoiceValue?
print "  properties:\n" if sym.prop
sym.each do |prop|
        case prop.type
        when P_PROMPT
                print "    prompt: #{prop.text}\n"
        when P_DEFAULT
                prop.def.calc_value
                print "    default: #{prop.def.get_string}\n"
        when P_CHOICE
                print "    choice reference\n"
        else
                print "    unknown property:
#{Property.type_name(prop.type)}\n"
        end
        print "      dep: #{prop.visible.expr}\n" if prop.visible.expr
end
-----

This gives you a basic idea about the internal structures of lkc.

bye, Roman

                 reply	other threads:[~2002-10-20 19:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3DB307C3.CFD755C@linux-m68k.org \
    --to=zippel@linux-m68k.org \
    --cc=kbuild-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).