1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-17 21:57:10 +02:00

improve dependency handling, fix some package makefile bugs

git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3843 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2006-05-30 18:55:52 +00:00
parent 63402121b0
commit e240cc0ea6
17 changed files with 50 additions and 39 deletions

View File

@ -70,10 +70,10 @@ config: scripts/config/conf
config-clean: config-clean:
$(MAKE) -C scripts/config clean $(MAKE) -C scripts/config clean
package/%: package/%: .pkginfo
$(MAKE) -C package $(patsubst package/%,%,$@) $(MAKE) -C package $(patsubst package/%,%,$@)
target/%: target/%: .pkginfo
$(MAKE) -C target $(patsubst target/%,%,$@) $(MAKE) -C target $(patsubst target/%,%,$@)
toolchain/%: toolchain/%:

View File

@ -1,7 +1,7 @@
# Main makefile for the packages # Main makefile for the packages
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
include $(TOPDIR)/.config include $(TOPDIR)/.config
include .pkgdeps include $(TOPDIR)/.pkgdeps
COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m)) COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y)) INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
@ -20,7 +20,7 @@ $(STAMP_DIR) $(TARGET_DIR):
$(MAKE) -C $(patsubst %-clean,%,$@) clean $(MAKE) -C $(patsubst %-clean,%,$@) clean
.pkgdeps: $(TOPDIR)/.pkginfo $(TOPDIR)/.pkgdeps: $(TOPDIR)/.pkginfo
@$(TOPDIR)/scripts/gen_deps.pl < $< > $@ || rm -f $@ @$(TOPDIR)/scripts/gen_deps.pl < $< > $@ || rm -f $@
all: compile all: compile

View File

@ -25,10 +25,9 @@ endef
define Package/dropbearconvert define Package/dropbearconvert
$(call Package/dropbear) $(call Package/dropbear)
DEFAULT:=m
TITLE:=Utility for converting SSH keys TITLE:=Utility for converting SSH keys
DESCRIPTION:=Utility for converting SSH keys DESCRIPTION:=Utility for converting SSH keys
DEPENDS:=zlib DEPENDS:=+zlib
endef endef
define Build/Configure define Build/Configure

View File

@ -14,25 +14,15 @@ PKG_CAT:=zcat
include $(TOPDIR)/package/rules.mk 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 define Package/ip
SECTION:=base SECTION:=base
CATEGORY:=Network CATEGORY:=Network
DEFAULT:=n
DEPENDS:=iproute2 DEPENDS:=iproute2
TITLE:=A routing control utility TITLE:=A routing control utility
endef endef
define Package/tc define Package/tc
$(call Package/ip) $(call Package/ip)
# DEPENDS:=kmod-sched
TITLE:=A traffic control utility TITLE:=A traffic control utility
endef endef

View File

@ -19,7 +19,7 @@ include $(TOPDIR)/package/rules.mk
define Package/ipsec-tools define Package/ipsec-tools
SECTION:=base SECTION:=base
CATEGORY:=Network CATEGORY:=Network
DEFAULT:=y DEPENDS:=@LINUX_2_6
TITLE:=IPsec management tools TITLE:=IPsec management tools
DESCRIPTION:=IPsec management tools DESCRIPTION:=IPsec management tools
URL:=http://ipsec-tools.sourceforge.net/ URL:=http://ipsec-tools.sourceforge.net/

View File

@ -17,8 +17,7 @@ include $(TOPDIR)/package/rules.mk
define Package/ipset define Package/ipset
SECTION:=base SECTION:=base
CATEGORY:=Network CATEGORY:=Network
DEFAULT:=y DEPENDS:=+kmod-iptables-extra
DEPENDS:=kmod-iptables-extra
TITLE:=Netfilter ip sets administration utility TITLE:=Netfilter ip sets administration utility
DESCRIPTION:=Netfilter ip sets administration utility DESCRIPTION:=Netfilter ip sets administration utility
URL:=http://ipset.netfilter.org/ URL:=http://ipset.netfilter.org/

View File

