Skip to contentSkip to conversation

Purge libglib2 dev files from target

PATCH New Malte Starostik 4 participants 13 messages Jul 22, 2010 – Jul 30, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Purge libglib2 dev files from target

* Don't install libglib2 development binaries and to target unless BR2_HAVE_DEVFILES is set
* Don't install gdb plugins unless BR2_TARGET_GDB is set
* Remove $(TARGET_DIR)/usr/share/aclocal from target-finalize when not installing devfiles
* Same for /usr/share/gdb in the absence of BR2_TARGET_GDB
* Remove some redundant cleanup from individual packages

---
 Makefile                          |    5 ++++-
 package/gettext/gettext.mk        |    2 --
 package/libglib2/libglib2.mk      |   20 ++++++++++++++++++++
 package/libxml2/libxml2.mk        |    3 +--
 package/multimedia/speex/speex.mk |    2 +-
 5 files changed, 26 insertions(+), 6 deletions(-)
Makefile +4 -1
index f6e02bc..0ee03b8 100644
@@ -395,10 +395,13 @@ target-finalize:
 ifeq ($(BR2_HAVE_DEVFILES),y)
 	( scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) )
 else
-	rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig
+	rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/aclocal
 	find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
 	find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
 endif
+ifneq ($(BR2_HAVE_PACKAGE_GDB),y)
+	rm -rf $(TARGET_DIR)/usr/share/gdb
+endif
 ifneq ($(BR2_HAVE_DOCUMENTATION),y)
 	rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
 	rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
package/gettext/gettext.mk +0 -2
index 80215c8..2b308c8 100644
@@ -135,8 +135,6 @@ gettext-dirclean:
 gettext-target: $(GETTEXT_DIR)/$(GETTEXT_BINARY)
 	$(MAKE) DESTDIR=$(TARGET_DIR) -C $(GETTEXT_DIR) install
 	chmod +x $(TARGET_DIR)/usr/lib/libintl.so* # identify as needing to be stripped
-	rm -rf $(addprefix $(TARGET_DIR),/usr/share/aclocal /usr/include/libintl.h)
-	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/include
 
 $(TARGET_DIR)/usr/lib/libintl.so: $(STAGING_DIR)/$(GETTEXT_TARGET_BINARY)
 	cp -dpf $(STAGING_DIR)/usr/lib/libgettext*.so* \
package/libglib2/libglib2.mk +20 -0
index 43b1a89..d7cd828 100644
@@ -68,6 +68,26 @@ LIBGLIB2_CONF_OPT += --with-libiconv=gnu
 LIBGLIB2_DEPENDENCIES+=libiconv
 endif
 
+define LIBGLIB2_REMOVE_DEV_FILES
+	rm -rf $(TARGET_DIR)/usr/lib/glib-2.0
+	rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gettext
+	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/glib-2.0
+	rm -f $(addprefix $(TARGET_DIR)/usr/bin/,glib-genmarshal glib-gettextize glib-mkenums gobject-query gtester gtester-report)
+endef
+
+ifneq ($(BR2_HAVE_DEVFILES),y)
+LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_DEV_FILES
+endif
+
+define LIBGLIB2_REMOVE_GDB_FILES
+	rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gdb
+	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/glib-2.0
+endef
+
+ifneq ($(BR2_PACKAGE_GDB),y)
+LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_GDB_FILES
+endif
+
 $(eval $(call AUTOTARGETS,package,libglib2))
 $(eval $(call AUTOTARGETS,package,libglib2,host))
 
package/libxml2/libxml2.mk +1 -2
index 3a3e007..8f25136 100644
@@ -34,8 +34,7 @@ $(eval $(call AUTOTARGETS,package,libxml2,host))
 $(LIBXML2_HOOK_POST_INSTALL):
 	$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/xml2-config
 	$(SED) "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/xml2-config
-	rm -rf $(TARGET_DIR)/usr/share/aclocal
 	touch $@
 
 # libxml2 for the host
