aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-06-10 21:10:02 +0000
committerFelix Fietkau <nbd@openwrt.org>2008-06-10 21:10:02 +0000
commit03976cac7dd286bfc57ecfeba073e0afe3d89672 (patch)
treea134c58ab2fa9f255e3369d075e7216c383ae3a7 /scripts
parent5f27e3969eec8b0b9b4e9ee359e8273566cc3455 (diff)
downloadupstream-03976cac7dd286bfc57ecfeba073e0afe3d89672.tar.gz
upstream-03976cac7dd286bfc57ecfeba073e0afe3d89672.tar.bz2
upstream-03976cac7dd286bfc57ecfeba073e0afe3d89672.zip
consider virtual dependencies (generated by using PROVIDES:=) when generating the build dependencies (fixes python build dependency errors)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11428 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/metadata.pl46
1 files changed, 32 insertions, 14 deletions
diff --git a/scripts/metadata.pl b/scripts/metadata.pl
index 09947d8085..50d636a673 100755
--- a/scripts/metadata.pl
+++ b/scripts/metadata.pl
@@ -495,6 +495,7 @@ EOF
sub gen_package_mk() {
my %conf;
my %dep;
+ my %done;
my $line;
parse_package_metadata($ARGV[0]) or exit 1;
@@ -503,6 +504,9 @@ sub gen_package_mk() {
my $pkg = $package{$name};
next if defined $pkg->{vdepends};
+ next if $done{$pkg->{src}};
+ $done{$pkg->{src}} = 1;
+
if ($ENV{SDK}) {
$conf{$pkg->{src}} or do {
$config = 'm';
@@ -518,23 +522,37 @@ sub gen_package_mk() {
my $hasdeps = 0;
my $depline = "";
- foreach my $dep (@{$pkg->{depends}}, @{$pkg->{builddepends}}) {
- next if $dep =~ /@/;
- $dep =~ s/\+//;
+ foreach my $deps (@{$pkg->{depends}}, @{$pkg->{builddepends}}) {
+ next if $deps =~ /@/;
+ $deps =~ s/\+//;
my $idx;
- my $pkg_dep = $package{$dep};
- next if defined $pkg_dep->{vdepends};
+ my $pkg_dep = $package{$deps};
+ my @deps;
- if (defined $pkg_dep->{src}) {
- ($pkg->{src} ne $pkg_dep->{src}) and $idx = $pkg_dep->{subdir}.$pkg_dep->{src};
- } elsif (defined($srcpackage{$dep})) {
- $idx = $subdir{$dep}.$dep;
+ if ($pkg_dep->{vdepends}) {
+ @deps = @{$pkg_dep->{vdepends}};
+ } else {
+ @deps = ($deps);
}
- undef $idx if $idx =~ /^(kernel)|(base-files)$/;
- if ($idx) {
- next if $dep{$pkg->{src}."->".$idx};
- $depline .= " \$(curdir)/$idx/compile";
- $dep{$pkg->{src}."->".$idx} = 1;
+
+ foreach my $dep (@deps) {
+ $pkg_dep = $package{$deps};
+ if (defined $pkg_dep->{src}) {
+ ($pkg->{src} ne $pkg_dep->{src}) and $idx = $pkg_dep->{subdir}.$pkg_dep->{src};
+ } elsif (defined($srcpackage{$dep})) {
+ $idx = $subdir{$dep}.$dep;
+ }
+ undef $idx if $idx =~ /^(kernel)|(base-files)$/;
+ if ($idx) {
+ next if $dep{$pkg->{src}."->".$idx};
+ next if $pkg->{src} eq $pkg_dep->{src};
+ if ($pkg_dep->{vdepends}) {
+ $depline .= " \$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx/compile)";
+ } else {
+ $depline .= " \$(curdir)/$idx/compile";
+ $dep{$pkg->{src}."->".$idx} = 1;
+ }
+ }
}
}
if ($depline) {