@ -11,8 +11,7 @@ include $(TOPDIR)/package/rules.mk
define Package/nvram define Package/nvram
SECTION:=base SECTION:=base
# CATEGORY:=FIXME DEPENDS:=@LINUX_2_4_BRCM
DEFAULT:=n
TITLE:=Broadcom config utility TITLE:=Broadcom config utility
DESCRIPTION:=control utility for broadcom's 'nvram' config area DESCRIPTION:=control utility for broadcom's 'nvram' config area
endef endef

View File

@ -18,8 +18,7 @@ include $(TOPDIR)/package/rules.mk
define Package/pcmcia-cs define Package/pcmcia-cs
SECTION:=base SECTION:=base
# CATEGORY:=FIXME DEPENDS:=@PCMCIA_SUPPORT
DEFAULT:=n
TITLE:=PCMCIA/Cardbus management utilities TITLE:=PCMCIA/Cardbus management utilities
DESCRIPTION:=PCMCIA/Cardbus management utilities DESCRIPTION:=PCMCIA/Cardbus management utilities
URL:=http://pcmcia-cs.sourceforge.net/ URL:=http://pcmcia-cs.sourceforge.net/

View File

@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ppp PKG_NAME:=ppp
PKG_VERSION:=2.4.3 PKG_VERSION:=2.4.3
PKG_RELEASE:=7 PKG_RELEASE:=7
PKG_BUILDDEP:=libpcap PKG_BUILDDEP:=libpcap linux-atm
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@ -30,7 +30,7 @@ endef
define Package/ppp-mod-pppoa define Package/ppp-mod-pppoa
SECTION:=net SECTION:=net
CATEGORY:=Network CATEGORY:=Network
DEPENDS:=ppp DEPENDS:=ppp +linux-atm
TITLE:=PPPoA plugin TITLE:=PPPoA plugin
DESCRIPTION:=PPPoA (PPP over ATM) plugin for ppp DESCRIPTION:=PPPoA (PPP over ATM) plugin for ppp
endef endef

View File

@ -12,8 +12,6 @@ include $(TOPDIR)/package/rules.mk
define Package/robocfg define Package/robocfg
SECTION:=base SECTION:=base
# CATEGORY:=FIXME
DEFAULT:=n
TITLE:=BCM5325E/536x switch configuration utility TITLE:=BCM5325E/536x switch configuration utility
DESCRIPTION:=Broadcom BCM5325E/536x switch configuration utility DESCRIPTION:=Broadcom BCM5325E/536x switch configuration utility
endef endef

View File

