From 096afa4e695916a8068c82af6807f9b6de587c38 Mon Sep 17 00:00:00 2001 From: nbd Date: Fri, 21 Apr 2006 00:12:18 +0000 Subject: more cleanups and a new menuconfig generator git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3685 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/gen_menuconfig.pl | 82 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100755 scripts/gen_menuconfig.pl (limited to 'scripts/gen_menuconfig.pl') diff --git a/scripts/gen_menuconfig.pl b/scripts/gen_menuconfig.pl new file mode 100755 index 000000000..70e31a45f --- /dev/null +++ b/scripts/gen_menuconfig.pl @@ -0,0 +1,82 @@ +#!/usr/bin/perl +use strict; + +my $src; +my $makefile; +my $pkg; +my %category; + +sub print_category($) { + my $cat = shift; + + return unless $category{$cat}; + + print "menu \"$cat\"\n\n"; + my %spkg = %{$category{$cat}}; + foreach my $spkg (sort {uc($a) cmp uc($b)} keys %spkg) { + foreach my $pkg (@{$spkg{$spkg}}) { + my $title = $pkg->{name}; + my $c = (72 - length($pkg->{name}) - length($pkg->{title})); + if ($c > 0) { + $title .= ("." x $c). " ". $pkg->{title}; + } + print "\t"; + $pkg->{menu} and print "menu"; + print "config PACKAGE_".$pkg->{name}."\n"; + print "\t\ttristate \"$title\"\n"; + print "\t\tdefault ".$pkg->{default}."\n"; + foreach my $depend (@{$pkg->{depends}}) { + print "\t\tdepends PACKAGE_$depend\n"; + } + print "\n" + } + } + print "endmenu\n\n"; + + undef $category{$cat}; +} + +my $line; +while ($line = <>) { + chomp $line; + $line =~ /^Source-Makefile: \s*(.+\/([^\/]+)\/Makefile)\s*$/ and do { + $makefile = $1; + $src = $2; + undef $pkg; + }; + $line =~ /^Package: \s*(.+)\s*$/ and do { + $pkg = {}; + $pkg->{src} = $src; + $pkg->{makefile} = $makefile; + $pkg->{name} = $1; + $pkg->{default} = "m if ALL"; + }; + $line =~ /^Version: \s*(.+)\s*$/ and $pkg->{version} = $1; + $line =~ /^Title: \s*(.+)\s*$/ and $pkg->{title} = $1; + $line =~ /^Menu: \s*(.+)\s*$/ and $pkg->{menu} = $1; + $line =~ /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1; + $line =~ /^Depends: \s*(.+)\s*$/ and do { + my @dep = split /,\s*/, $1; + $pkg->{depends} = \@dep; + }; + $line =~ /^Category: \s*(.+)\s*$/ and do { + $pkg->{category} = $1; + defined $category{$1} or $category{$1} = {}; + defined $category{$1}->{$src} or $category{$1}->{$src} = []; + push @{$category{$1}->{$src}}, $pkg; + }; + $line =~ /^Description: \s*(.*)\s*$/ and do { + my $desc = $1; + my $line; + while (<>) { + last if /^@@/; + $desc .= $1; + } + $pkg->{description} = $desc; + } +} + +print_category 'Base system'; +foreach my $cat (keys %category) { + print_category $cat; +} -- cgit v1.2.3 From 2fb0892917fa75590e20c32599de11880fe92c23 Mon Sep 17 00:00:00 2001 From: nbd Date: Fri, 21 Apr 2006 00:50:48 +0000 Subject: include package description in menuconfig help git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3687 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/gen_menuconfig.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts/gen_menuconfig.pl') diff --git a/scripts/gen_menuconfig.pl b/scripts/gen_menuconfig.pl index 70e31a45f..3f4476a2c 100755 --- a/scripts/gen_menuconfig.pl +++ b/scripts/gen_menuconfig.pl @@ -28,6 +28,8 @@ sub print_category($) { foreach my $depend (@{$pkg->{depends}}) { print "\t\tdepends PACKAGE_$depend\n"; } + print "\t\thelp\n"; + print $pkg->{description}; print "\n" } } @@ -66,11 +68,11 @@ while ($line = <>) { push @{$category{$1}->{$src}}, $pkg; }; $line =~ /^Description: \s*(.*)\s*$/ and do { - my $desc = $1; + my $desc = "\t\t$1\n\n"; my $line; - while (<>) { - last if /^@@/; - $desc .= $1; + while ($line = <>) { + last if $line =~ /^@@/; + $desc .= "\t\t$line"; } $pkg->{description} = $desc; } -- cgit v1.2.3 From 93e50b06ca295bc34326f6221b48ff5e94ccaa12 Mon Sep 17 00:00:00 2001 From: mbm Date: Fri, 19 May 2006 22:46:24 +0000 Subject: clean up menu configuration git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3801 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/gen_menuconfig.pl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'scripts/gen_menuconfig.pl') diff --git a/scripts/gen_menuconfig.pl b/scripts/gen_menuconfig.pl index 3f4476a2c..e282ee3ed 100755 --- a/scripts/gen_menuconfig.pl +++ b/scripts/gen_menuconfig.pl @@ -30,7 +30,9 @@ sub print_category($) { } print "\t\thelp\n"; print $pkg->{description}; - print "\n" + print "\n"; + + $pkg->{config} and print $pkg->{config}."\n"; } } print "endmenu\n\n"; @@ -75,6 +77,15 @@ while ($line = <>) { $desc .= "\t\t$line"; } $pkg->{description} = $desc; + }; + $line =~ /^Config: \s*(.*)\s*$/ and do { + my $conf = "$1\n"; + my $line; + while ($line = <>) { + last if $line =~ /^@@/; + $conf .= "$line"; + } + $pkg->{config} = $conf; } } -- cgit v1.2.3 From 2ad098c840f9e110fa30bd63093349bb26cb0b89 Mon Sep 17 00:00:00 2001 From: nico Date: Wed, 24 May 2006 07:12:59 +0000 Subject: add Build/InstallDev template to install dev files in STAGING_DIR, introduce a NEEDS: package field to implement SELECT PACKAGE_foo in menuconfig. git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3824 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/gen_menuconfig.pl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/gen_menuconfig.pl') diff --git a/scripts/gen_menuconfig.pl b/scripts/gen_menuconfig.pl index e282ee3ed..e304f1881 100755 --- a/scripts/gen_menuconfig.pl +++ b/scripts/gen_menuconfig.pl @@ -28,6 +28,9 @@ sub print_category($) { foreach my $depend (@{$pkg->{depends}}) { print "\t\tdepends PACKAGE_$depend\n"; } + foreach my $need (@{$pkg->{needs}}) { + print "\t\tselect PACKAGE_$need\n"; + } print "\t\thelp\n"; print $pkg->{description}; print "\n"; @@ -63,6 +66,10 @@ while ($line = <>) { my @dep = split /,\s*/, $1; $pkg->{depends} = \@dep; }; + $line =~ /^Needs: \s*(.+)\s*$/ and do { + my @need = split /,\s*/, $1; + $pkg->{needs} = \@need; + }; $line =~ /^Category: \s*(.+)\s*$/ and do { $pkg->{category} = $1; defined $category{$1} or $category{$1} = {}; -- cgit v1.2.3 From ae7dab366c205a5358f66ba0d3d678566ccc3f29 Mon Sep 17 00:00:00 2001 From: nbd Date: Tue, 30 May 2006 17:09:21 +0000 Subject: add proper build depends git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3841 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/gen_menuconfig.pl | 7 ------- 1 file changed, 7 deletions(-) (limited to 'scripts/gen_menuconfig.pl') diff --git a/scripts/gen_menuconfig.pl b/scripts/gen_menuconfig.pl index e304f1881..e282ee3ed 100755 --- a/scripts/gen_menuconfig.pl +++ b/scripts/gen_menuconfig.pl @@ -28,9 +28,6 @@ sub print_category($) { foreach my $depend (@{$pkg->{depends}}) { print "\t\tdepends PACKAGE_$depend\n"; } - foreach my $need (@{$pkg->{needs}}) { - print "\t\tselect PACKAGE_$need\n"; - } print "\t\thelp\n"; print $pkg->{description}; print "\n"; @@ -66,10 +63,6 @@ while ($line = <>) { my @dep = split /,\s*/, $1; $pkg->{depends} = \@dep; }; - $line =~ /^Needs: \s*(.+)\s*$/ and do { - my @need = split /,\s*/, $1; - $pkg->{needs} = \@need; - }; $line =~ /^Category: \s*(.+)\s*$/ and do { $pkg->{category} = $1; defined $category{$1} or $category{$1} = {}; -- cgit v1.2.3 From e240cc0ea62aa7404ccf6187cc95cf6370212bef Mon Sep 17 00:00:00 2001 From: nbd Date: Tue, 30 May 2006 18:55:52 +0000 Subject: improve dependency handling, fix some package makefile bugs git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3843 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/gen_menuconfig.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts/gen_menuconfig.pl') diff --git a/scripts/gen_menuconfig.pl b/scripts/gen_menuconfig.pl index e282ee3ed..a7f939ff5 100755 --- a/scripts/gen_menuconfig.pl +++ b/scripts/gen_menuconfig.pl @@ -26,7 +26,12 @@ sub print_category($) { print "\t\ttristate \"$title\"\n"; print "\t\tdefault ".$pkg->{default}."\n"; foreach my $depend (@{$pkg->{depends}}) { - print "\t\tdepends PACKAGE_$depend\n"; + my $m = "depends"; + $depend =~ s/^([@\+])//; + my $flags = $1; + $flags =~ /@/ or $depend = "PACKAGE_$depend"; + $flags =~ /\+/ and $m = "select"; + print "\t\t$m $depend\n"; } print "\t\thelp\n"; print $pkg->{description}; @@ -60,7 +65,7 @@ while ($line = <>) { $line =~ /^Menu: \s*(.+)\s*$/ and $pkg->{menu} = $1; $line =~ /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1; $line =~ /^Depends: \s*(.+)\s*$/ and do { - my @dep = split /,\s*/, $1; + my @dep = split /\s+/, $1; $pkg->{depends} = \@dep; }; $line =~ /^Category: \s*(.+)\s*$/ and do { -- cgit v1.2.3 From 5bc57a98e306e8b404dda68c6ae6982a5d36937c Mon Sep 17 00:00:00 2001 From: nbd Date: Tue, 30 May 2006 20:22:43 +0000 Subject: allow more complex defaults in menuconfig git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3848 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/gen_menuconfig.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts/gen_menuconfig.pl') diff --git a/scripts/gen_menuconfig.pl b/scripts/gen_menuconfig.pl index a7f939ff5..c40e1caed 100755 --- a/scripts/gen_menuconfig.pl +++ b/scripts/gen_menuconfig.pl @@ -24,7 +24,9 @@ sub print_category($) { $pkg->{menu} and print "menu"; print "config PACKAGE_".$pkg->{name}."\n"; print "\t\ttristate \"$title\"\n"; - print "\t\tdefault ".$pkg->{default}."\n"; + foreach my $default (split /\s*,\s*/, $pkg->{default}) { + print "\t\tdefault $default\n"; + } foreach my $depend (@{$pkg->{depends}}) { my $m = "depends"; $depend =~ s/^([@\+])//; -- cgit v1.2.3 From 5395d14488ac5d1fe5ef3985c63aad0218ee998f Mon Sep 17 00:00:00 2001 From: nbd Date: Tue, 20 Jun 2006 17:50:49 +0000 Subject: fix for multiple dependency flags git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4023 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/gen_menuconfig.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/gen_menuconfig.pl') diff --git a/scripts/gen_menuconfig.pl b/scripts/gen_menuconfig.pl index c40e1caed..eff78dcd9 100755 --- a/scripts/gen_menuconfig.pl +++ b/scripts/gen_menuconfig.pl @@ -29,7 +29,7 @@ sub print_category($) { } foreach my $depend (@{$pkg->{depends}}) { my $m = "depends"; - $depend =~ s/^([@\+])//; + $depend =~ s/^([@\+]+)//; my $flags = $1; $flags =~ /@/ or $depend = "PACKAGE_$depend"; $flags =~ /\+/ and $m = "select"; -- cgit v1.2.3 From 5bd73a12052f8e9182ac1f51372cf6d0323f9dad Mon Sep 17 00:00:00 2001 From: nbd Date: Sun, 25 Jun 2006 16:05:43 +0000 Subject: move the broadcom driver stuff into its own submenu git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4073 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/gen_menuconfig.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'scripts/gen_menuconfig.pl') diff --git a/scripts/gen_menuconfig.pl b/scripts/gen_menuconfig.pl index eff78dcd9..c1510b0d5 100755 --- a/scripts/gen_menuconfig.pl +++ b/scripts/gen_menuconfig.pl @@ -5,6 +5,7 @@ my $src; my $makefile; my $pkg; my %category; +my $cur_menu; sub print_category($) { my $cat = shift; @@ -15,6 +16,16 @@ sub print_category($) { my %spkg = %{$category{$cat}}; foreach my $spkg (sort {uc($a) cmp uc($b)} keys %spkg) { foreach my $pkg (@{$spkg{$spkg}}) { + if ($cur_menu ne $pkg->{submenu}) { + if ($cur_menu) { + print "endmenu\n"; + undef $cur_menu; + } + if ($pkg->{submenu}) { + $cur_menu = $pkg->{submenu}; + print "menu \"$cur_menu\"\n"; + } + } my $title = $pkg->{name}; my $c = (72 - length($pkg->{name}) - length($pkg->{title})); if ($c > 0) { @@ -65,6 +76,7 @@ while ($line = <>) { $line =~ /^Version: \s*(.+)\s*$/ and $pkg->{version} = $1; $line =~ /^Title: \s*(.+)\s*$/ and $pkg->{title} = $1; $line =~ /^Menu: \s*(.+)\s*$/ and $pkg->{menu} = $1; + $line =~ /^Submenu: \s*(.+)\s*$/ and $pkg->{submenu} = $1; $line =~ /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1; $line =~ /^Depends: \s*(.+)\s*$/ and do { my @dep = split /\s+/, $1; -- cgit v1.2.3 From 02cdebbb91a33d8e24da1c94a9d93ac39be168a7 Mon Sep 17 00:00:00 2001 From: mbm Date: Tue, 27 Jun 2006 00:35:46 +0000 Subject: credit where credit is due git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4091 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/gen_menuconfig.pl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/gen_menuconfig.pl') diff --git a/scripts/gen_menuconfig.pl b/scripts/gen_menuconfig.pl index c1510b0d5..e62363e63 100755 --- a/scripts/gen_menuconfig.pl +++ b/scripts/gen_menuconfig.pl @@ -1,4 +1,11 @@ #!/usr/bin/perl +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + use strict; my $src; -- cgit v1.2.3 From 8b0bcee75e4e1300cdcb7dbf0f60989f84e31cd2 Mon Sep 17 00:00:00 2001 From: nbd Date: Fri, 21 Jul 2006 14:27:45 +0000 Subject: add submenu dependencies (used to hide the proprietary broadcom driver on anything except for brcm-2.4) git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4197 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/gen_menuconfig.pl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/gen_menuconfig.pl') diff --git a/scripts/gen_menuconfig.pl b/scripts/gen_menuconfig.pl index e62363e63..ddce86bfa 100755 --- a/scripts/gen_menuconfig.pl +++ b/scripts/gen_menuconfig.pl @@ -13,6 +13,7 @@ my $makefile; my $pkg; my %category; my $cur_menu; +my $cur_menu_dep; sub print_category($) { my $cat = shift; @@ -26,10 +27,15 @@ sub print_category($) { if ($cur_menu ne $pkg->{submenu}) { if ($cur_menu) { print "endmenu\n"; + $cur_menu_dep and do { + print "endif\n"; + $cur_menu_dep = undef; + }; undef $cur_menu; } if ($pkg->{submenu}) { $cur_menu = $pkg->{submenu}; + $cur_menu_dep = $pkg->{submenudep} and print "if $cur_menu_dep\n"; print "menu \"$cur_menu\"\n"; } } @@ -84,6 +90,7 @@ while ($line = <>) { $line =~ /^Title: \s*(.+)\s*$/ and $pkg->{title} = $1; $line =~ /^Menu: \s*(.+)\s*$/ and $pkg->{menu} = $1; $line =~ /^Submenu: \s*(.+)\s*$/ and $pkg->{submenu} = $1; + $line =~ /^Submenu-Depends: \s*(.+)\s*$/ and $pkg->{submenudep} = $1; $line =~ /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1; $line =~ /^Depends: \s*(.+)\s*$/ and do { my @dep = split /\s+/, $1; -- cgit v1.2.3 From aa4721eb38c4f6781766ff1fda43a33148a21089 Mon Sep 17 00:00:00 2001 From: nbd Date: Fri, 21 Jul 2006 22:48:58 +0000 Subject: fix menu/submenu nesting git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4200 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/gen_menuconfig.pl | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'scripts/gen_menuconfig.pl') diff --git a/scripts/gen_menuconfig.pl b/scripts/gen_menuconfig.pl index ddce86bfa..fe0131092 100755 --- a/scripts/gen_menuconfig.pl +++ b/scripts/gen_menuconfig.pl @@ -15,6 +15,17 @@ my %category; my $cur_menu; my $cur_menu_dep; +sub close_submenu { + if ($cur_menu) { + print "endmenu\n"; + $cur_menu_dep and do { + print "endif\n"; + $cur_menu_dep = undef; + }; + undef $cur_menu; + } +} + sub print_category($) { my $cat = shift; @@ -25,14 +36,7 @@ sub print_category($) { foreach my $spkg (sort {uc($a) cmp uc($b)} keys %spkg) { foreach my $pkg (@{$spkg{$spkg}}) { if ($cur_menu ne $pkg->{submenu}) { - if ($cur_menu) { - print "endmenu\n"; - $cur_menu_dep and do { - print "endif\n"; - $cur_menu_dep = undef; - }; - undef $cur_menu; - } + close_submenu(); if ($pkg->{submenu}) { $cur_menu = $pkg->{submenu}; $cur_menu_dep = $pkg->{submenudep} and print "if $cur_menu_dep\n"; @@ -66,6 +70,7 @@ sub print_category($) { $pkg->{config} and print $pkg->{config}."\n"; } } + close_submenu(); print "endmenu\n\n"; undef $category{$cat}; -- cgit v1.2.3