[kbuild-devel] Re: [PATCH] [kbuild] Possibility to sanely link against off-directory .so

2002-11-07 Thread Petr Baudis
Dear diary, on Wed, Nov 06, 2002 at 10:29:52PM CET, I got a letter,
where Sam Ravnborg <[EMAIL PROTECTED]> told me, that...
> On Wed, Nov 06, 2002 at 07:52:30PM +0100, Petr Baudis wrote:
> >   Hello,
> > 
> >   this patch (against 2.5.46) introduces two special variables which make it
> > actually possible to have .so as the only product of build in some directory
> > and to link something against .so being built in another directory. The
> > variable host-cshlib-extra makes it possible to explicitly mention shared
> > objects to be built and the variable $(-linkobjs) allows user to specify
> > additional objects to link  against, while not creating any dependencies
> > of  on the objects.
> > 
> >   The changes are minimal while dramatically extending possibilities for
> > messing with the shared objects and they should have no unwanted side-effects,
> > and it appears to actually work for me. Please apply.
> 
> There is only one user of shared libaries today, thats Kconfig.
> And Kconfig is the only user of C++ as well.
> 
> There is quite a lot of added complexity in Makefile.lib + Makefile.build
> only to support this. Being the one that introduced it, I would like to
> see it go away again.
> Rationale behind this is that the current added complexity has an penalty
> when compiling a kernel, and I would like to move the complexity to
> the only user.
> 
> Care to try that approach?

Can't say anything about the C++ stuff, but the second user of shared libraries
is going to be lxdialog - hopefully this evening already, in my patches (it
already works, I'm only cleaning out few details now; lxdialog + mconf is also
user of both these extensions).

I don't think the complexity increase is so dramatical - theoretically, it
almost shouldn't affect the normal build, except one scan for .so extensions,
right? Maybe we could do with some less generic way here, like specifying .so
dependencies in a special variable? On the other side, moving .so processing to
the user entirely would already mean some amount of duplication now (given that
my lxdialog + mconf patch will be accepted ;-).

I personally think that the -linkobjs variable adds practically zero overhead,
while having potential to be generically useful in other places than lxdialog.
About host-cshlib-extra, if we aren't going to entirely remove .so processing,
I believe that it should go in as well, since eventual move of .so processing
to separate set of rules will probably mostly affect one step higher level of
rules / variables than this, and this variable is going to be useful in the
both cases.

Kind regards,

-- 
 
Petr "Pasky" Baudis
.
This host is a black hole at HTTP wavelengths. GETs go in, and nothing
comes out, not even Hawking radiation.
-- Graaagh the Mighty on rec.games.roguelike.angband
.
Public PGP key && geekcode && homepage: http://pasky.ji.cz/~pasky/


---
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
___
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel



[kbuild-devel] [PATCH] [kconfig] Direct use of lxdialog routines by menuconfig

2002-11-07 Thread Petr Baudis
  Hello,

  this patch (against 2.5.46) cleans up interaction between kconfig's mconf
(menuconfig frontend) and lxdialog. Its commandline interface (called
imaginatively lxdialog) no longer exists, instead a .so is packed from the
lxdialog objects and the relevant functions are called directly from mconf.

  In practice, this means that drawing on the screen is done with _MUCH_ less
overhead now (we can still do better, maybe I will make few more patches in
future; the difference won't be very big anymore though, I suppose), the screen
updates are better optimalized as ncurses aren't reset everytime you display
something, that also implies that the ugly screen flickering is done. As a cute
side-effect, the dialogs are now rendered on the top of the menu or help panel.

  Note that this patch depends on my previous patch (subj. "Possibility to
sanely link against off-directory .so"; if you can't see the mail anymore,
fetch it from http://pasky.ji.cz/~pasky/dev/kernel/kbuild_smartso.patch - it's
tiny). This patch also unfortunately conflicts with the singlemenu patch - I'm
probably going to wait for what's going to be included first and then rediff
the later ;-).

  It appears to work fine for me, and the change should cause overall
improvement of the configuration process. Please test, comment, apply ;-).

 scripts/kconfig/Makefile |1
 scripts/kconfig/mconf.c  |  379 ++-
 scripts/lxdialog/Makefile|   10 -
 scripts/lxdialog/checklist.c |   34 +--
 scripts/lxdialog/dialog.h|   28 ++-
 scripts/lxdialog/lxdialog.c  |  226 -
 scripts/lxdialog/menubox.c   |   59 ++
 scripts/lxdialog/textbox.c   |2
 scripts/lxdialog/util.c  |   18 +-
 9 files changed, 213 insertions(+), 544 deletions(-)

  Kind regards,
Petr Baudis

diff -ruN linux/scripts/kconfig/Makefile linux+pasky/scripts/kconfig/Makefile
--- linux/scripts/kconfig/Makefile  Wed Nov  6 21:49:55 2002
+++ linux+pasky/scripts/kconfig/MakefileWed Nov  6 22:39:21 2002
@@ -14,6 +14,7 @@
 host-progs := conf mconf qconf
 conf-objs  := conf.o  libkconfig.so
 mconf-objs := mconf.o libkconfig.so
+mconf-linkobjs := ../lxdialog/liblxdialog.so
 
 qconf-objs := kconfig_load.o
 qconf-cxxobjs  := qconf.o
diff -ruN linux/scripts/kconfig/mconf.c linux+pasky/scripts/kconfig/mconf.c
--- linux/scripts/kconfig/mconf.c   Wed Nov  6 21:50:00 2002
+++ linux+pasky/scripts/kconfig/mconf.c Wed Nov  6 23:28:09 2002
@@ -1,6 +1,9 @@
 /*
  * Copyright (C) 2002 Roman Zippel <[EMAIL PROTECTED]>
  * Released under the terms of the GNU GPL v2.0.
+ *
+ * Directly use liblxdialog library routines.
+ * 2002-11-06 Petr Baudis <[EMAIL PROTECTED]>
  */
 
 #include 
@@ -14,10 +17,11 @@
 #include 
 #include 
 
+#include "../lxdialog/dialog.h"
+
 #define LKC_DIRECT_LINK
 #include "lkc.h"
 
-static char menu_backtitle[128];
 static const char menu_instructions[] =
"Arrow keys navigate the menu.  "
" selects submenus --->.  "
@@ -76,14 +80,13 @@
"leave this blank.\n"
 ;
 
-static char buf[4096], *bufptr = buf;
-static char input_buf[4096];
-static char *args[1024], **argptr = args;
 static int indent = 0;
 static int rows, cols;
 static struct menu *current_menu;
 static int child_count;
-static int do_resize;
+
+struct dialog_list_item *items[16384]; /* FIXME: This ought to be dynamic. */
+int item_no;
 
 static void conf(struct menu *menu);
 static void conf_choice(struct menu *menu);
@@ -95,11 +98,6 @@
 static void show_help(struct menu *menu);
 static void show_readme(void);
 
-static void cprint_init(void);
-static int cprint1(const char *fmt, ...);
-static void cprint_done(void);
-static int cprint(const char *fmt, ...);
-
 static void init_wsize(void)
 {
struct winsize ws;
@@ -122,135 +120,63 @@
cols -= 5;
 }
 
-static void cprint_init(void)
+static void cinit(void)
+{
+   item_no = 0;
+}
+
+static void cmake(void)
 {
-   bufptr = buf;
-   argptr = args;
-   memset(args, 0, sizeof(args));
-   indent = 0;
-   child_count = 0;
-   cprint("./scripts/lxdialog/lxdialog");
-   cprint("--backtitle");
-   cprint(menu_backtitle);
+   items[item_no] = malloc(sizeof(struct dialog_list_item));
+   memset(items[item_no], 0, sizeof(struct dialog_list_item));
+   items[item_no]->tag = malloc(32); items[item_no]->tag[0] = 0;
+   items[item_no]->name = malloc(512); items[item_no]->name[0] = 0;
+   items[item_no]->namelen = 0;
+   item_no++;
 }
 
-static int cprint1(const char *fmt, ...)
+static int cprint_name(const char *fmt, ...)
 {
va_list ap;
int res;
 
-   if (!*argptr)
-   *argptr = bufptr;
+   if (!item_no)
+   cmake();
va_start(ap, fmt);
-   res = vspri

[kbuild-devel] [PATCH] [kbuild] Possibility to sanely link against off-directory .so

2002-11-07 Thread Petr Baudis
  Hello,

  this patch (against 2.5.46) introduces two special variables which make it
actually possible to have .so as the only product of build in some directory
and to link something against .so being built in another directory. The
variable host-cshlib-extra makes it possible to explicitly mention shared
objects to be built and the variable $(-linkobjs) allows user to specify
additional objects to link  against, while not creating any dependencies
of  on the objects.

  The changes are minimal while dramatically extending possibilities for
messing with the shared objects and they should have no unwanted side-effects,
and it appears to actually work for me. Please apply.

 scripts/Makefile.build |6 ++
 scripts/Makefile.lib   |2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

  Kind regards,
Petr Baudis

diff -ru linux/scripts/Makefile.build linux+pasky/scripts/Makefile.build
--- linux/scripts/Makefile.buildTue Nov  5 19:29:20 2002
+++ linux+pasky/scripts/Makefile.build  Wed Nov  6 19:39:52 2002
@@ -197,6 +197,11 @@
 # libkconfig.so as the executable conf.
 # Note: Shared libraries consisting of C++ files are not supported  
 #
+# host-progs := mconf
+# mconf-objs := mconf.o
+# mconf-linkobjs := ../lxdialog/liblxdialog.so
+# Will link mconf.o against ../lxdialog/liblxdialog.so, but will not attempt
+# to build ../lxdialog/liblxdialog.so nor will make mconf depend on it.
 
 # Create executable from a single .c file
 # host-csingle -> Executable
@@ -212,6 +217,7 @@
 quiet_cmd_host-cmulti  = HOSTLD  $@
   cmd_host-cmulti  = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \
  $(addprefix $(obj)/,$($(@F)-objs)) \
+ $(addprefix $(obj)/,$($(@F)-linkobjs)) \
  $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
 $(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE
$(call if_changed,host-cmulti)
diff -ru linux/scripts/Makefile.lib linux+pasky/scripts/Makefile.lib
--- linux/scripts/Makefile.lib  Fri Nov  1 22:22:07 2002
+++ linux+pasky/scripts/Makefile.libWed Nov  6 19:07:47 2002
@@ -78,7 +78,7 @@
 
 # Shared libaries (only .c supported)
 # Shared libraries (.so) - all .so files referenced in "xxx-objs"
-host-cshlib:= $(sort $(filter %.so, $(host-cobjs)))
+host-cshlib:= $(host-cshlib-extra) $(sort $(filter %.so, $(host-cobjs)))
 # Remove .so files from "xxx-objs"
 host-cobjs := $(filter-out %.so,$(host-cobjs))
 


---
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
___
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel



[kbuild-devel] Re: [PATCH] [kbuild] Possibility to sanely link against off-directory .so

2002-11-07 Thread Petr Baudis
Dear diary, on Thu, Nov 07, 2002 at 02:22:45PM CET, I got a letter,
where Peter Samuelson <[EMAIL PROTECTED]> told me, that...
> Remember, the whole point of HOSTCC is to support a build environment
> different from the compile target - arbitrarily different, even.

I'm a bit lost here - the kernel uses tons of gcc extensions - how is another
compiler supposed to understand them? And if it is specifically extended to
understand them, isn't it likely that it'll understand the -shared switch in
gcc-like way as well?

Or better, what other compiler is known to build a kernel than gcc? At least
anything that doesn't define __GNUC__ should IMHO fail inside of init/main.c.
And how likely is situation when someone want to configure a kernel with
non-gcc compiler and actually build it with gcc?

I thought that the point of HOSTCC is to allow to use a non-standart version
of gcc for kernel build.

-- 
 
Petr "Pasky" Baudis
.
This host is a black hole at HTTP wavelengths. GETs go in, and nothing
comes out, not even Hawking radiation.
-- Graaagh the Mighty on rec.games.roguelike.angband
.
Public PGP key && geekcode && homepage: http://pasky.ji.cz/~pasky/


---
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
___
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel



[kbuild-devel] [PATCH] [kconfig] Direct use of lxdialog routines by menuconfig (v2)

2002-11-14 Thread Petr Baudis
  Hello,

  this patch (against 2.5.47) cleans up interaction between kconfig's mconf
(menuconfig frontend) and lxdialog. Its commandline interface (called
imaginatively lxdialog) no longer exists, instead a huge .o is packed from the
lxdialog objects and the relevant functions are called directly from mconf.

  In practice, this means that drawing on the screen is done with _MUCH_ less
overhead now (we can still do better, maybe I will make few more patches in
future; the difference won't be very big anymore though, I suppose), the screen
updates are better optimalized as ncurses aren't reset everytime you display
something, that also implies that the ugly screen flickering is done. As a cute
side-effect, the dialogs are now rendered on the top of the menu or help panel.

  It appears to work fine for me, and the change should cause overall
improvement of the configuration process. Please test, comment, apply ;-).

 Makefile |7
 scripts/kconfig/Makefile |3
 scripts/kconfig/mconf.c  |  376 ++-
 scripts/lxdialog/Makefile|   23 ++
 scripts/lxdialog/checklist.c |   34 +--
 scripts/lxdialog/dialog.h|   28 ++-
 scripts/lxdialog/lxdialog.c  |  226 -
 scripts/lxdialog/menubox.c   |   59 ++
 scripts/lxdialog/textbox.c   |2
 scripts/lxdialog/util.c  |   18 +-
 10 files changed, 232 insertions(+), 544 deletions(-)

  Note that this is a progeny of the previous kconfig_lxso_mconf.patch - this
one actually creates an .o, not a .so, thus it doesn't need any kbuild
modifications (altough I'm a little anxious from the hacks I had to do). It is
also updated to 2.5.47 and several minor problems were fixed (mainly the prev.
patch was missing a part ;-).

  Kind regards,
        Petr Baudis

--- linux/Makefile  Thu Nov 14 19:03:20 2002
+++ linux+pasky/MakefileThu Nov 14 21:55:26 2002
@@ -643,8 +643,7 @@
 xconfig: scripts/kconfig/qconf
./scripts/kconfig/qconf arch/$(ARCH)/Kconfig
 
-menuconfig: scripts/kconfig/mconf
-   $(Q)$(MAKE) -f scripts/Makefile.build obj=scripts lxdialog
+menuconfig: scripts/lxdialog/built-in.o scripts/kconfig/mconf
./scripts/kconfig/mconf arch/$(ARCH)/Kconfig
 
 config: scripts/kconfig/conf
@@ -667,6 +666,10 @@
 
 defconfig: scripts/kconfig/conf
./scripts/kconfig/conf -d arch/$(ARCH)/Kconfig
+
+scripts/lxdialog/built-in.o: FORCE
+   $(Q)$(MAKE) -f scripts/Makefile.build obj=scripts lxdialog
+
 
 ###
 # Cleaning is done on three levels.
diff -ru linux/scripts/kconfig/Makefile linux+pasky/scripts/kconfig/Makefile
--- linux/scripts/kconfig/Makefile  Wed Nov  6 21:49:55 2002
+++ linux+pasky/scripts/kconfig/MakefileThu Nov 14 21:44:41 2002
@@ -27,6 +27,9 @@
 HOSTCFLAGS_lex.zconf.o := -I$(src)
 HOSTCFLAGS_zconf.tab.o := -I$(src)
 
+# See scripts/lxdialog/Makefile header for reason of this:
+HOSTLOADLIBES_mconf= $(obj)/../lxdialog/built-in.o -lncurses
+
 HOSTLOADLIBES_qconf= -L$(QTDIR)/lib -Wl,-rpath,$(QTDIR)/lib -l$(QTLIB) -ldl
 HOSTCXXFLAGS_qconf.o   = -I$(QTDIR)/include 
 
diff -ru linux/scripts/kconfig/mconf.c linux+pasky/scripts/kconfig/mconf.c
--- linux/scripts/kconfig/mconf.c   Thu Nov 14 19:03:45 2002
+++ linux+pasky/scripts/kconfig/mconf.c Thu Nov 14 20:43:59 2002
@@ -4,6 +4,9 @@
  *
  * Introduced single menu mode (show all sub-menus in one large tree).
  * 2002-11-06 Petr Baudis <[EMAIL PROTECTED]>
+ *
+ * Directly use liblxdialog library routines.
+ * 2002-11-14 Petr Baudis <[EMAIL PROTECTED]>
  */
 
 #include 
@@ -19,10 +22,11 @@
 #include 
 #include 
 
+#include "../lxdialog/dialog.h"
+
 #define LKC_DIRECT_LINK
 #include "lkc.h"
 
-static char menu_backtitle[128];
 static const char menu_instructions[] =
"Arrow keys navigate the menu.  "
" selects submenus --->.  "
@@ -81,18 +85,17 @@
"leave this blank.\n"
 ;
 
-static char buf[4096], *bufptr = buf;
-static char input_buf[4096];
 static char filename[PATH_MAX+1] = ".config";
-static char *args[1024], **argptr = args;
 static int indent = 0;
 static struct termios ios_org;
 static int rows, cols;
 static struct menu *current_menu;
 static int child_count;
-static int do_resize;
 static int single_menu_mode;
 
+struct dialog_list_item *items[16384]; /* FIXME: This ought to be dynamic. */
+int item_no;
+
 static void conf(struct menu *menu);
 static void conf_choice(struct menu *menu);
 static void conf_string(struct menu *menu);
@@ -103,11 +106,6 @@
 static void show_help(struct menu *menu);
 static void show_readme(void);
 
-static void cprint_init(void);
-static int cprint1(const char *fmt, ...);
-static void cprint_done(void);
-static int cprint(const char *fmt, ...);
-
 static void init_wsize(void)
 {
struct winsize ws;
@@ -130,135 +128,63 @@
cols -= 5;
 }
 
-static void cprint_init(void)
+s

[kbuild-devel] [PATCH 0/3]

2005-12-12 Thread Petr Baudis
The following series implements...

-- 
And on the eigth day, God started debugging.


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 1/3] [kbuild] Allow building of standalone .so libraries

2005-12-12 Thread Petr Baudis
This patch allows specifying .so libraries directly in 'hostprogs-y'.
I need to create a .so library not linked to anything in the
scripts/lxdialog/ directory.

Signed-off-by: Petr Baudis <[EMAIL PROTECTED]>
---

 scripts/Makefile.host |   14 +++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 2d51970..ff1b54d 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -29,6 +29,12 @@
 # conf.c is compiled as a c program, and conf.o is linked together with
 # libkconfig.so as the executable conf.
 # Note: Shared libraries consisting of C++ files are not supported
+#
+# hostprogs-y := liblxdialog.so
+# liblxdialog-objs := checklist.o util.o
+# Will create a "standalone" liblxdialog.so library in the directory,
+# not linked against anything (useful when you want to link something
+# to it later).
 
 __hostprogs := $(sort $(hostprogs-y)$(hostprogs-m))
 
@@ -39,7 +45,7 @@ obj-dirs := $(strip $(sort $(filter-out 
 
 # C code
 # Executables compiled from a single .c file
-host-csingle   := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m)))
+host-csingle   := $(foreach m,$(__hostprogs),$(if $($(m:.so=)-objs),,$(m)))
 
 # C executables linked based on several .o files
 host-cmulti:= $(foreach m,$(__hostprogs),\
@@ -57,8 +63,10 @@ host-cxxmulti:= $(foreach m,$(__hostpro
 host-cxxobjs   := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs)))
 
 # Shared libaries (only .c supported)
-# Shared libraries (.so) - all .so files referenced in "xxx-objs"
-host-cshlib:= $(sort $(filter %.so, $(host-cobjs)))
+# Shared libraries (.so) - all .so files referenced in "xxx-objs", and
+# also standalone .so's referenced in hostprogs.
+host-cshlib:= $(sort $(filter %.so, $(host-cobjs))) \
+  $(sort $(filter %.so, $(__hostprogs)))
 # Remove .so files from "xxx-objs"
 host-cobjs := $(filter-out %.so,$(host-cobjs))
 



---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 0/3] Link lxdialog with mconf directly

2005-12-12 Thread Petr Baudis
  The following series revives one three years old patch, turning lxdialog
to a library and linking it directly to mconf, making menuconfig nicer and
things in general quite simpler and cleaner.

  The first two patches make slight adjustements to kbuild in order to make
liblxdialog possible. The third patch does the libification itself and
appropriate modifications to mconf.c.

  PS: Sorry for the blank covermail I've sent before. StGIT still seems
to behave, er.. erratically.

    Petr Baudis

-- 
And on the eigth day, God started debugging.


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 3/3] [kconfig] Direct use of lxdialog routines by menuconfig

