improve dependency handling, fix some package makefile bugs
authorFelix Fietkau <nbd@openwrt.org>
Tue, 30 May 2006 18:55:52 +0000 (18:55 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 30 May 2006 18:55:52 +0000 (18:55 +0000)
SVN-Revision: 3843

17 files changed:
openwrt/Makefile
openwrt/package/Makefile
openwrt/package/dropbear/Makefile
openwrt/package/iproute2/Makefile
openwrt/package/ipsec-tools/Makefile
openwrt/package/ipset/Makefile
openwrt/package/nvram/Makefile
openwrt/package/pcmcia-cs/Makefile
openwrt/package/ppp/Makefile
openwrt/package/robocfg/Makefile
openwrt/package/rules.mk
openwrt/package/udev/Makefile
openwrt/package/wificonf/Makefile
openwrt/package/wireless-tools/Makefile
openwrt/package/zlib/Makefile
openwrt/scripts/gen_deps.pl
openwrt/scripts/gen_menuconfig.pl

index 8a2e6bbb8e2c90064bdf2f03ca607410091c4b2c..f93b008033f0f323502c4a73849e489625e46c8c 100644 (file)
@@ -70,10 +70,10 @@ config: scripts/config/conf
 config-clean:
        $(MAKE) -C scripts/config clean
 
-package/%:
+package/%: .pkginfo
        $(MAKE) -C package $(patsubst package/%,%,$@)
 
-target/%:
+target/%: .pkginfo
        $(MAKE) -C target $(patsubst target/%,%,$@)
 
 toolchain/%:
index 0dc2670174ff5f48a26a74b144b3cdd333285e1d..adeb238d437ecbc4165146393e831e128b865bfa 100644 (file)
@@ -1,7 +1,7 @@
 # Main makefile for the packages
 include $(TOPDIR)/rules.mk
 include $(TOPDIR)/.config
-include .pkgdeps
+include $(TOPDIR)/.pkgdeps
 
 COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
 INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
@@ -20,7 +20,7 @@ $(STAMP_DIR) $(TARGET_DIR):
        $(MAKE) -C $(patsubst %-clean,%,$@) clean
 
 
-.pkgdeps: $(TOPDIR)/.pkginfo
+$(TOPDIR)/.pkgdeps: $(TOPDIR)/.pkginfo
        @$(TOPDIR)/scripts/gen_deps.pl < $< > $@ || rm -f $@
 
 all: compile
index 4a732ee831ff5a840484c7b74906b476b976869e..28cdd15f7cf46231fc061f8b7d1255a7ea699f41 100644 (file)
@@ -25,10 +25,9 @@ endef
 
 define Package/dropbearconvert
 $(call Package/dropbear)
-DEFAULT:=m
 TITLE:=Utility for converting SSH keys
 DESCRIPTION:=Utility for converting SSH keys
-DEPENDS:=zlib
+DEPENDS:=+zlib
 endef
 
 define Build/Configure
index c670ee5dac3d48ab2ce39a0da8f63d4ae706a2fa..11336948f47b7575761d91ce7de0686d1c9ccae8 100644 (file)
@@ -14,25 +14,15 @@ PKG_CAT:=zcat
 
 include $(TOPDIR)/package/rules.mk
 
-# define Package/iproute2
-# SECTION:=base
-# CATEGORY:=Network
-# DEFAULT:=n
-# MENU:=1
-# TITLE:=A collection of utilites for controlling TCP/IP networking and Traffic Control
-# endef
-
 define Package/ip
 SECTION:=base
 CATEGORY:=Network
-DEFAULT:=n
 DEPENDS:=iproute2
 TITLE:=A routing control utility
 endef
 
 define Package/tc
 $(call Package/ip)
-# DEPENDS:=kmod-sched
 TITLE:=A traffic control utility
 endef
 
index e85f09d89c9717e41f29fcd93930f13c57920630..4b6bfe09ecbcb3df31e18d693d79d2118458c8fc 100644 (file)
@@ -19,7 +19,7 @@ include $(TOPDIR)/package/rules.mk
 define Package/ipsec-tools
 SECTION:=base
 CATEGORY:=Network
-DEFAULT:=y
+DEPENDS:=@LINUX_2_6
 TITLE:=IPsec management tools
 DESCRIPTION:=IPsec management tools
 URL:=http://ipsec-tools.sourceforge.net/
index 8cfdee94e6f937de879d915daf45c3bfcfb9d206..7358f03a7c5e8cec53367896b18b2950872aac90 100644 (file)
@@ -17,8 +17,7 @@ include $(TOPDIR)/package/rules.mk
 define Package/ipset
 SECTION:=base
 CATEGORY:=Network
-DEFAULT:=y
-DEPENDS:=kmod-iptables-extra
+DEPENDS:=+kmod-iptables-extra
 TITLE:=Netfilter ip sets administration utility
 DESCRIPTION:=Netfilter ip sets administration utility
 URL:=http://ipset.netfilter.org/
index 3b9f82dbe0525985ca222bbfd274057d2cc972a2..9cc6b9997abcd29929af99920fb7081493ca4b43 100644 (file)
@@ -11,8 +11,7 @@ include $(TOPDIR)/package/rules.mk
 
 define Package/nvram
 SECTION:=base
-# CATEGORY:=FIXME
-DEFAULT:=n
+DEPENDS:=@LINUX_2_4_BRCM
 TITLE:=Broadcom config utility
 DESCRIPTION:=control utility for broadcom's 'nvram' config area
 endef
index 76e63d31578bb526e08d4b09c265e0ab2e88ffba..a389fd63e1947715e8db902fa706a70c6f4744df 100644 (file)
@@ -18,8 +18,7 @@ include $(TOPDIR)/package/rules.mk
 
 define Package/pcmcia-cs
 SECTION:=base
-# CATEGORY:=FIXME
-DEFAULT:=n
+DEPENDS:=@PCMCIA_SUPPORT
 TITLE:=PCMCIA/Cardbus management utilities
 DESCRIPTION:=PCMCIA/Cardbus management utilities
 URL:=http://pcmcia-cs.sourceforge.net/
index 0139eb051f73a0f7b872756f35900a1742507b87..2f0140030895da84dcd5aa3385f79a64599a97d4 100644 (file)
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=ppp
 PKG_VERSION:=2.4.3
 PKG_RELEASE:=7
-PKG_BUILDDEP:=libpcap
+PKG_BUILDDEP:=libpcap linux-atm
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@@ -30,7 +30,7 @@ endef
 define Package/ppp-mod-pppoa
  SECTION:=net
  CATEGORY:=Network
- DEPENDS:=ppp
+ DEPENDS:=ppp +linux-atm
  TITLE:=PPPoA plugin
  DESCRIPTION:=PPPoA (PPP over ATM) plugin for ppp
 endef
index 8f89e7538788d5858ef90502b001a14f7061d52e..81cf99ac237c32b49fdca9d51989914d78a58389 100644 (file)
@@ -12,8 +12,6 @@ include $(TOPDIR)/package/rules.mk
 
 define Package/robocfg
 SECTION:=base
-# CATEGORY:=FIXME
-DEFAULT:=n
 TITLE:=BCM5325E/536x switch configuration utility
 DESCRIPTION:=Broadcom BCM5325E/536x switch configuration utility
 endef
index 55066610d012b2f661441197027a7566b78ded97..d436df8dcee01f4aa6f0bdc95afa5e318c0d38f6 100644 (file)
@@ -132,7 +132,14 @@ define BuildPackage
        mkdir -p $$(IDIR_$(1))/CONTROL
        echo "Package: $(1)" > $$(IDIR_$(1))/CONTROL/control
        echo "Version: $(VERSION)" >> $$(IDIR_$(1))/CONTROL/control
-       echo "Depends: $$(IDEPEND_$(1))" >> $$(IDIR_$(1))/CONTROL/control
+       ( \
+               DEPENDS=; \
+               for depend in $$(IDEPEND_$(1)); do \
+                       [ "$$$${depend%%%%%%%%[A-Za-z]*}" = "@" ] && continue; \
+                       DEPENDS=$$$${DEPENDS:+$$$$DEPENDS, }$$$${depend##+}; \
+               done; \
+               echo "Depends: $$$$DEPENDS" >> $$(IDIR_$(1))/CONTROL/control; \
+       )
        echo "Source: $(SOURCE)" >> $$(IDIR_$(1))/CONTROL/control
        echo "Section: $(SECTION)" >> $$(IDIR_$(1))/CONTROL/control
        echo "Priority: $(PRIORITY)" >> $$(IDIR_$(1))/CONTROL/control
index c7e5f44083f5629ba8d90ee405c0063f70e0facb..54e06dcff6198780b2c58c1bfc05db99ee449f1a 100644 (file)
@@ -23,8 +23,7 @@ include $(TOPDIR)/package/rules.mk
 
 define Package/udev
 SECTION:=base
-# CATEGORY:=FIXME
-DEFAULT:=n
+DEPENDS:=@LINUX_2_6
 TITLE:=Dynamic device management subsystem
 DESCRIPTION:=udev provides a dynamic device directory containing only the files for \\\
 actually present devices. It creates or removes device node files in \\\
index 5fbaf052312ad790a064659f89fee607744bada9..dc61267a73e4a419cb008db218b33b798cdc581c 100644 (file)
@@ -12,7 +12,7 @@ include $(TOPDIR)/package/rules.mk
 define Package/wificonf
 SECTION:=base
 CATEGORY:=Network
-DEFAULT:=y
+DEPENDS:=nvram +wireless-tools
 TITLE:=replacement utility for wlconf
 DESCRIPTION:=Replacement utility for wlconf
 endef
index 39a4ee6b66c7d0d5db7340db1e1f645fa98cff95..17b59f841f2ee5749708c801e51f763f7b2bfd54 100644 (file)
@@ -42,12 +42,16 @@ define Package/wireless-tools/install
        install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/iw{config,getid,list,priv,spy} $(1)/usr/sbin/
 endef
 
-install-dev: $(PKG_BUILD_DIR)/.built
+define Build/InstallDev
        mkdir -p $(STAGING_DIR)/usr/{lib,include}
        $(CP) $(PKG_BUILD_DIR)/libiw.so* $(STAGING_DIR)/usr/lib/
        ln -sf libiw.so.28 $(STAGING_DIR)/usr/lib/libiw.so
        $(CP) $(PKG_BUILD_DIR)/{iwlib,wireless}.h $(STAGING_DIR)/usr/include/
+endef
        
-uninstall-dev:
+define Build/UninstallDev
        rm -f $(STAGING_DIR)/usr/lib/libiw.*
        rm -f $(STAGING_DIR)/usr/include/{iwlib,wireless}.h
+endef
+
+$(eval $(call BuildPackage,wireless-tools))
index da9e6f461464b17df0d14985804854b7ab55ea26..33cbcceb276dd3c3172104d667e2f25d3d76c9f1 100644 (file)
@@ -20,7 +20,6 @@ include $(TOPDIR)/package/rules.mk
 define Package/zlib
 SECTION:=base
 CATEGORY:=Libraries
-DEFAULT:=n
 TITLE:=Library implementing the deflate compression method
 DESCRIPTION:=A library implementing the 'deflate' compression method
 URL:=http://www.zlib.net/
index 40153bde3d10f6d96c01df1a74e145740237303d..d75f06d6f6f8a99f02a82bb6681a8f665fdf16a1 100755 (executable)
@@ -5,6 +5,7 @@ my $name;
 my $src;
 my $makefile;
 my %pkg;
+my %dep;
 
 my $line;
 while ($line = <>) {
@@ -19,8 +20,12 @@ while ($line = <>) {
                $pkg{$name}->{src} = $src;
        };
        $line =~ /^(Build-)?Depends: \s*(.+)\s*$/ and do {
-               my @dep = split /,\s*/, $2;
-               $pkg{$name}->{depends} = \@dep;
+               $pkg{$name}->{depends} ||= [];
+               foreach my $v (split /\s+/, $2) {
+                       next if $v =~ /^@/;
+                       $v =~ s/^\+//;
+                       push @{$pkg{$name}->{depends}}, $v;
+               }
        };
 }
 
@@ -32,8 +37,16 @@ foreach $name (sort {uc($a) cmp uc($b)} keys %pkg) {
        my $hasdeps = 0;
        my $depline = "";
        foreach my $dep (@{$pkg{$name}->{depends}}) {
+               my $idx;
                if (defined $pkg{$dep}->{src} && $pkg{$name}->{src} ne $pkg{$dep}->{src}) {
-                       $depline .= " $pkg{$dep}->{src}-compile";
+                       $idx = $pkg{$dep}->{src};
+               } elsif (defined $pkg{$dep}) {
+                       $idx = $dep;
+               }
+               if ($idx) {
+                       next if $dep{$pkg{$name}->{src}."->".$idx};
+                       $depline .= " $idx\-compile";
+                       $dep{$pkg{$name}->{src}."->".$idx} = 1;
                }
        }
        if ($depline ne "") {
index e282ee3ed2d95a8b96f210af5af392eade2af32d..a7f939ff52d38e0cf13b7d8f4f6895bb956b39ea 100755 (executable)
@@ -26,7 +26,12 @@ sub print_category($) {
                        print "\t\ttristate \"$title\"\n";
                        print "\t\tdefault ".$pkg->{default}."\n";
                        foreach my $depend (@{$pkg->{depends}}) {
-                               print "\t\tdepends PACKAGE_$depend\n";
+                               my $m = "depends";
+                               $depend =~ s/^([@\+])//;
+                               my $flags = $1;
+                               $flags =~ /@/ or $depend = "PACKAGE_$depend";
+                               $flags =~ /\+/ and $m = "select";
+                               print "\t\t$m $depend\n";
                        }
                        print "\t\thelp\n";
                        print $pkg->{description};
@@ -60,7 +65,7 @@ while ($line = <>) {
        $line =~ /^Menu: \s*(.+)\s*$/ and $pkg->{menu} = $1;
        $line =~ /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1;
        $line =~ /^Depends: \s*(.+)\s*$/ and do {
-               my @dep = split /,\s*/, $1;
+               my @dep = split /\s+/, $1;
                $pkg->{depends} = \@dep;
        };
        $line =~ /^Category: \s*(.+)\s*$/ and do {