Skip to contentSkip to conversation

target-finalize: remove extra /usr/libexec/*.a and *.la files

PATCH New Herve Codina 2 participants 3 messages Sep 15, 2015 – Sep 21, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-finalize: remove extra /usr/libexec/*.a and *.la files

Some packages, sudo for instance, install .la files in $(TARGET_DIR)/usr/libexec. These files are not needed on target.

This patch simply removes *.a and *.la files from $(TARGET_DIR)/usr/libexec if it exists

---
 Makefile |    3 +++
 1 file changed, 3 insertions(+)
Makefile +3 -0
index 23e2ee6..9bf5fbc 100644
@@ -565,6 +565,9 @@ target-finalize: $(PACKAGES)
 	find $(TARGET_DIR)/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f
 	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
+	if test -d $(TARGET_DIR)/usr/libexec; then \
+		find $(TARGET_DIR)/usr/libexec \( -name '*.a' -o -name '*.la' \) -print0 | \
+		xargs -0 rm -f; fi
 ifneq ($(BR2_PACKAGE_GDB),y)
 	rm -rf $(TARGET_DIR)/usr/share/gdb
 endif
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 target-finalize: remove extra /usr/libexec/*.a and *.la files

Herve,

Quoted 4 lines · Herve Codina

Some packages, sudo for instance, install .la files in $(TARGET_DIR)/usr/libexec. These files are not needed on target.

This patch simply removes *.a and *.la files from $(TARGET_DIR)/usr/libexec if it exists

I initially hesitated a bit first, because normally, plugins should be installed in /usr/lib/<package>/. This can be done with --with-plugindir, which moves a certain number of files installed by default in /usr/libexec, but there are still a few libraries here nonetheless. So your approach seems better.

Makefile target-finalize: $(PACKAGES) · line 570

Quoted 7 lines
Makefile +3 -0
@@ -565,6 +565,9 @@ target-finalize: $(PACKAGES)
 	find $(TARGET_DIR)/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f
 	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
+	if test -d $(TARGET_DIR)/usr/libexec; then \
+		find $(TARGET_DIR)/usr/libexec \( -name '*.a' -o -name '*.la' \) -print0 | \
+		xargs -0 rm -f; fi

I've simplified that into a single "find" invocation for lib/, usr/lib and usr/libexec.

See
http://git.buildroot.net/buildroot/commit/?id=87f3edecc65975085982515f3618c81bcfd9c023

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com