2005-12-12 Thread Petr Baudis
After three years, the zombie walks again!  This patch (against the latest
git tree) cleans up interaction between kconfig's mconf (menuconfig
frontend) and lxdialog. Its commandline interface disappears in this patch,
instead a .so is packed from the lxdialog objects and the relevant
functions are called directly from mconf.

In practice, this means that drawing on the screen is done with _MUCH_
less overhead now, the screen updates are better optimalized as ncurses
won't get reset everytime you display something, that also implies that
the ugly screen flickering is done. As a cute side-effect, the dialogs
are now rendered on the top of the menu or help panel.  In the future,
this also gives us much more freedom for enhancing the user interface.

This opens space for plenty of cleanups of liblxdialog, removal of
superfluous stuff and temporary files usage, etc.

Compared to the previous version (from February 2003), this one should be
less buggy (especially wrt. the escape character handling), should not
crash while resizing and the resizing should have immediate effect
(although things can still start looking ugly when you are resizing while
not in a menu - to fix that properly, more liblxdialog integration is
required). Also, the code is considerably simplified on few places.

Signed-off-by: Petr Baudis <[EMAIL PROTECTED]>
---

 scripts/kconfig/Makefile |   18 +
 scripts/kconfig/mconf.c  |  538 --
 scripts/lxdialog/.gitignore  |4 
 scripts/lxdialog/Makefile|   18 +
 scripts/lxdialog/checklist.c |  113 -
 scripts/lxdialog/dialog.h|   58 +++--
 scripts/lxdialog/inputbox.c  |5 
 scripts/lxdialog/lxdialog.c  |  226 --
 scripts/lxdialog/menubox.c   |   95 ---
 scripts/lxdialog/msgbox.c|8 -
 scripts/lxdialog/textbox.c   |8 +
 scripts/lxdialog/util.c  |   62 +
 scripts/lxdialog/yesno.c |6 
 13 files changed, 448 insertions(+), 711 deletions(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index a96153f..0dc42ea 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -10,9 +10,8 @@ xconfig: $(obj)/qconf
 gconfig: $(obj)/gconf
$< arch/$(ARCH)/Kconfig
 
-menuconfig: $(obj)/mconf
-   $(Q)$(MAKE) $(build)=scripts/lxdialog
-   $< arch/$(ARCH)/Kconfig
+menuconfig: build-lxdialog $(obj)/mconf
+   $(obj)/mconf arch/$(ARCH)/Kconfig
 
 config: $(obj)/conf
$< arch/$(ARCH)/Kconfig
@@ -83,7 +82,7 @@ help:
 # ===
 # Shared Makefile for the various kconfig executables:
 # conf:  Used for defconfig, oldconfig and related targets
-# mconf:  Used for the mconfig target.
+# mconf:  Used for the mconfig target
 # Utilizes the lxdialog package
 # qconf:  Used for the xconfig target
 # Based on QT which needs to be installed to compile it
@@ -94,6 +93,7 @@ help:
 hostprogs-y:= conf mconf qconf gconf kxgettext
 conf-objs  := conf.o  zconf.tab.o
 mconf-objs := mconf.o zconf.tab.o
+mconf-linkobjs := ../lxdialog/liblxdialog.so
 kxgettext-objs := kxgettext.o zconf.tab.o
 
 ifeq ($(MAKECMDGOALS),xconfig)
@@ -129,6 +129,9 @@ endif
 HOSTCFLAGS_lex.zconf.o := -I$(src)
 HOSTCFLAGS_zconf.tab.o := -I$(src)
 
+HOSTLOADLIBES_mconf= -lncurses
+
+
 HOSTLOADLIBES_qconf= $(KC_QT_LIBS) -ldl
 HOSTCXXFLAGS_qconf.o   = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK
 
@@ -226,6 +229,13 @@ $(obj)/lkc_defs.h: $(src)/lkc_proto.h
sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
 
 
+# We need to do it indirectly since default kbuild rule will override
+# us otherwise.
+.PHONY: build-lxdialog
+build-lxdialog:FORCE
+   $(Q)$(MAKE) $(build)=scripts/lxdialog
+
+
 ###
 # The following requires flex/bison/gperf
 # By default we use the _shipped versions, uncomment the following line if
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index d1ad405..6284de2 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -6,9 +6,12 @@
  * 2002-11-06 Petr Baudis <[EMAIL PROTECTED]>
  *
  * i18n, 2005, Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
+ *
+ * Rewritten to use liblxdialog directly instead of calling it as an
+ * external tool.
+ * 2005-12-11 Petr Baudis <[EMAIL PROTECTED]>
  */
 
-#include 
 #include 
 #include 
 #include 
@@ -22,10 +25,11 @@
 #include 
 #include 
 
+#include "../lxdialog/dialog.h"
+
 #define LKC_DIRECT_LINK
 #include "lkc.h"
 
-static char menu_backtitle[128];
 static const char mconf_readme[] = N_(
 "Overview\n"
 "\n"
@@ -256,18 +260,17 @@ search_help[] = N_(
"  USB$ => find all CONFIG_ symbols ending with USB\n"
"\n");
 
-static char buf[4096], *bufptr = buf;
-static char input_buf[4096];
 static char filename[PATH_MAX+1] = ".config";
-static cha

[kbuild-devel] [PATCH 2/3] [kbuild] Possibility to sanely link against off-directory .so

2005-12-12 Thread Petr Baudis
This patch introduces two special variables which make it actually possible
to link something against .so being built in another directory. The
variable $(-linkobjs) allows the user to specify additional objects
to link  against, while not creating any dependencies of  on the
objects.

I need this in order to link scripts/lxdialog/liblxdialog.so from
scripts/kconfig (I'll be able to build that lib thanks to the previous
patch and the actual change to make it a library will follow in the next
patch).

On 6 Nov 2002 Sam Ravnborg <[EMAIL PROTECTED]> disputed this approach,
saying that such an extra complexity will bog the whole kernel build, but
this involves only the host tools build and there I think the extra penalty
is negligible. Also, .so has two users instead of a single one now, so it's
not that easy to use his suggested approach to offload the functionality to
the leaf makefiles.

Signed-off-by: Petr Baudis <[EMAIL PROTECTED]>
---

 scripts/Makefile.host |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index ff1b54d..1161f4c 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -34,7 +34,12 @@
 # liblxdialog-objs := checklist.o util.o
 # Will create a "standalone" liblxdialog.so library in the directory,
 # not linked against anything (useful when you want to link something
-# to it later).
+# to it later). To link the library from another directory, do:
+# hostprogs-y:= mconf
+# mconf-objs := mconf.o
+# mconf-linkobjs := ../lxdialog/liblxdialog.so
+# This will prevent kbuild from trying to build ../lxdialog/liblxdialog.so
+# from scripts/kconfig nor make mconf depend on it.
 
 __hostprogs := $(sort $(hostprogs-y)$(hostprogs-m))
 
@@ -116,6 +121,7 @@ $(host-csingle): %: %.c FORCE
 quiet_cmd_host-cmulti  = HOSTLD  $@
   cmd_host-cmulti  = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \
  $(addprefix $(obj)/,$($(@F)-objs)) \
+ $(addprefix $(obj)/,$($(@F)-linkobjs)) \
  $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
 $(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE
$(call if_changed,host-cmulti)



---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] Re: [PATCH 3/3] [kconfig] Direct use of lxdialog routines by menuconfig

2005-12-12 Thread Petr Baudis
Dear diary, on Mon, Dec 12, 2005 at 04:18:26AM CET, I got a letter
where Kurt Wall <[EMAIL PROTECTED]> said that...
> On Sunday 11 December 2005 07:46 pm, Petr Baudis wrote:
> > After three years, the zombie walks again!  This patch (against the latest
> > git tree) cleans up interaction between kconfig's mconf (menuconfig
> > frontend) and lxdialog. Its commandline interface disappears in this patch,
> > instead a .so is packed from the lxdialog objects and the relevant
> > functions are called directly from mconf.
> 
> > @@ -808,18 +684,22 @@ static void conf(struct menu *menu)
> > }
> > break;
> >case 4:
> > -   if (type == 't')
> > +   if (active_type == 't')
> >  sym_set_tristate_value(sym, no);
> > break;
> >case 5:
> > -   if (type == 't')
> > +   if (active_type == 't')
> >  sym_set_tristate_value(sym, mod);
> > break;
> >case 6:
> > -   if (type == 't')
> > +   if (active_type == 't') {
> >  sym_toggle_tristate_value(sym);
> > -   else if (type == 'm')
> > -conf(submenu);
> > +   } else if (active_type == 'm') {
> > +if (single_menu_mode)
> > + submenu->data = (void *) !submenu->data;
> 
> Shouldn't this be:
>  submenu->data = (void *) (long) !submenu->data;

You are right, it should be so at least for consistency - it'll be fixed
in the next resend of the patch. I can't see why is it needed, though -
shouldn't the int be padded to void* anyway?

-- 
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] Re: [PATCH 0/3] Link lxdialog with mconf directly

