infrastructure: only require download tools when needed
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 24 Dec 2010 14:57:29 +0000 (15:57 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 24 Dec 2010 16:48:26 +0000 (17:48 +0100)
Instead of having to require svn, git or bzr unconditionally, only
require them when one package needs them to be downloaded.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/Makefile.package.in
toolchain/dependencies/dependencies.mk
toolchain/dependencies/dependencies.sh

index 428dbcbb5778e1e7a8afda640d37f565af27bcb8..c4a1cf8ee1563b21df2fed12cabe46310a9eb03c 100644 (file)
@@ -504,9 +504,19 @@ $$($(2)_TARGET_DIRCLEAN):          PKG=$(2)
 # configuration
 
 ifeq ($$(BR2_PACKAGE_$(2)),y)
+
 TARGETS += $(1)
-endif
-endef
+
+ifeq ($$($(2)_SITE_METHOD),svn)
+DL_TOOLS_DEPENDENCIES += svn
+else ifeq ($$($(2)_SITE_METHOD),git)
+DL_TOOLS_DEPENDENCIES += git
+else ifeq ($$($(2)_SITE_METHOD),bzr)
+DL_TOOLS_DEPENDENCIES += bzr
+endif # SITE_METHOD
+
+endif # BR2_PACKAGE_$(2)
+endef # GENTARGETS_INNER
 
 ################################################################################
 # GENTARGETS -- the target generator macro for generic packages
index 89ffd882301d55f922ccf8a459a82e41f8fce761..13604f092c654bab2cd3e15dc4d628491b4db607 100644 (file)
@@ -10,9 +10,16 @@ ifeq ($(BR2_STRIP_sstrip),y)
 DEPENDENCIES_HOST_PREREQ+=sstrip_host
 endif
 
+# Remove duplicate entries from $(DL_TOOLS_DEPENDENCIES)
+DL_TOOLS = \
+       $(findstring svn,$(DL_TOOLS_DEPENDENCIES)) \
+       $(findstring git,$(DL_TOOLS_DEPENDENCIES)) \
+       $(findstring bzr,$(DL_TOOLS_DEPENDENCIES))
+
 dependencies: $(DEPENDENCIES_HOST_PREREQ)
        @HOSTCC="$(firstword $(HOSTCC))" MAKE="$(MAKE)" \
                CONFIG_FILE="$(CONFIG_DIR)/.config" \
+               DL_TOOLS="$(DL_TOOLS)" \
                $(TOPDIR)/toolchain/dependencies/dependencies.sh
 
 dependencies-source:
index a152d4b8cc9e4682b112a970ebd57a5674cc87e5..c5552cae0f6685aff567301b6c3dedb200b97410 100755 (executable)
@@ -132,7 +132,7 @@ if ! $SHELL --version 2>&1 | grep -q '^GNU bash'; then
 fi;
 
 # Check that a few mandatory programs are installed
-for prog in awk bison flex msgfmt makeinfo patch gzip bzip2 perl tar wget cpio python svn unzip ; do
+for prog in awk bison flex msgfmt makeinfo patch gzip bzip2 perl tar wget cpio python unzip ${DL_TOOLS} ; do
     if ! which $prog > /dev/null ; then
        /bin/echo -e "\nYou must install '$prog' on your build machine";
        if test $prog = "makeinfo" ; then