aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-05-30 18:55:52 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-05-30 18:55:52 +0000
commitf45baccdc5081fc6245c9d567ddb47518f3dc84b (patch)
treedce7c27a867c504bd1f1509244405407154d9da9 /scripts
parent8fcedabfaf95affbbba45bfdbf2627e92fa52ccd (diff)
downloadupstream-f45baccdc5081fc6245c9d567ddb47518f3dc84b.tar.gz
upstream-f45baccdc5081fc6245c9d567ddb47518f3dc84b.tar.bz2
upstream-f45baccdc5081fc6245c9d567ddb47518f3dc84b.zip
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
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gen_deps.pl19
-rwxr-xr-xscripts/gen_menuconfig.pl9
2 files changed, 23 insertions, 5 deletions
diff --git a/scripts/gen_deps.pl b/scripts/gen_deps.pl
index 40153bde3d..d75f06d6f6 100755
--- a/scripts/gen_deps.pl
+++ b/scripts/gen_deps.pl
@@ -5,6 +5,7 @@ my $name;
my $src;
my $makefile;
my %pkg;
+my %dep;
my $line;
while ($line = <>) {
@@ -19,8 +20,12 @@ while ($line = <>) {
$pkg{$name}->{src} = $src;
};
$line =~ /^(Build-)?Depends: \s*(.+)\s*$/ and do {
- my @dep = split /,\s*/, $2;
- $pkg{$name}->{depends} = \@dep;
+ $pkg{$name}->{depends} ||= [];
+ foreach my $v (split /\s+/, $2) {
+ next if $v =~ /^@/;
+ $v =~ s/^\+//;
+ push @{$pkg{$name}->{depends}}, $v;
+ }
};
}
@@ -32,8 +37,16 @@ foreach $name (sort {uc($a) cmp uc($b)} keys %pkg) {
my $hasdeps = 0;
my $depline = "";
foreach my $dep (@{$pkg{$name}->{depends}}) {
+ my $idx;
if (defined $pkg{$dep}->{src} && $pkg{$name}->{src} ne $pkg{$dep}->{src}) {
- $depline .= " $pkg{$dep}->{src}-compile";
+ $idx = $pkg{$dep}->{src};
+ } elsif (defined $pkg{$dep}) {
+ $idx = $dep;
+ }
+ if ($idx) {
+ next if $dep{$pkg{$name}->{src}."->".$idx};
+ $depline .= " $idx\-compile";
+ $dep{$pkg{$name}->{src}."->".$idx} = 1;
}
}
if ($depline ne "") {
diff --git a/scripts/gen_menuconfig.pl b/scripts/gen_menuconfig.pl
index e282ee3ed2..a7f939ff52 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 {