@ -132,7 +132,14 @@ define BuildPackage
mkdir -p $$(IDIR_$(1))/CONTROL mkdir -p $$(IDIR_$(1))/CONTROL
echo "Package: $(1)" > $$(IDIR_$(1))/CONTROL/control echo "Package: $(1)" > $$(IDIR_$(1))/CONTROL/control
echo "Version: $(VERSION)" >> $$(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 "Source: $(SOURCE)" >> $$(IDIR_$(1))/CONTROL/control
echo "Section: $(SECTION)" >> $$(IDIR_$(1))/CONTROL/control echo "Section: $(SECTION)" >> $$(IDIR_$(1))/CONTROL/control
echo "Priority: $(PRIORITY)" >> $$(IDIR_$(1))/CONTROL/control echo "Priority: $(PRIORITY)" >> $$(IDIR_$(1))/CONTROL/control

View File

@ -23,8 +23,7 @@ include $(TOPDIR)/package/rules.mk
define Package/udev define Package/udev
SECTION:=base SECTION:=base
# CATEGORY:=FIXME DEPENDS:=@LINUX_2_6
DEFAULT:=n
TITLE:=Dynamic device management subsystem TITLE:=Dynamic device management subsystem
DESCRIPTION:=udev provides a dynamic device directory containing only the files for \\\ DESCRIPTION:=udev provides a dynamic device directory containing only the files for \\\
actually present devices. It creates or removes device node files in \\\ actually present devices. It creates or removes device node files in \\\

View File

@ -12,7 +12,7 @@ include $(TOPDIR)/package/rules.mk
define Package/wificonf define Package/wificonf
SECTION:=base SECTION:=base
CATEGORY:=Network CATEGORY:=Network
DEFAULT:=y DEPENDS:=nvram +wireless-tools
TITLE:=replacement utility for wlconf TITLE:=replacement utility for wlconf
DESCRIPTION:=Replacement utility for wlconf DESCRIPTION:=Replacement utility for wlconf
endef endef

View 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/ install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/iw{config,getid,list,priv,spy} $(1)/usr/sbin/
endef endef
install-dev: $(PKG_BUILD_DIR)/.built define Build/InstallDev
mkdir -p $(STAGING_DIR)/usr/{lib,include} mkdir -p $(STAGING_DIR)/usr/{lib,include}
$(CP) $(PKG_BUILD_DIR)/libiw.so* $(STAGING_DIR)/usr/lib/ $(CP) $(PKG_BUILD_DIR)/libiw.so* $(STAGING_DIR)/usr/lib/
ln -sf libiw.so.28 $(STAGING_DIR)/usr/lib/libiw.so ln -sf libiw.so.28 $(STAGING_DIR)/usr/lib/libiw.so
$(CP) $(PKG_BUILD_DIR)/{iwlib,wireless}.h $(STAGING_DIR)/usr/include/ $(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/lib/libiw.*
rm -f $(STAGING_DIR)/usr/include/{iwlib,wireless}.h rm -f $(STAGING_DIR)/usr/include/{iwlib,wireless}.h
endef
$(eval $(call BuildPackage,wireless-tools))

View File

@ -20,7 +20,6 @@ include $(TOPDIR)/package/rules.mk
define Package/zlib define Package/zlib
SECTION:=base SECTION:=base
CATEGORY:=Libraries CATEGORY:=Libraries
DEFAULT:=n
TITLE:=Library implementing the deflate compression method TITLE:=Library implementing the deflate compression method
DESCRIPTION:=A library implementing the 'deflate' compression method DESCRIPTION:=A library implementing the 'deflate' compression method
URL:=http://www.zlib.net/ URL:=http://www.zlib.net/

View File

@ -5,6 +5,7 @@ my $name;
my $src; my $src;
my $makefile; my $makefile;
my %pkg; my %pkg;
my %dep;
my $line; my $line;
while ($line = <>) { while ($line = <>) {
@ -19,8 +20,12 @@ while ($line = <>) {
$pkg{$name}->{src} = $src; $pkg{$name}->{src} = $src;
}; };
$line =~ /^(Build-)?Depends: \s*(.+)\s*$/ and do { $line =~ /^(Build-)?Depends: \s*(.+)\s*$/ and do {
my @dep = split /,\s*/, $2; $pkg{$name}->{depends} ||= [];
$pkg{$name}->{depends} = \@dep; 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 $hasdeps = 0;
my $depline = ""; my $depline = "";
foreach my $dep (@{$pkg{$name}->{depends}}) { foreach my $dep (@{$pkg{$name}->{depends}}) {
my $idx;
if (defined $pkg{$dep}->{src} && $pkg{$name}->{src} ne $pkg{$dep}->{src}) { 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 "") { if ($depline ne "") {

View File

@ -26,7 +26,12 @@ sub print_category($) {
print "\t\ttristate \"$title\"\n"; print "\t\ttristate \"$title\"\n";
print "\t\tdefault ".$pkg->{default}."\n"; print "\t\tdefault ".$pkg->{default}."\n";
foreach my $depend (@{$pkg->{depends}}) { 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 "\t\thelp\n";
print $pkg->{description}; print $pkg->{description};
@ -60,7 +65,7 @@ while ($line = <>) {
$line =~ /^Menu: \s*(.+)\s*$/ and $pkg->{menu} = $1; $line =~ /^Menu: \s*(.+)\s*$/ and $pkg->{menu} = $1;
$line =~ /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1; $line =~ /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1;
$line =~ /^Depends: \s*(.+)\s*$/ and do { $line =~ /^Depends: \s*(.+)\s*$/ and do {
my @dep = split /,\s*/, $1; my @dep = split /\s+/, $1;
$pkg->{depends} = \@dep; $pkg->{depends} = \@dep;
}; };
$line =~ /^Category: \s*(.+)\s*$/ and do { $line =~ /^Category: \s*(.+)\s*$/ and do {