diff mbox

package/gauche: remove unnecessary files for target, fix a typo

Message ID 201511100922.tAA9Ml77000486@ms-omx02.plus.so-net.ne.jp
State Rejected
Headers show

Commit Message

kei-k@ca2.so-net.ne.jp Nov. 10, 2015, 9:22 a.m. UTC
Signed-off-by: Hiroshi Kawashima <kei-k@ca2.so-net.ne.jp>
---
============================================================
    Hiroshi Kawashima

Comments

Thomas Petazzoni Nov. 10, 2015, 9:48 a.m. UTC | #1
Hiroshi,

On Tue, 10 Nov 2015 18:22:47 +0900, Hiroshi Kawashima wrote:
> Signed-off-by: Hiroshi Kawashima <kei-k@ca2.so-net.ne.jp>

Thanks for this patch. Also, I think you should have a look at the
autobuilder failures for gauche, it fails to build in a number of
situations. See:

   http://autobuild.buildroot.org/?reason=gauche-0.9.4

Some cases are due to unsupported architecture (example: xtensa), some
cases are due to the external libatomic_ops being built before gauche,
and therefore used by gauche instead of its internal copy, causing some
build failures, etc.

Best regards,

Thomas
kei-k@ca2.so-net.ne.jp Nov. 10, 2015, 10:21 a.m. UTC | #2
Dear Thomas.

> 2015/11/10 18:48、Thomas Petazzoni <thomas.petazzoni@free-electrons.com> のメール:
> 
> Hiroshi,
> 
> On Tue, 10 Nov 2015 18:22:47 +0900, Hiroshi Kawashima wrote:
>> Signed-off-by: Hiroshi Kawashima <kei-k@ca2.so-net.ne.jp>
> 
> Thanks for this patch. Also, I think you should have a look at the
> autobuilder failures for gauche, it fails to build in a number of
> situations. See:
> 
>   http://autobuild.buildroot.org/?reason=gauche-0.9.4
> 
> Some cases are due to unsupported architecture (example: xtensa), some
> cases are due to the external libatomic_ops being built before gauche,
> and therefore used by gauche instead of its internal copy, causing some
> build failures, etc.
> 
Sure.
Most problems seems to be architectures that boehm gc not ported.
Would you suggest how can I control these case in Config.in ?
(eg. gauche is not supported on xtensa, disable selecting gauche package
for xtensa architecture).

Regards,
Kawashima

> Best regards,
> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
Thomas Petazzoni Nov. 10, 2015, 10:42 a.m. UTC | #3
Hiroshi,

On Tue, 10 Nov 2015 19:21:26 +0900, Hiroshi Kawashima wrote:

> Most problems seems to be architectures that boehm gc not ported.

Indeed. First thing would be to see if gauche can used an external
boehm gc implementation rather than its own. Indeed, we already have a
package for boehm gc in package/bdwgc/.

And this package is only built for architectures where libatomic_ops is
available.

> Would you suggest how can I control these case in Config.in ?
> (eg. gauche is not supported on xtensa, disable selecting gauche package
> for xtensa architecture).

If you can use the bdwgc package, then please do so, and you will have
to add in gauche/Config.in "depends on
BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS" which should make most of the
architecture specific problems disappear.

If you cannot use the bdwgc package, then just add some architecture
dependencies in gauche/Config.in, probably in the form of:

config BR2_PACKAGE_GAUCHE_ARCH_SUPPORTS
	bool
	default y if BR2_arm || BR2_i386 || ...

config BR2_PACKAGE_GAUCHE
	bool "gauche"
	depends on BR2_PACKAGE_GAUCHE_ARCH_SUPPORTS

comment "gauche needs ..."
	depends on BR2_PACKAGE_GAUCHE_ARCH_SUPPORTS

Best regards,

Thomas
kei-k@ca2.so-net.ne.jp Nov. 10, 2015, 11:59 a.m. UTC | #4
Dear Thomas.

> 2015/11/10 19:42、Thomas Petazzoni <thomas.petazzoni@free-electrons.com> のメール:
> 
> Hiroshi,
> 
> On Tue, 10 Nov 2015 19:21:26 +0900, Hiroshi Kawashima wrote:
> 
>> Most problems seems to be architectures that boehm gc not ported.
> 
> Indeed. First thing would be to see if gauche can used an external
> boehm gc implementation rather than its own. Indeed, we already have a
> package for boehm gc in package/bdwgc/.
> 
> And this package is only built for architectures where libatomic_ops is
> available.

I didn’t note buildroot already have external boehm gc package.
Ok, I will try, thank you.

As last resort, I will limit architecture to be built as you indicated.

Regards,
Kawashima
Arnout Vandecappelle Nov. 10, 2015, 8:54 p.m. UTC | #5
Hi Hiroshi,

 The subject line is a bit long, you could make it:

package/gauche: remove unnecessary files for target

While we're at it, also fix a typo.



On 10-11-15 10:22, Hiroshi Kawashima wrote:
> Signed-off-by: Hiroshi Kawashima <kei-k@ca2.so-net.ne.jp>
> ---
> diff --git a/package/gauche/gauche.mk b/package/gauche/gauche.mk
> index b887c6a..8406774 100644
> --- a/package/gauche/gauche.mk
> +++ b/package/gauche/gauche.mk
> @@ -4,7 +4,8 @@
>  #
>  ################################################################################
>  
> -GAUCHE_VERSION = 0.9.4
> +GAUCHE_VERSION_MAJOR = 0.9
> +GAUCHE_VERSION = $(GAUCHE_VERSION_MAJOR).4
>  GAUCHE_SOURCE = Gauche-$(GAUCHE_VERSION).tgz
>  GAUCHE_SITE = http://downloads.sourceforge.net/project/gauche/Gauche
>  GAUCHE_LICENSE = BSD-3c, Boehm-gc, SRFI (srfi-11.scm), reload (reload.scm)
> @@ -23,10 +24,24 @@ endif
>  # Detection of c99 support in configure fails without WCHAR. To enable
>  # automatic detection of c99 support by configure, we need to enable
>  # WCHAR in toolchain. But actually we do not need WCHAR at gauche
> -# runtime. So reuesting WCHAR in toolchain just for automatic detection
> +# runtime. So requesting WCHAR in toolchain just for automatic detection
>  # will be overkill. To solve this, explicitly -std=gnu99 is specified
>  # here.
>  GAUCHE_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
>  
> +define GAUCHE_REMOVE_UNNEEDED
> +	for i in gauche-config gauche-install gauche-package ; do \
> +		rm -f $(TARGET_DIR)/usr/bin/$$i ; \
> +		rm -f $(TARGET_DIR)/usr/lib/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/$(GNU_TARGET_NAME)/$$i ; \
> +	done
> +	for i in gencomp genstub precomp ; do \
> +		rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/lib/$$i ; \
> +	done
> +	rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/aclocal.m4
> +	rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/template.*
> +	rm -fr $(TARGET_DIR)/usr/lib/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/include

 This cleanup is quite complicated and I wonder if it is really worth it. For
space, the impact is really small compared to the 3MB of libs and .scm files
installed by the package. Even the ones in /usr/bin I'm not sure if it's worth
to remove them.

 Thomas, what do you think?

 Regards,
 Arnout

> +endef
> +GAUCHE_POST_INSTALL_TARGET_HOOKS += GAUCHE_REMOVE_UNNEEDED
> +
>  $(eval $(host-autotools-package))
>  $(eval $(autotools-package))
> ============================================================
>     Hiroshi Kawashima
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
Thomas Petazzoni Nov. 11, 2015, 1:24 p.m. UTC | #6
Hiroshi,

On Wed, 11 Nov 2015 22:11:04 +0900, Hiroshi Kawashima wrote:

> 2015-11-11 12:36:54	xtensa		gc not ported

Right, exclude this architecture.

