Skip to contentSkip to conversation

libcap: Add optional support for libattr capabilities

PATCH New Markos Chandras 3 participants 5 messages Mar 15, 2013 – Mar 18, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libcap: Add optional support for libattr capabilities

From: Markos Chandras <[email protected]>

libcap can optionally link to libattr to support extra file capabilities. Link to this library and pull it as dependency if BR2_PACKAGE_ATTR is selected.

---
 package/libcap/libcap.mk |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)
package/libcap/libcap.mk +12 -5
index dcd3a18..c319335 100644
@@ -15,18 +15,25 @@ LIBCAP_LICENSE_FILES = License
 LIBCAP_DEPENDENCIES = host-libcap
 LIBCAP_INSTALL_STAGING = YES
 
+ifeq ($(BR2_PACKAGE_ATTR),y)
+	LIBCAP_DEPENDENCIES += host-attr attr
+	HAVE_LIBATTR = yes
+else
+	HAVE_LIBATTR = no
+endif
+
 define LIBCAP_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
-		LIBATTR=no BUILD_CC="$(HOSTCC)" BUILD_CFLAGS="$(HOST_CFLAGS)"
+		LIBATTR=$(HAVE_LIBATTR) BUILD_CC="$(HOSTCC)" BUILD_CFLAGS="$(HOST_CFLAGS)"
 endef
 
 define LIBCAP_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(STAGING_DIR) \
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(HAVE_LIBATTR) DESTDIR=$(STAGING_DIR) \
 		prefix=/usr lib=lib install
 endef
 
 define LIBCAP_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(TARGET_DIR) \
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(HAVE_LIBATTR) DESTDIR=$(TARGET_DIR) \
 		prefix=/usr lib=lib install
 endef
 
@@ -38,11 +45,11 @@ endef
 LIBCAP_POST_PATCH_HOOKS += LIBCAP_DISABLE_PROGS
 
 define HOST_LIBCAP_BUILD_CMDS
-	$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) LIBATTR=no
+	$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) LIBATTR=$(HAVE_LIBATTR)
 endef
 
 define HOST_LIBCAP_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(HOST_DIR) \
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(HAVE_LIBATTR) DESTDIR=$(HOST_DIR) \
 		prefix=/usr lib=lib install
 endef
 
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 libcap: Add optional support for libattr capabilities

Dear Markos Chandras,

package/libcap/libcap.mk LIBCAP_LICENSE_FILES = License · line 19

Quoted 2 lines · Markos Chandras
package/libcap/libcap.mk +2 -0
+ifeq ($(BR2_PACKAGE_ATTR),y)
+	LIBCAP_DEPENDENCIES += host-attr attr

We don't generally tie dependencies of host packages on BR2_PACKAGE_<foo> options. Is there a specific reason that requires host-libcap to be built against host-attr?

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
#2 lore raw

PATCH 1/1 libcap: Add optional support for libattr capabilities

Quoted 11 lines · Thomas Petazzoni

Dear Markos Chandras,

package/libcap/libcap.mk LIBCAP_LICENSE_FILES = License · line 19

Quoted 2 lines · Markos Chandras
package/libcap/libcap.mk +2 -0
+ifeq ($(BR2_PACKAGE_ATTR),y)
+     LIBCAP_DEPENDENCIES += host-attr attr

We don't generally tie dependencies of host packages on BR2_PACKAGE_<foo> options. Is there a specific reason that requires host-libcap to be built against host-attr?

Hi Thomas,

No special reason, just making sure the host-libcap is built the same way as the target one does so it can support the same functionality. Should I resend this patch but only changing the way the target libcap is built?

Signature · 2 lines
Regards,
Markos Chandras
#3 lore raw

PATCH 1/1 libcap: Add optional support for libattr capabilities

Quoted 9 lines
Quoted 9 lines

package/libcap/libcap.mk LIBCAP_LICENSE_FILES = License · line 19

Quoted 4 lines
Quoted 1 line
Quoted 1 line

"Markos" == Markos Chandras <[email protected]> writes:

package/libcap/libcap.mk +2 -0
+ifeq ($(BR2_PACKAGE_ATTR),y)
+     LIBCAP_DEPENDENCIES += host-attr attr

We don't generally tie dependencies of host packages on BR2_PACKAGE_<foo> options. Is there a specific reason that requires host-libcap to be built against host-attr?

Markos> Hi Thomas,

Markos> No special reason, just making sure the host-libcap is built Markos> the same way as the target one does so it can support the same Markos> functionality. Should I resend this patch but only changing Markos> the way the target libcap is built?

I would say so. We don't even currently have a host-attr package, so I'm not sure how it could work?

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

PATCH 1/1 libcap: Add optional support for libattr capabilities

Quoted 16 lines · Peter Korsgaard
Quoted 9 lines
Quoted 9 lines

package/libcap/libcap.mk LIBCAP_LICENSE_FILES = License · line 19

Quoted 4 lines
Quoted 1 line
Quoted 1 line

"Markos" == Markos Chandras <[email protected]> writes:

package/libcap/libcap.mk +2 -0
+ifeq ($(BR2_PACKAGE_ATTR),y)
+     LIBCAP_DEPENDENCIES += host-attr attr

We don't generally tie dependencies of host packages on BR2_PACKAGE_<foo> options. Is there a specific reason that requires host-libcap to be built against host-attr?

Markos> Hi Thomas,

Markos> No special reason, just making sure the host-libcap is built Markos> the same way as the target one does so it can support the same Markos> functionality. Should I resend this patch but only changing Markos> the way the target libcap is built?

Quoted 5 lines

I would say so. We don't even currently have a host-attr package, so I'm not sure how it could work?

--
Bye, Peter Korsgaard

Hi Peter,

Ok I will submit a new patch changing only the target libcap to link with libattr.

Signature · 2 lines
Regards,
Markos Chandras