diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-26 08:53:06 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-26 08:53:06 -0300 |
commit | 1513c16af8fe4dd3f0afa6548cb39331c24bd01d (patch) | |
tree | f2d5dc7ac1e682aa02b4cc7d73e68f43d28c3e7d /v4l | |
parent | 9d7a8568c08e90097778aeac7bb66db7ddb183b8 (diff) | |
download | mediapointer-dvb-s2-1513c16af8fe4dd3f0afa6548cb39331c24bd01d.tar.gz mediapointer-dvb-s2-1513c16af8fe4dd3f0afa6548cb39331c24bd01d.tar.bz2 |
Some cleanups at make xconfig
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Now, it doesn't depend on kernel Kconfig stuff:
- It generates a Kconfig.kern based on unsolved dependencies.
- It assumes that all needed dependencies were compiled as module.
Only Multimedia tree is showed to the user.
To work, user should have runned xconfig before at the normal kernel tree.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l')
-rw-r--r-- | v4l/Makefile | 4 | ||||
-rwxr-xr-x | v4l/scripts/make_kconfig.pl | 67 |
2 files changed, 57 insertions, 14 deletions
diff --git a/v4l/Makefile b/v4l/Makefile index ab94f891f..66e3eb31f 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -355,8 +355,8 @@ all:: default default:: links .version $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules -qconfig:: links .version - ./scripts/make_kconfig.pl /usr/src/linux-2.6.14 $(ARCH) +xconfig:: links .version + ./scripts/make_kconfig.pl $(ARCH) $(KDIR)/scripts/kconfig/qconf Kconfig ivtv-checkout:: diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index f612e83db..91c37693f 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -1,37 +1,80 @@ #!/usr/bin/perl use FileHandle; -my $KDIR=shift; my $ARCH=shift; +my %depend = (); +my %config = (); + +sub add_config($) +{ + my $arg=shift; + + if ($arg =~ m/^([A-Z0-9_]+)/) { + $config{$1} = 1; + } +} + +sub check_deps($) +{ + my $arg=shift; + $arg=$arg." "; + + while ($arg ne "") { + if ($arg =~ m/^([A-Z0-9_]+) /) { + my $val=$1; + my $prev=$depend{$val}; + $depend { $val } = 1+$prev; + } + $arg =~ s/^[^ ]+ //; + } +} + sub open_kconfig($$) { my ($dir,$file)=@_; my $in = new FileHandle; -print "opening $file\n"; +#print "opening $file\n"; open $in,"$file"; while (<$in>) { - if (m;^\s*source[\s\"]+drivers/media/(video|dvb)/Kconfig;) { - next; - } +# if (m;^\s*source[\s\"]+drivers/media/(video|dvb)/Kconfig;) { +# next; +# } if (m|^\s*source[\s\"]+([^\n\s\"]+)[\n\s\"]|) { open_kconfig($dir,"$dir/$1"); next; } + if (m|^\s+depends on (.*)\n|) { + check_deps ($1); + } + if (m|^\s+select (.*)\n|) { + check_deps ($1); + } + if (m|^\s*config (.*)\n|) { + add_config ($1); + } + s/^main(menu\s\"[^\"]+)/\1 - DON'T CHANGE IT!/; print OUT $_; } close $in; } -open OUT,">Kconfig.kern"; -open_kconfig($KDIR,"$KDIR/arch/$ARCH/Kconfig"); -print OUT "endmenu\n"; -close OUT; - open OUT,">Kconfig"; print OUT "mainmenu \"V4L/DVB menu\"\n"; -open_kconfig ("../linux","../linux/drivers/media/video/Kconfig"); -open_kconfig ("../linux","../linux/drivers/media/dvb/Kconfig"); + print OUT "source Kconfig.kern\n"; +open_kconfig ("../linux","../linux/drivers/media/Kconfig"); + close OUT; + +while ( my ($key, $value) = each(%config) ) { + delete $depend{$key}; +} + +open OUT,">Kconfig.kern"; +while ( my ($key, $value) = each(%depend) ) { + print OUT "# $key with $value refs\nconfig $key\n\ttristate\n\tdefault m\n\n"; +} +close OUT; + |