- foreach my $deps (@srcdeps) {
- my $idx;
- my $condition;
- my $prefix = "";
- my $suffix = "";
- my $deptype = "";
-
- if ($deps =~ /^(.+):(.+)/) {
- $condition = $1;
- $deps = $2;
- }
- if ($deps =~ /^(.+)\/(.+)/) {
- $deps = $1;
- $deptype = $2;
- $suffix = "/$2";
- }
-
- my $pkg_dep = $package{$deps};
- my @deps;
-
- if ($pkg_dep->{vdepends}) {
- @deps = @{$pkg_dep->{vdepends}};
- } else {
- @deps = ($deps);
- }
-
- foreach my $dep (@deps) {
- $pkg_dep = $package{$deps};
- if (defined $pkg_dep->{src}) {
- unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}{buildtypes}}) {
- warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n",
- $src->{makefile}, $pkg_dep->{src}{name}, $deptype, $pkg_dep->{src}{makefile}, $deptype;
- next;
- }
- $idx = $pkg_dep->{src}{path};
- } elsif (defined($srcpackage{$dep})) {
- $idx = $srcpackage{$dep}{path};
- }
-
- if ($idx) {
- $idx .= $suffix;
-
- my $depline;
- next if $srcname eq $pkg_dep->{src}{name}.$suffix;
- next if $dep{$condition.":".$srcname."->".$idx};
- next if $dep{$srcname."->($dep)".$idx} and $pkg_dep->{vdepends};
- my $depstr;
-
- if ($pkg_dep->{vdepends}) {
- $depstr = "\$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx/compile)";
- $dep{$srcname."->($dep)".$idx} = 1;
- } else {
- $depstr = "\$(curdir)/$idx/compile";
- $dep{$srcname."->".$idx} = 1;
- }
- $depline = get_conditional_dep($condition, $depstr);
- if ($depline) {
- $deplines{''}{$depline}++;
- }
- }
- }
- }