2005-12-12 Thread Petr Baudis
Dear diary, on Mon, Dec 12, 2005 at 08:14:22PM CET, I got a letter
where Sam Ravnborg <[EMAIL PROTECTED]> said that...
> On Mon, Dec 12, 2005 at 01:41:59AM +0100, Petr Baudis wrote:
> >   The following series revives one three years old patch, turning lxdialog
> > to a library and linking it directly to mconf, making menuconfig nicer and
> > things in general quite simpler and cleaner.
> > 
> >   The first two patches make slight adjustements to kbuild in order to make
> > liblxdialog possible. The third patch does the libification itself and
> > appropriate modifications to mconf.c.
> 
> Why not just copy over relevant files to scripts/kconfig?
> Then no playing tricks with libaries etc. is needed, and everythings
> just works.
> 
> It is only 8 files and prefixing them with lx* would make them
> stand out compared to the rest. It is not like there is any user planned
> for the lxdialog functionality in the kernel, and kconfig users outside
> the kernel I beleive copy lxdialog with rest of kconfig files.

Ok. I didn't want to pollute scripts/kconfig/ too much, but if it's ok
by you, I can do it that way. I will submit another series later in the
evening.

> Btw. the work you are doing are clashing with a general cleanup effort
> of lxdialog I have in -mm at the moment.
> I received only very limited feedback = looks ok.
> Integrating principles from your old patch was on my TODO list.

Do you mean the series you posted at Nov 21? Should I just rebase my
patches on top of that?

FWIW, the changes there look fine to me. I actually wanted to change the
indentation of the menus as well; it looks horrible especially in the
singlemenu mode.

> I have something in the works that uses linked list instead of a
> preallocated array, to keep the dynamic behaviour. I will probarly make
> a version with the linked list approach but otherwise use your changes
> to mconf.c. But it will take a few days until I get to it.

I can do it and include it in the updated series.

-- 
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel