diff mbox

Depend autotools targets on host-ccache when BR2_CCACHE is enabled.

Message ID 201209061737.32826.rasasi78@gmail.com
State Rejected
Headers show

Commit Message

Raúl Sánchez Siles Sept. 6, 2012, 3:37 p.m. UTC
In this case, autotools targets rely on $(TARGET_CONFIGURE_OPTS) which includes
ccached compiler.

Signed-off-by: Raúl Sánchez Siles <rasasi78@gmail.com>
---
 package/pkg-autotools.mk |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Samuel Martin May 26, 2013, 3:12 p.m. UTC | #1
Hi Raul,

2012/9/6 Raúl Sánchez Siles <rasasi78@gmail.com>:
> In this case, autotools targets rely on $(TARGET_CONFIGURE_OPTS) which includes
> ccached compiler.
>
> Signed-off-by: Raúl Sánchez Siles <rasasi78@gmail.com>
> ---
>  package/pkg-autotools.mk |    4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
> index 785daab..e858ffc 100644
> --- a/package/pkg-autotools.mk
> +++ b/package/pkg-autotools.mk
> @@ -200,6 +200,10 @@ $(2)_PRE_CONFIGURE_HOOKS += AUTORECONF_HOOK
>  $(2)_DEPENDENCIES += host-automake host-autoconf host-libtool
>  endif
>
> +ifeq ($(BR2_CCACHE),y)
> +$(2)_DEPENDENCIES += host-ccache
> +endif
> +

This should not be necessary since host-ccache is added to the
BASE_TARGETS list in the Makefile at the root of buildroot.

Anyway, what was the issue and the 'make ...' call sequence that lead to it?

Regards,
Thomas Petazzoni May 26, 2013, 3:44 p.m. UTC | #2
Dear Samuel Martin,

On Sun, 26 May 2013 17:12:16 +0200, Samuel Martin wrote:

> This should not be necessary since host-ccache is added to the
> BASE_TARGETS list in the Makefile at the root of buildroot.

Maybe:

	make menuconfig
	make <somepackage>

i.e, not starting the complete build, but just the build of a given
package?

Thomas
Thomas Petazzoni May 26, 2013, 5 p.m. UTC | #3
Samuel,

On Sun, 26 May 2013 17:44:06 +0200, Thomas Petazzoni wrote:
> Dear Samuel Martin,
> 
> On Sun, 26 May 2013 17:12:16 +0200, Samuel Martin wrote:
> 
> > This should not be necessary since host-ccache is added to the
> > BASE_TARGETS list in the Makefile at the root of buildroot.
> 
> Maybe:
> 
> 	make menuconfig
> 	make <somepackage>
> 
> i.e, not starting the complete build, but just the build of a given
> package?

See also https://bugs.busybox.net/show_bug.cgi?id=5678, which seems to
be related.

Thomas
Samuel Martin May 26, 2013, 5:44 p.m. UTC | #4
Thomas, all,

2013/5/26 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
> Samuel,
>
> On Sun, 26 May 2013 17:44:06 +0200, Thomas Petazzoni wrote:
>> Dear Samuel Martin,
>>
>> On Sun, 26 May 2013 17:12:16 +0200, Samuel Martin wrote:
>>
>> > This should not be necessary since host-ccache is added to the
>> > BASE_TARGETS list in the Makefile at the root of buildroot.
>>
>> Maybe:
>>
>>       make menuconfig
>>       make <somepackage>
>>
>> i.e, not starting the complete build, but just the build of a given
>> package?
>
> See also https://bugs.busybox.net/show_bug.cgi?id=5678, which seems to
> be related.
Right.

In these cases, I rather suggest to build either a whole "small"
config, or at least the toolchain
before tweaking anything (packages, kernel or bootloader).

Note that if we want to allow this use case, it may require adding BASE_TARGETS
to all *-menuconfig and packages' targets.

I think we don't want to go this way.

Regards,
Thomas Petazzoni May 26, 2013, 5:48 p.m. UTC | #5
Dear Samuel Martin,

On Sun, 26 May 2013 19:44:33 +0200, Samuel Martin wrote:

> In these cases, I rather suggest to build either a whole "small"
> config, or at least the toolchain
> before tweaking anything (packages, kernel or bootloader).
> 
> Note that if we want to allow this use case, it may require adding BASE_TARGETS
> to all *-menuconfig and packages' targets.
> 
> I think we don't want to go this way.

Being able to do "make linux-menuconfig" right after "make menuconfig"
is a quite important use case, IMO. We should support that I believe.

linux-menuconfig already depends on "dirs" so that it can work properly
when ran after "make menuconfig" (when ccache is not enabled). But I
see that it also depends on linux-configure. Maybe we just need to make
the *-extract of all packages depend on $(BASE_TARGETS) or something
like that?

Thomas
Samuel Martin May 26, 2013, 8:37 p.m. UTC | #6
Thomas,

2013/5/26 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
> Dear Samuel Martin,
>
> On Sun, 26 May 2013 19:44:33 +0200, Samuel Martin wrote:
>
>> In these cases, I rather suggest to build either a whole "small"
>> config, or at least the toolchain
>> before tweaking anything (packages, kernel or bootloader).
>>
>> Note that if we want to allow this use case, it may require adding BASE_TARGETS
>> to all *-menuconfig and packages' targets.
>>
>> I think we don't want to go this way.
>
> Being able to do "make linux-menuconfig" right after "make menuconfig"
> is a quite important use case, IMO. We should support that I believe.
>
> linux-menuconfig already depends on "dirs" so that it can work properly
> when ran after "make menuconfig" (when ccache is not enabled). But I
> see that it also depends on linux-configure. Maybe we just need to make
> the *-extract of all packages depend on $(BASE_TARGETS) or something
> like that?
>
Indeed, something like that seems doing the tricks :)

I'll cook a patch and submit it.

Regards,
diff mbox

Patch

diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
index 785daab..e858ffc 100644
--- a/package/pkg-autotools.mk
+++ b/package/pkg-autotools.mk
@@ -200,6 +200,10 @@  $(2)_PRE_CONFIGURE_HOOKS += AUTORECONF_HOOK
 $(2)_DEPENDENCIES += host-automake host-autoconf host-libtool
 endif
 
+ifeq ($(BR2_CCACHE),y)
+$(2)_DEPENDENCIES += host-ccache
+endif
+
 #
 # Build step. Only define it if not already defined by the package .mk
 # file.