Commit cd2cac81 authored by Thomas Petazzoni's avatar Thomas Petazzoni
Browse files

attr: add patch to fix static installation



When attr is built static-only, it forgets to install its libattr.a
file, which leads to the build failure of packages such as 'acl' that
rely on attr.

Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: default avatarGustavo Zacarias <gustavo@zacarias.com.ar>
parent 24c5dbce
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
Support installation of .a file when doing static linking

When doing static linking (i.e ENABLE_SHARED != yes), the attr build
logic wasn't installing any library at all, not even the .a file which
is needed for static linking. This patch fixes that.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Index: b/include/buildmacros
===================================================================
--- a/include/buildmacros
+++ b/include/buildmacros
@@ -97,7 +97,15 @@
 
 INSTALL_LTLIB_STATIC = \
 	cd $(TOPDIR)/$(LIBNAME)/.libs; \
-	../$(INSTALL) -m 755 -d $(PKG_DEVLIB_DIR);
+	../$(INSTALL) -m 755 -d $(PKG_DEVLIB_DIR); \
+	../$(INSTALL) -m 644 -T old_lib $(LIBNAME).la $(PKG_DEVLIB_DIR); \
+	../$(INSTALL) -m 644 $(LIBNAME).la $(PKG_DEVLIB_DIR)/$(LIBNAME).la ; \
+	../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
+	../$(INSTALL) -T so_base $(LIBNAME).la $(PKG_LIB_DIR); \
+	if test "x$(PKG_DEVLIB_DIR)" != "x$(PKG_LIB_DIR)" ; then \
+	../$(INSTALL) -S $(PKG_DEVLIB_DIR)/$(LIBNAME).a $(PKG_LIB_DIR)/$(LIBNAME).a; \
+	../$(INSTALL) -S $(PKG_DEVLIB_DIR)/$(LIBNAME).la $(PKG_LIB_DIR)/$(LIBNAME).la; \
+	fi
 
 INSTALL_MAN = \
 	@for d in $(MAN_PAGES); do \