aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-09-23 10:41:15 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-09-23 10:41:15 +0000
commit51b28882cc70f0b3b55acd2e316e072927f004a6 (patch)
tree4c51aa7a0d1ca58d315b1d810fa9de01cf708ed8
parent200e1d786d1cdd816cdf6f17e6933319c04a3ed3 (diff)
downloadmaster-187ad058-51b28882cc70f0b3b55acd2e316e072927f004a6.tar.gz
master-187ad058-51b28882cc70f0b3b55acd2e316e072927f004a6.tar.bz2
master-187ad058-51b28882cc70f0b3b55acd2e316e072927f004a6.zip
build: allow packages with build variants to explicitly select a default variant
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42654 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--include/package-defaults.mk1
-rw-r--r--include/package-dumpinfo.mk3
-rwxr-xr-xscripts/metadata.pl2
-rw-r--r--scripts/metadata.pm1
4 files changed, 5 insertions, 2 deletions
diff --git a/include/package-defaults.mk b/include/package-defaults.mk
index 051cde5020..19f2a16045 100644
--- a/include/package-defaults.mk
+++ b/include/package-defaults.mk
@@ -53,6 +53,7 @@ define Package/Default
HIDDEN:=
URL:=
VARIANT:=
+ DEFAULT_VARIANT:=
USERID:=
endef
diff --git a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk
index 0241580522..5d1d76fee5 100644
--- a/include/package-dumpinfo.mk
+++ b/include/package-dumpinfo.mk
@@ -34,7 +34,8 @@ Depends: $(call PKG_FIXUP_DEPENDS,$(1),$(DEPENDS))
Menu-Depends: $(MDEPENDS)
Provides: $(PROVIDES)
$(if $(VARIANT),Build-Variant: $(VARIANT)
-)$(if $(PKG_BUILD_DEPENDS),Build-Depends: $(PKG_BUILD_DEPENDS)
+$(if $(DEFAULT_VARIANT),Default-Variant: $(VARIANT)
+))$(if $(PKG_BUILD_DEPENDS),Build-Depends: $(PKG_BUILD_DEPENDS)
)$(if $(HOST_BUILD_DEPENDS),Build-Depends/host: $(HOST_BUILD_DEPENDS)
)$(if $(BUILD_TYPES),Build-Types: $(BUILD_TYPES)
)Section: $(SECTION)
diff --git a/scripts/metadata.pl b/scripts/metadata.pl
index 79f930c5ea..4014613de6 100755
--- a/scripts/metadata.pl
+++ b/scripts/metadata.pl
@@ -684,7 +684,7 @@ sub gen_package_mk() {
$pkg->{buildonly} and $config = "";
print "package-$config += $pkg->{subdir}$pkg->{src}\n";
if ($pkg->{variant}) {
- if (!defined($done{$pkg->{src}})) {
+ if (!defined($done{$pkg->{src}}) or $pkg->{variant_default}) {
print "\$(curdir)/$pkg->{subdir}$pkg->{src}/default-variant := $pkg->{variant}\n";
}
print "\$(curdir)/$pkg->{subdir}$pkg->{src}/variants += \$(if $config,$pkg->{variant})\n"
diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index 0e55c8ebed..ab5abc0363 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -115,6 +115,7 @@ sub parse_package_metadata($) {
/^Depends: \s*(.+)\s*$/ and $pkg->{depends} = [ split /\s+/, $1 ];
/^Hidden: \s*(.+)\s*$/ and $pkg->{hidden} = 1;
/^Build-Variant: \s*([\w\-]+)\s*/ and $pkg->{variant} = $1;
+ /^Default-Variant: .*/ and $pkg->{variant_default} = 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 ];