diff mbox

[1/1] package/pkg-autotools.mk: add host-m4 dependency

Message ID 1413570319-55465-1-git-send-email-kaszak@gmail.com
State Changes Requested
Headers show

Commit Message

Karoly Kasza Oct. 17, 2014, 6:25 p.m. UTC
host-autoconf depends on host-m4, which is not reflected in
package/pkg-autotools.mk. This obstructs "make source" from running
host-m4-source, making offline builds fail while trying to download
it before building host-autoconf.

Signed-off-by: Karoly Kasza <kaszak@gmail.com>
---
 package/pkg-autotools.mk |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Thomas Petazzoni Oct. 18, 2014, 1:24 p.m. UTC | #1
Dear Karoly Kasza,

On Fri, 17 Oct 2014 20:25:19 +0200, Karoly Kasza wrote:
> host-autoconf depends on host-m4, which is not reflected in
> package/pkg-autotools.mk. This obstructs "make source" from running
> host-m4-source, making offline builds fail while trying to download
> it before building host-autoconf.
> 
> Signed-off-by: Karoly Kasza <kaszak@gmail.com>
> ---
>  package/pkg-autotools.mk |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

The host-autoconf package already has a dependency on host-m4. See
package/autoconf/autoconf.mk:

HOST_AUTOCONF_DEPENDENCIES = host-m4 host-libtool

Maybe the problem you're seeing is that we're not expanding completely
the host dependencies:

# host-* dependencies have to be handled specially, as those aren't
# visible in Kconfig and hence not added to a variable like TARGETS.
# instead, find all the host-* targets listed in each <PKG>_DEPENDENCIES
# variable for each enabled target.
# Notice: this only works for newstyle gentargets/autotargets packages
TARGETS_HOST_DEPS = $(sort $(filter host-%,$(foreach dep,\
                $(addsuffix _DEPENDENCIES,\
                        $(call UPPERCASE,$(TARGETS) $(TARGETS_ROOTFS))),\
                $($(dep)))))
# Host packages can in turn have their own dependencies. Likewise find
# all the package names listed in the HOST_<PKG>_DEPENDENCIES for each
# host package found above. Ideally this should be done recursively until
# no more packages are found, but that's hard to do in make, so limit to
# 1 level for now.
HOST_DEPS = $(sort $(foreach dep,\
                $(addsuffix _DEPENDENCIES,$(call UPPERCASE,$(TARGETS_HOST_DEPS))),\
                $($(dep))))
HOST_SOURCE += $(addsuffix -source,$(sort $(TARGETS_HOST_DEPS) $(HOST_DEPS)))

I once drafted a solution for this, but never gotten around to
finishing it and submitting the patch. Something I (or someone) need to
work on at some point.

But in the mean time, the patch you're proposing is not correct, as
it's only work-arounding the problem, and fixes it only for on specific
use case.

Best regards,

Thomas
diff mbox

Patch

diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
index 2c93dd9..77bf696 100644
--- a/package/pkg-autotools.mk
+++ b/package/pkg-autotools.mk
@@ -248,7 +248,7 @@  endef
 # _DEPENDENCIES if _AUTORECONF is YES.  Also filter the result of _AUTORECONF
 # and _GETTEXTIZE away from the non-host rule
 ifeq ($(4),host)
-$(2)_DEPENDENCIES ?= $$(filter-out host-automake host-autoconf host-libtool \
+$(2)_DEPENDENCIES ?= $$(filter-out host-automake host-autoconf host-libtool host-m4 \
 				host-gettext host-toolchain $(1),\
     $$(patsubst host-host-%,host-%,$$(addprefix host-,$$($(3)_DEPENDENCIES))))
 endif
@@ -260,7 +260,7 @@  $(2)_PRE_CONFIGURE_HOOKS += GETTEXTIZE_HOOK
 $(2)_DEPENDENCIES += host-gettext
 endif
 $(2)_PRE_CONFIGURE_HOOKS += AUTORECONF_HOOK
-$(2)_DEPENDENCIES += host-automake host-autoconf host-libtool
+$(2)_DEPENDENCIES += host-automake host-autoconf host-libtool host-m4
 endif
 
 #