aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-10-01 21:26:19 +0000
committerFelix Fietkau <nbd@openwrt.org>2008-10-01 21:26:19 +0000
commit3eeaccee0305164ecb9a9ddba391ad9538fcaa68 (patch)
tree75fdd57d9c5cc5a021ec017a762801c997ca6154 /scripts
parentf620c1dbd65d8b3da2cb5b0f80d9b0d0a993e546 (diff)
downloadupstream-3eeaccee0305164ecb9a9ddba391ad9538fcaa68.tar.gz
upstream-3eeaccee0305164ecb9a9ddba391ad9538fcaa68.tar.bz2
upstream-3eeaccee0305164ecb9a9ddba391ad9538fcaa68.zip
implement conditional dependencies for menuconfig and build deps
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12820 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/feeds1
-rwxr-xr-xscripts/metadata.pl25
2 files changed, 24 insertions, 2 deletions
diff --git a/scripts/feeds b/scripts/feeds
index ab765b1ea3..8ec0799f70 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -290,6 +290,7 @@ sub install_package {
foreach my $vpkg (@{$srcpackage{$src}}, $pkg) {
foreach my $dep (@{$vpkg->{depends}}, @{$vpkg->{builddepends}}) {
next if $dep =~ /@/;
+ next if $dep =~ /:/;
$dep =~ s/^\+//;
install_package($feed, $dep) == 0 or $ret = 1;
}
diff --git a/scripts/metadata.pl b/scripts/metadata.pl
index bee3020121..e05cc92c42 100755
--- a/scripts/metadata.pl
+++ b/scripts/metadata.pl
@@ -223,6 +223,7 @@ EOF
$flags = $1;
$name = $2;
+ next if $name =~ /:/;
$flags =~ /-/ and $mode = "deselect";
$flags =~ /\+/ and $mode = "select";
$flags =~ /@/ and $confstr .= "\t$mode $name\n";
@@ -374,8 +375,13 @@ sub mconf_depends($$) {
my $m = "depends";
$depend =~ s/^([@\+]+)//;
my $flags = $1;
+ my $condition;
my $vdep;
+ if ($depend =~ /^(.+):(.+)$/) {
+ $condition = $1;
+ $depend = $2;
+ }
if ($vdep = $package{$depend}->{vdepends}) {
$depend = join("||", map { "PACKAGE_".$_ } @$vdep);
} else {
@@ -390,6 +396,7 @@ sub mconf_depends($$) {
next if $only_dep;
};
$flags =~ /@/ or $depend = "PACKAGE_$depend";
+ $condition and $depend = "$depend if $condition";
}
$dep->{$depend} =~ /select/ or $dep->{$depend} = $m;
}
@@ -535,6 +542,13 @@ sub gen_package_mk() {
my $depline = "";
foreach my $deps (@srcdeps) {
my $idx;
+ my $condition;
+
+ if ($deps =~ /^(.+):(.+)/) {
+ $condition = $1;
+ $deps = $2;
+ }
+
my $pkg_dep = $package{$deps};
my @deps;
@@ -556,13 +570,20 @@ sub gen_package_mk() {
next if $pkg->{src} eq $pkg_dep->{src};
next if $dep{$pkg->{src}."->".$idx};
next if $dep{$pkg->{src}."->($dep)".$idx};
+ my $depstr;
+
if ($pkg_dep->{vdepends}) {
- $depline .= " \$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx/compile)";
+ $depstr = "\$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx/compile)";
$dep{$pkg->{src}."->($dep)".$idx} = 1;
} else {
- $depline .= " \$(curdir)/$idx/compile";
+ $depstr = "\$(curdir)/$idx/compile";
$dep{$pkg->{src}."->".$idx} = 1;
}
+ if ($condition) {
+ $depline .= " \$(if \$(CONFIG_$condition),$depstr)";
+ } else {
+ $depline .= " $depstr";
+ }
}
}
}