> 2015-11-10 23:30:21	powerpc		./libgauche-0.9.so: undefined reference to `getcontext'

This probably only happens with certain C libraries only. Check if this
build failure occurs with uClibc or glibc, probably only with uClibc.

> 2015-11-10 23:11:45	arc		gc not ported

Right, exclude this architecture as well.

> 2015-11-10 22:20:21	powerpc		./libgauche-0.9.so: undefined reference to `getcontext'
> 2015-11-10 17:30:19	arc		gc not ported
> 2015-11-10 14:16:58	sh4		./libgauche-0.9.so: undefined reference to `getcontext'
> 2015-11-10 08:46:51	powerpc		./libgauche-0.9.so: undefined reference to `getcontext'
> 2015-11-10 04:28:00	arm		./libgauche-0.9.so: undefined reference to `AO_pt_lock'

This is what happens when libatomic_ops is built before gauche. In this
case, gauche tries to use the external libatomic_ops instead of its
internal one.

As I already suggested to fix this, you have two options:

 (1) Understand why using the external libatomic_ops doesn't work and
     fix it.

 (2) Pass a configure option to gauche to force it to use its internal
     version of libatomic_ops.

I'd prefer (1), but we can live with (2) if (1) is too complicated.

> 2015-11-10 00:00:05	arm		./include/private/../gc_pthread_redirects.h:37:22: fatal error: dlfcn.h: No such file or directory

Two options here:

 (1) boehm gc in gauche supports the GC_NO_DLOPEN like the official
     boehm gc. In this case, pass -DGC_NO_DLOPEN when
     BR2_STATIC_LIBS=y. See bdwgc.mk for an example.

 (2) Make gauche depend on !BR2_STATIC_LIBS.

Thanks,

Thomas
Thomas Petazzoni Nov. 11, 2015, 1:59 p.m. UTC | #7
Arnout, Hiroshi,

On Tue, 10 Nov 2015 21:54:35 +0100, Arnout Vandecappelle wrote:

> > +define GAUCHE_REMOVE_UNNEEDED
> > +	for i in gauche-config gauche-install gauche-package ; do \
> > +		rm -f $(TARGET_DIR)/usr/bin/$$i ; \
> > +		rm -f $(TARGET_DIR)/usr/lib/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/$(GNU_TARGET_NAME)/$$i ; \
> > +	done
> > +	for i in gencomp genstub precomp ; do \
> > +		rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/lib/$$i ; \
> > +	done
> > +	rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/aclocal.m4
> > +	rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/template.*
> > +	rm -fr $(TARGET_DIR)/usr/lib/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/include
> 
>  This cleanup is quite complicated and I wonder if it is really worth it. For
> space, the impact is really small compared to the 3MB of libs and .scm files
> installed by the package. Even the ones in /usr/bin I'm not sure if it's worth
> to remove them.
> 
>  Thomas, what do you think?

I also think it is quite noisy, at least the way it is written. However
I like to have on the target only what's needed.

Hiroshi, do we really need to be so fine-grained when removing things?

Maybe we could do:

GAUCHE_FILES_TO_CLEANUP = \
	$(foreach p,gauche-config gauche-install gauche-package,\
		bin/$(p) lib/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/$(GNU_TARGET_NAME)/$(p)) \
	$(foreach p,gencomp genstub precomp,\
		share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/lib/$(p)) \
	share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/aclocal.m4 \
	share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/template.* \
	lib/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/include

And then use that variable:

	$(foreach p,$(GAUCHE_FILES_TO_CLEANUP),\
		$(RM) -rf $(TARGET_DIR)/usr/$(p)$(sep))

But it's not significantly better :/

Thomas
kei-k@ca2.so-net.ne.jp Nov. 11, 2015, 2:14 p.m. UTC | #8
Dear Thomas.

Thank you for your suggestion.
As you are maintainer, I will obey your opinion anyway.

But both approach is same 10 lines.
Just my preference is direct approach will have good readability if same size.

Regards,
Kawashima

> 2015/11/11 22:59、Thomas Petazzoni <thomas.petazzoni@free-electrons.com> のメール:
> 
> Arnout, Hiroshi,
> 
> On Tue, 10 Nov 2015 21:54:35 +0100, Arnout Vandecappelle wrote:
> 
>>> +define GAUCHE_REMOVE_UNNEEDED
>>> +	for i in gauche-config gauche-install gauche-package ; do \
>>> +		rm -f $(TARGET_DIR)/usr/bin/$$i ; \
>>> +		rm -f $(TARGET_DIR)/usr/lib/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/$(GNU_TARGET_NAME)/$$i ; \
>>> +	done
>>> +	for i in gencomp genstub precomp ; do \
>>> +		rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/lib/$$i ; \
>>> +	done
>>> +	rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/aclocal.m4
>>> +	rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/template.*
>>> +	rm -fr $(TARGET_DIR)/usr/lib/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/include
>> 
>> This cleanup is quite complicated and I wonder if it is really worth it. For
>> space, the impact is really small compared to the 3MB of libs and .scm files
>> installed by the package. Even the ones in /usr/bin I'm not sure if it's worth
>> to remove them.
>> 
>> Thomas, what do you think?
> 
> I also think it is quite noisy, at least the way it is written. However
> I like to have on the target only what's needed.
> 
> Hiroshi, do we really need to be so fine-grained when removing things?
> 
> Maybe we could do:
> 
> GAUCHE_FILES_TO_CLEANUP = \
> 	$(foreach p,gauche-config gauche-install gauche-package,\
> 		bin/$(p) lib/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/$(GNU_TARGET_NAME)/$(p)) \
> 	$(foreach p,gencomp genstub precomp,\
> 		share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/lib/$(p)) \
> 	share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/aclocal.m4 \
> 	share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/template.* \
> 	lib/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/include
> 
> And then use that variable:
> 
> 	$(foreach p,$(GAUCHE_FILES_TO_CLEANUP),\
> 		$(RM) -rf $(TARGET_DIR)/usr/$(p)$(sep))
> 
> But it's not significantly better :/
> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Arnout Vandecappelle Nov. 11, 2015, 2:29 p.m. UTC | #9
On 11-11-15 15:14, Hiroshi Kawashima wrote:
> Dear Thomas.
> 
> Thank you for your suggestion.
> As you are maintainer, I will obey your opinion anyway.
> 
> But both approach is same 10 lines.
> Just my preference is direct approach will have good readability if same size.

 I agree that your approach is better readable. I personally like make
constructs but shell is for most people clearer.

 Regards,
 Arnout

[snip]
kei-k@ca2.so-net.ne.jp Nov. 11, 2015, 2:35 p.m. UTC | #10
Dear Arnout.

Thank you!

> 2015/11/11 23:29、Arnout Vandecappelle <arnout@mind.be> のメール:
> 
> On 11-11-15 15:14, Hiroshi Kawashima wrote:
>> Dear Thomas.
>> 
>> Thank you for your suggestion.
>> As you are maintainer, I will obey your opinion anyway.
>> 
>> But both approach is same 10 lines.
>> Just my preference is direct approach will have good readability if same size.
> 
> I agree that your approach is better readable. I personally like make
> constructs but shell is for most people clearer.
> 
> Regards,
> Arnout
> 
> [snip]
> 
> -- 
> Arnout Vandecappelle                          arnout at mind be
> Senior Embedded Software Architect            +32-16-286500
> Essensium/Mind                                http://www.mind.be
> G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
> GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
Yann E. MORIN Nov. 29, 2015, 8:35 p.m. UTC | #11
Hiroshi, All,

On 2015-11-10 18:22 +0900, Hiroshi Kawashima spake thusly:
> Signed-off-by: Hiroshi Kawashima <kei-k@ca2.so-net.ne.jp>
> ---
> diff --git a/package/gauche/gauche.mk b/package/gauche/gauche.mk
> index b887c6a..8406774 100644
> --- a/package/gauche/gauche.mk
> +++ b/package/gauche/gauche.mk
> @@ -4,7 +4,8 @@
>  #
>  ################################################################################
>  
> -GAUCHE_VERSION = 0.9.4
> +GAUCHE_VERSION_MAJOR = 0.9
> +GAUCHE_VERSION = $(GAUCHE_VERSION_MAJOR).4
>  GAUCHE_SOURCE = Gauche-$(GAUCHE_VERSION).tgz
>  GAUCHE_SITE = http://downloads.sourceforge.net/project/gauche/Gauche
>  GAUCHE_LICENSE = BSD-3c, Boehm-gc, SRFI (srfi-11.scm), reload (reload.scm)
> @@ -23,10 +24,24 @@ endif
>  # Detection of c99 support in configure fails without WCHAR. To enable
>  # automatic detection of c99 support by configure, we need to enable
>  # WCHAR in toolchain. But actually we do not need WCHAR at gauche
> -# runtime. So reuesting WCHAR in toolchain just for automatic detection
> +# runtime. So requesting WCHAR in toolchain just for automatic detection
>  # will be overkill. To solve this, explicitly -std=gnu99 is specified
>  # here.
>  GAUCHE_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
>  
> +define GAUCHE_REMOVE_UNNEEDED
> +	for i in gauche-config gauche-install gauche-package ; do \
> +		rm -f $(TARGET_DIR)/usr/bin/$$i ; \
> +		rm -f $(TARGET_DIR)/usr/lib/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/$(GNU_TARGET_NAME)/$$i ; \
> +	done
> +	for i in gencomp genstub precomp ; do \
> +		rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/lib/$$i ; \
> +	done
> +	rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/aclocal.m4
> +	rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/template.*
> +	rm -fr $(TARGET_DIR)/usr/lib/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/include
> +endef
> +GAUCHE_POST_INSTALL_TARGET_HOOKS += GAUCHE_REMOVE_UNNEEDED

There's been some discussion around that patch, sorry for chiming in so
late...

Rather than remove what is not wanted, why not just install what is
required? If the number of actions to install is smaller than what we
try to remove, then maybe it is better.

What's your opinon? Do you think that it's achievable?

Regards,
Yann E. MORIN.

>  $(eval $(host-autotools-package))
>  $(eval $(autotools-package))
> ============================================================
>     Hiroshi Kawashima
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Thomas Petazzoni Dec. 24, 2015, 11:20 a.m. UTC | #12
Dear Hiroshi Kawashima,

On Tue, 10 Nov 2015 18:22:47 +0900, Hiroshi Kawashima wrote:
> Signed-off-by: Hiroshi Kawashima <kei-k@ca2.so-net.ne.jp>

After much discussion, I believe that the general consensus is that
this patch adds too much code/complexity for a not so important
benefit. So I've marked your patch as Rejected in our patch tracking
system.

Best regards,

Thomas
diff mbox

Patch

diff --git a/package/gauche/gauche.mk b/package/gauche/gauche.mk
index b887c6a..8406774 100644
--- a/package/gauche/gauche.mk
+++ b/package/gauche/gauche.mk
@@ -4,7 +4,8 @@ 
 #
 ################################################################################
 
-GAUCHE_VERSION = 0.9.4
+GAUCHE_VERSION_MAJOR = 0.9
+GAUCHE_VERSION = $(GAUCHE_VERSION_MAJOR).4
 GAUCHE_SOURCE = Gauche-$(GAUCHE_VERSION).tgz
 GAUCHE_SITE = http://downloads.sourceforge.net/project/gauche/Gauche
 GAUCHE_LICENSE = BSD-3c, Boehm-gc, SRFI (srfi-11.scm), reload (reload.scm)
@@ -23,10 +24,24 @@  endif
 # Detection of c99 support in configure fails without WCHAR. To enable
 # automatic detection of c99 support by configure, we need to enable
 # WCHAR in toolchain. But actually we do not need WCHAR at gauche
-# runtime. So reuesting WCHAR in toolchain just for automatic detection
+# runtime. So requesting WCHAR in toolchain just for automatic detection
 # will be overkill. To solve this, explicitly -std=gnu99 is specified
 # here.
 GAUCHE_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
 
+define GAUCHE_REMOVE_UNNEEDED
+	for i in gauche-config gauche-install gauche-package ; do \
+		rm -f $(TARGET_DIR)/usr/bin/$$i ; \
+		rm -f $(TARGET_DIR)/usr/lib/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/$(GNU_TARGET_NAME)/$$i ; \
+	done
+	for i in gencomp genstub precomp ; do \
+		rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/lib/$$i ; \
+	done
+	rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/aclocal.m4
+	rm -f $(TARGET_DIR)/usr/share/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/template.*
+	rm -fr $(TARGET_DIR)/usr/lib/gauche-$(GAUCHE_VERSION_MAJOR)/$(GAUCHE_VERSION)/include
+endef
+GAUCHE_POST_INSTALL_TARGET_HOOKS += GAUCHE_REMOVE_UNNEEDED
+
 $(eval $(host-autotools-package))
 $(eval $(autotools-package))