aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-09-20 20:17:28 +0000
committerFelix Fietkau <nbd@openwrt.org>2010-09-20 20:17:28 +0000
commit32b6ebf57c2704ebbb8c9c1077a19ffb9205fe83 (patch)
tree2a9d10c214cbc2beabba48cb3d7f4f5214861398
parentae17845a7c35f67cc860c3e85f232a74175d3652 (diff)
downloadupstream-32b6ebf57c2704ebbb8c9c1077a19ffb9205fe83.tar.gz
upstream-32b6ebf57c2704ebbb8c9c1077a19ffb9205fe83.tar.bz2
upstream-32b6ebf57c2704ebbb8c9c1077a19ffb9205fe83.zip
fix build dependencies on packages with multiple variants but no selected virtual packages
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23102 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--include/subdir.mk2
-rwxr-xr-xscripts/metadata.pl3
2 files changed, 4 insertions, 1 deletions
diff --git a/include/subdir.mk b/include/subdir.mk
index afc95a4427..19a1fb63a9 100644
--- a/include/subdir.mk
+++ b/include/subdir.mk
@@ -35,7 +35,7 @@ define subdir
)
$(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(target): $(if $(QUILT),,$($(1)/$(bd)/$(target)) $(call $(1)//$(target),$(1)/$(bd))))
$(if $(BUILD_LOG),@mkdir -p $(BUILD_LOG_DIR)/$(1)/$(bd))
- $(foreach variant,$(if $(BUILD_VARIANT),$(BUILD_VARIANT),$(if $($(1)/$(bd)/variants),$($(1)/$(bd)/variants),__default)),
+ $(foreach variant,$(if $(BUILD_VARIANT),$(BUILD_VARIANT),$(if $(strip $($(1)/$(bd)/variants)),$($(1)/$(bd)/variants),$(if $($(1)/$(bd)/default-variant),$($(1)/$(bd)/default-variant),__default))),
+$(if $(BUILD_LOG),set -o pipefail;) $$(SUBMAKE) -C $(1)/$(bd) $(target) BUILD_VARIANT="$(filter-out __default,$(variant))" $(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)/$(bd)/$(target).txt) $(if $(findstring $(bd),$($(1)/builddirs-ignore-$(target))), || $(call MESSAGE, ERROR: $(1)/$(bd) failed to build$(if $(filter-out __default,$(variant)), (build variant: $(variant))).))
)
$$(if $(call debug,$(1)/$(bd),v),,.SILENT: $(1)/$(bd)/$(target))
diff --git a/scripts/metadata.pl b/scripts/metadata.pl
index 2e90257270..45d202e439 100755
--- a/scripts/metadata.pl
+++ b/scripts/metadata.pl
@@ -640,6 +640,9 @@ sub gen_package_mk() {
$pkg->{buildonly} and $config = "";
print "package-$config += $pkg->{subdir}$pkg->{src}\n";
if ($pkg->{variant}) {
+ if (!defined($done{$pkg->{src}})) {
+ print "\$(curdir)/$pkg->{subdir}$pkg->{src}/default-variant := $pkg->{variant}\n";
+ }
print "\$(curdir)/$pkg->{subdir}$pkg->{src}/variants += \$(if $config,$pkg->{variant})\n"
}
$pkg->{prereq} and print "prereq-$config += $pkg->{subdir}$pkg->{src}\n";