-LIBXML2_HOST_BINARY:=$(HOST_DIR)/usr/bin/xmllint
\ No newline at end of file
+LIBXML2_HOST_BINARY:=$(HOST_DIR)/usr/bin/xmllint
package/multimedia/speex/speex.mk +1 -1
index 6943ad7..e246b24 100644
@@ -32,5 +32,5 @@ $(SPEEX_TARGET_BUILD): $(SPEEX_TARGET_CONFIGURE)
 	$(Q)touch $@
 
 $(SPEEX_HOOK_POST_INSTALL): $(SPEEX_TARGET_INSTALL_TARGET)
-	rm -rf $(TARGET_DIR)/usr/share/doc/speex $(TARGET_DIR)/usr/share/aclocal
+	rm -rf $(TARGET_DIR)/usr/share/doc/speex
 	touch $@
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 Purge libglib2 dev files from target

Le jeudi 22 juillet 2010 ? 11:03 +0200, Malte Starostik a ?crit :

Quoted 9 lines

* Don't install libglib2 development binaries and to target unless BR2_HAVE_DEVFILES is set
* Don't install gdb plugins unless BR2_TARGET_GDB is set
* Remove $(TARGET_DIR)/usr/share/aclocal from target-finalize when not installing devfiles
* Same for /usr/share/gdb in the absence of BR2_TARGET_GDB
* Remove some redundant cleanup from individual packages

Maybe you can split your patch in two. One part which would be related to strip the debug files, the second would be related to strip dev files (aclocal directories).

package/libglib2/libglib2.mk LIBGLIB2_CONF_OPT += --with-libiconv=gnu · line 86

Quoted 6 lines
package/libglib2/libglib2.mk +6 -0
+
+define LIBGLIB2_REMOVE_GDB_FILES
+	rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gdb
+	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/glib-2.0
+endef
+

Why using rmdir ? rm -rf isn't good enough ?

Otherwise looks good ! :)

Regards,

Signature · 1 line
Lionel Landwerlin
#2 lore raw

PATCH 1/1 Purge libglib2 dev files from target

Am Samstag, 24. Juli 2010, 03:46:44 schrieb Lionel Landwerlin:

Quoted 10 lines

Le jeudi 22 juillet 2010 ? 11:03 +0200, Malte Starostik a ?crit :

Quoted 9 lines

* Don't install libglib2 development binaries and to target unless

BR2_HAVE_DEVFILES is set

* Don't install gdb plugins unless BR2_TARGET_GDB is set
* Remove $(TARGET_DIR)/usr/share/aclocal from target-finalize when not

installing devfiles

Quoted 8 lines
Quoted 4 lines

* Same for /usr/share/gdb in the absence of BR2_TARGET_GDB
* Remove some redundant cleanup from individual packages

Maybe you can split your patch in two. One part which would be related to strip the debug files, the second would be related to strip dev files (aclocal directories).

New patch follows. Actually I split it into three to separate the devfiles part into a global and a libglib2 specific part.

Quoted 9 lines

package/libglib2/libglib2.mk LIBGLIB2_CONF_OPT += --with-libiconv=gnu · line 86

Quoted 7 lines
package/libglib2/libglib2.mk +6 -0
+
+define LIBGLIB2_REMOVE_GDB_FILES
+	rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gdb
+	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/glib-2.0
+endef
+

Why using rmdir ? rm -rf isn't good enough ?

Unset BR2_HAVE_DEVFILES => rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gettext
Unset BR2_TARGET_GDB => rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gdb
Both unset => rmdir the parent, too

Quoted 2 lines

Otherwise looks good ! :)

Thanks :)

Malte

#3 lore raw

PATCH 1/3 Globally remove aclocal directories from target

* Remove $(TARGET_DIR)/usr/share/aclocal from target-finalize when not installing devfiles and
* Remove some (now) redundant cleanup from individual packages

---
 Makefile                          |    2 +-
 package/gettext/gettext.mk        |    2 --
 package/libxml2/libxml2.mk        |    3 +--
 package/multimedia/speex/speex.mk |    2 +-
 4 files changed, 3 insertions(+), 6 deletions(-)
Makefile +1 -1
index f6e02bc..0123e97 100644
@@ -395,7 +395,7 @@ target-finalize:
 ifeq ($(BR2_HAVE_DEVFILES),y)
 	( scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) )
 else
-	rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig
+	rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/aclocal
 	find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
 	find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
 endif
package/gettext/gettext.mk +0 -2
index 80215c8..2b308c8 100644
@@ -135,8 +135,6 @@ gettext-dirclean:
 gettext-target: $(GETTEXT_DIR)/$(GETTEXT_BINARY)
 	$(MAKE) DESTDIR=$(TARGET_DIR) -C $(GETTEXT_DIR) install
 	chmod +x $(TARGET_DIR)/usr/lib/libintl.so* # identify as needing to be stripped
-	rm -rf $(addprefix $(TARGET_DIR),/usr/share/aclocal /usr/include/libintl.h)
-	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/include
 
 $(TARGET_DIR)/usr/lib/libintl.so: $(STAGING_DIR)/$(GETTEXT_TARGET_BINARY)
 	cp -dpf $(STAGING_DIR)/usr/lib/libgettext*.so* \
package/libxml2/libxml2.mk +1 -2
index 3a3e007..8f25136 100644
@@ -34,8 +34,7 @@ $(eval $(call AUTOTARGETS,package,libxml2,host))
 $(LIBXML2_HOOK_POST_INSTALL):
 	$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/xml2-config
 	$(SED) "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/xml2-config
-	rm -rf $(TARGET_DIR)/usr/share/aclocal
 	touch $@
 
 # libxml2 for the host
-LIBXML2_HOST_BINARY:=$(HOST_DIR)/usr/bin/xmllint
\ No newline at end of file
+LIBXML2_HOST_BINARY:=$(HOST_DIR)/usr/bin/xmllint
package/multimedia/speex/speex.mk +1 -1
index 6943ad7..e246b24 100644
@@ -32,5 +32,5 @@ $(SPEEX_TARGET_BUILD): $(SPEEX_TARGET_CONFIGURE)
 	$(Q)touch $@
 
 $(SPEEX_HOOK_POST_INSTALL): $(SPEEX_TARGET_INSTALL_TARGET)
-	rm -rf $(TARGET_DIR)/usr/share/doc/speex $(TARGET_DIR)/usr/share/aclocal
+	rm -rf $(TARGET_DIR)/usr/share/doc/speex
 	touch $@
Signature · 1 line
1.7.1
#4 lore raw

PATCH 1/3 Globally remove aclocal directories from target

Quoted 5 lines · On Sat, 24 Jul 2010 13:21:12 +0200 Malte Starostik <[email protected]>…

* Remove $(TARGET_DIR)/usr/share/aclocal from target-finalize when not installing devfiles and
* Remove some (now) redundant cleanup from individual packages

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#5 lore raw

PATCH 1/3 Globally remove aclocal directories from target

In reply to Malte Starostik
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Malte" == Malte Starostik <[email protected]> writes:

Malte> * Remove $(TARGET_DIR)/usr/share/aclocal from target-finalize when not
Malte> installing devfiles and
Malte> * Remove some (now) redundant cleanup from individual packages

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw

PATCH 2/3 Purge libglib2 dev files from target

In reply to Malte Starostik

* Don't install libglib2 development binaries and to target unless BR2_HAVE_DEVFILES is set

---
 package/libglib2/libglib2.mk |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
package/libglib2/libglib2.mk +11 -0
index 43b1a89..6a43829 100644
@@ -68,6 +68,17 @@ LIBGLIB2_CONF_OPT += --with-libiconv=gnu
 LIBGLIB2_DEPENDENCIES+=libiconv
 endif
 
+define LIBGLIB2_REMOVE_DEV_FILES
+	rm -rf $(TARGET_DIR)/usr/lib/glib-2.0
+	rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gettext
+	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/glib-2.0
+	rm -f $(addprefix $(TARGET_DIR)/usr/bin/,glib-genmarshal glib-gettextize glib-mkenums gobject-query gtester gtester-report)
+endef
+
+ifneq ($(BR2_HAVE_DEVFILES),y)
+LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_DEV_FILES
+endif
+
 $(eval $(call AUTOTARGETS,package,libglib2))
 $(eval $(call AUTOTARGETS,package,libglib2,host))
 
Signature · 1 line
1.7.1
#7 lore raw

PATCH 2/3 Purge libglib2 dev files from target

Quoted 4 lines · On Sat, 24 Jul 2010 13:21:13 +0200 Malte Starostik <[email protected]>…

* Don't install libglib2 development binaries and to target unless BR2_HAVE_DEVFILES is set

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#8 lore raw

PATCH 2/3 Purge libglib2 dev files from target

In reply to Malte Starostik
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Malte" == Malte Starostik <[email protected]> writes:

Malte> * Don't install libglib2 development binaries and to target unless
Malte> BR2_HAVE_DEVFILES is set

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#9 lore raw

PATCH 3/3 Remove gdb plugins from target

In reply to Malte Starostik

* Don't install gdb plugins unless BR2_TARGET_GDB is set

---
 Makefile                     |    3 +++
 package/libglib2/libglib2.mk |    9 +++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)
Makefile +3 -0
index 0123e97..0ee03b8 100644
@@ -399,6 +399,9 @@ else
 	find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
 	find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
 endif
+ifneq ($(BR2_HAVE_PACKAGE_GDB),y)
+	rm -rf $(TARGET_DIR)/usr/share/gdb
+endif
 ifneq ($(BR2_HAVE_DOCUMENTATION),y)
 	rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
 	rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
package/libglib2/libglib2.mk +9 -0
index 6a43829..d7cd828 100644
@@ -79,6 +79,15 @@ ifneq ($(BR2_HAVE_DEVFILES),y)
 LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_DEV_FILES
 endif
 
+define LIBGLIB2_REMOVE_GDB_FILES
+	rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gdb
+	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/glib-2.0
+endef
+
+ifneq ($(BR2_PACKAGE_GDB),y)
+LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_GDB_FILES
+endif
+
 $(eval $(call AUTOTARGETS,package,libglib2))
 $(eval $(call AUTOTARGETS,package,libglib2,host))
 
Signature · 1 line
1.7.1
#10 lore raw

PATCH 3/3 Remove gdb plugins from target

Quoted 1 line · On Sat, 24 Jul 2010 13:21:14 +0200 Malte Starostik <[email protected]>…

+ifneq ($(BR2_HAVE_PACKAGE_GDB),y)

This option does not exist. It should probably be BR2_PACKAGE_GDB.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#11 lore raw

PATCH 1/1 Remove gdb plugins from target

* Don't install gdb plugins unless BR2_TARGET_GDB is set

---
 Makefile                     |    3 +++
 package/libglib2/libglib2.mk |    9 +++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)
Makefile +3 -0
index 0123e97..f8af6bd 100644
@@ -399,6 +399,9 @@ else
 	find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
 	find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
 endif
+ifneq ($(BR2_PACKAGE_GDB),y)
+	rm -rf $(TARGET_DIR)/usr/share/gdb
+endif
 ifneq ($(BR2_HAVE_DOCUMENTATION),y)
 	rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
 	rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
package/libglib2/libglib2.mk +9 -0
index 6a43829..d7cd828 100644
@@ -79,6 +79,15 @@ ifneq ($(BR2_HAVE_DEVFILES),y)
 LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_DEV_FILES
 endif
 
+define LIBGLIB2_REMOVE_GDB_FILES
+	rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gdb
+	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/glib-2.0
+endef
+
+ifneq ($(BR2_PACKAGE_GDB),y)
+LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_GDB_FILES
+endif
+
 $(eval $(call AUTOTARGETS,package,libglib2))
 $(eval $(call AUTOTARGETS,package,libglib2,host))
 
Signature · 1 line
1.7.1
#12 lore raw

PATCH 1/1 Remove gdb plugins from target

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Malte" == Malte Starostik <[email protected]> writes:

Malte> * Don't install gdb plugins unless BR2_TARGET_GDB is set Malte> Signed-off-by: Malte Starostik <[email protected]>

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard