my %deplines = ('' => {});
foreach my $pkg (@{$src->{packages}}) {
+ my @pkgdeplines;
foreach my $dep (@{$pkg->{depends}}) {
next if ($dep =~ /@/);
}
my $depline = get_conditional_dep($condition, $depstr);
if ($depline) {
- $deplines{''}{$depline}++;
+ push @pkgdeplines, $depline;
}
}
}
+ if (@pkgdeplines) {
+ my $depstr = join(' ', @pkgdeplines);
+ if ($depstr) {
+ my $depline = get_conditional_dep('PACKAGE_'.$pkg->{name}, $depstr);
+ $deplines{''}{$depline}++;
+ }
+ }
my $config = '';
$config = sprintf '$(CONFIG_PACKAGE_%s)', $pkg->{name} unless $pkg->{buildonly};
}
foreach my $suffix (sort keys %deplines) {
- my $depline = join(" ", sort keys %{$deplines{$suffix}});
- if ($depline) {
+ for my $depline (sort keys %{$deplines{$suffix}}) {
$line .= sprintf "\$(curdir)/%s/compile += %s\n", $src->{path}.$suffix, $depline;
}
}