aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-11-10 22:00:54 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-11-10 22:00:54 +0000
commit8075ad2ef505eff4e3297ad2e08ad5f446a8bbd2 (patch)
tree2320af26b138a3ffb9add5ad143a555920b00967 /scripts
parent085fe6bf4bb73124543b7720610582450a1bdc7b (diff)
downloadmaster-187ad058-8075ad2ef505eff4e3297ad2e08ad5f446a8bbd2.tar.gz
master-187ad058-8075ad2ef505eff4e3297ad2e08ad5f446a8bbd2.tar.bz2
master-187ad058-8075ad2ef505eff4e3297ad2e08ad5f446a8bbd2.zip
build system: introduce a new feature called build variants.
it allows building a package multiple times in one pass with different build dirs, based on the same build settings. replaces templating hacks like the one used in the hostapd package git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18357 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/metadata.pl3
-rw-r--r--scripts/metadata.pm1
2 files changed, 4 insertions, 0 deletions
diff --git a/scripts/metadata.pl b/scripts/metadata.pl
index ca00fcae6d..26d878cc9e 100755
--- a/scripts/metadata.pl
+++ b/scripts/metadata.pl
@@ -620,6 +620,9 @@ sub gen_package_mk() {
if ($config) {
$pkg->{buildonly} and $config = "";
print "package-$config += $pkg->{subdir}$pkg->{src}\n";
+ if ($pkg->{variant}) {
+ print "\$(curdir)/$pkg->{subdir}$pkg->{src}/variants += \$(if $config,$pkg->{variant})\n"
+ }
$pkg->{prereq} and print "prereq-$config += $pkg->{subdir}$pkg->{src}\n";
}
diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index 8302728be6..b7a448b617 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -112,6 +112,7 @@ sub parse_package_metadata($) {
}
};
/^Depends: \s*(.+)\s*$/ and $pkg->{depends} = [ split /\s+/, $1 ];
+ /^Build-Variant: \s*(\w+)\s*/ and $pkg->{variant} = $1;
/^Build-Only: \s*(.+)\s*$/ and $pkg->{buildonly} = 1;
/^Build-Depends: \s*(.+)\s*$/ and $pkg->{builddepends} = [ split /\s+/, $1 ];
/^Build-Depends\/(\w+): \s*(.+)\s*$/ and $pkg->{"builddepends/$1"} = [ split /\s+/, $2 ];