Implement an ARCH_PACKAGES variable which defaults to BOARD but can be overridden...
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 12 Sep 2010 20:49:54 +0000 (20:49 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 12 Sep 2010 20:49:54 +0000 (20:49 +0000)
SVN-Revision: 23029

include/package-defaults.mk
include/target.mk
rules.mk
scripts/metadata.pl

index 649f409f50d168d3bc1eae27a791073ff58f6301..f17653b7fe0ee8b736ee3f046798d7f524eb080e 100644 (file)
@@ -23,10 +23,10 @@ define Package/Default
   else
     VERSION:=$(PKG_RELEASE)
   endif
-  ifneq ($(CONFIG_TARGET_adm5120),y)
-    PKGARCH:=$(BOARD)
+  ifneq ($(ARCH_PACKAGES),)
+    PKGARCH:=$(ARCH_PACKAGES)
   else
-    PKGARCH:=$(BOARD)_$(ARCH)
+    PKGARCH:=$(BOARD)
   endif
   PRIORITY:=optional
   DEFAULT:=
index d49714c3533045409518034d87fc184f5f971255..9744a7ca7e3d600a03aca4e0d00e1ed64bf7756a 100644 (file)
@@ -178,6 +178,7 @@ define BuildTargets/DumpCurrent
         echo 'Target-Name: $(BOARDNAME)$(if $(SUBTARGETS),$(if $(SUBTARGET),))'; \
         echo 'Target-Path: $(subst $(TOPDIR)/,,$(PWD))'; \
         echo 'Target-Arch: $(ARCH)'; \
+        echo 'Target-Arch-Packages: $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD))'; \
         echo 'Target-Features: $(FEATURES)'; \
         echo 'Target-Depends: $(DEPENDS)'; \
         echo 'Target-Optimization: $(if $(CFLAGS),$(CFLAGS),$(DEFAULT_CFLAGS))'; \
index 1ce28e1bbae5651924c4dff53e03a93107d9120e..e07b06c2e59708fdf66beb74240b272f70827a40 100644 (file)
--- a/rules.mk
+++ b/rules.mk
@@ -31,6 +31,7 @@ strip_last=$(patsubst %.$(lastword $(subst .,$(space),$(1))),%,$(1))
 _SINGLE=export MAKEFLAGS=$(space);
 CFLAGS:=
 ARCH:=$(subst i486,i386,$(subst i586,i386,$(subst i686,i386,$(call qstrip,$(CONFIG_ARCH)))))
+ARCH_PACKAGES:=$(call qstrip,$(CONFIG_TARGET_ARCH_PACKAGES))
 BOARD:=$(call qstrip,$(CONFIG_TARGET_BOARD))
 TARGET_OPTIMIZATION:=$(call qstrip,$(CONFIG_TARGET_OPTIMIZATION))
 TARGET_SUFFIX=$(call qstrip,$(CONFIG_TARGET_SUFFIX))
index 336605f7b0edf6d05d42491c56ed8ed5eb716f71..2e90257270b8c3e21a10ffebe6d8fae81a64b55d 100755 (executable)
@@ -49,6 +49,7 @@ sub parse_target_metadata() {
                /^Target-Name:\s*(.+)\s*$/ and $target->{name} = $1;
                /^Target-Path:\s*(.+)\s*$/ and $target->{path} = $1;
                /^Target-Arch:\s*(.+)\s*$/ and $target->{arch} = $1;
+               /^Target-Arch-Packages:\s*(.+)\s*$/ and $target->{arch_packages} = $1;
                /^Target-Features:\s*(.+)\s*$/ and $target->{features} = [ split(/\s+/, $1) ];
                /^Target-Depends:\s*(.+)\s*$/ and $target->{depends} = [ split(/\s+/, $1) ];
                /^Target-Description:/ and $target->{desc} = get_multiline(*FILE);
@@ -335,6 +336,15 @@ EOF
                $target->{subtarget} or print "\t\tdefault \"".$target->{board}."\" if TARGET_".$target->{conf}."\n";
        }
        print <<EOF;
+config TARGET_ARCH_PACKAGES
+       string
+       
+EOF
+       foreach my $target (@target) {
+               next if @{$target->{subtargets}} > 0;
+               print "\t\tdefault \"".($target->{arch_packages} || $target->{board})."\" if TARGET_".$target->{conf}."\n";
+       }
+       print <<EOF;
 
 config DEFAULT_TARGET_OPTIMIZATION
        string