aboutsummaryrefslogtreecommitdiff
path: root/package/libcap/libcap.mk
diff options
context:
space:
mode:
authorGravatar Eric Le Bihan <eric.le.bihan.dev@free.fr>2014-04-20 21:30:13 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-04-21 11:21:52 +0200
commit57155c6b6a7a40523075626353375109fe159c04 (patch)
treed8d5c533d7eeb38f952115398669f0719c3eeb86 /package/libcap/libcap.mk
parent04e6fe289121d0ba9693b8b13ff92ee1249f6e04 (diff)
downloadbuildroot-57155c6b6a7a40523075626353375109fe159c04.tar.gz
buildroot-57155c6b6a7a40523075626353375109fe159c04.tar.bz2
libcap: add menu entry to install tools.
libcap provides a set of tools to manipulate capabilities, among which `setcap(8)` and `getcap(8)`. A new menu entry has been added to install them. [Thomas: mark the new option as requiring MMU support, because the programs use fork(), and completely rework the new .mk logic as it wasn't taking into account the BR2_PREFER_STATIC_LIB case.] Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/libcap/libcap.mk')
-rw-r--r--package/libcap/libcap.mk27
1 files changed, 23 insertions, 4 deletions
diff --git a/package/libcap/libcap.mk b/package/libcap/libcap.mk
index 17e2eb5191..a3b7d4eff5 100644
--- a/package/libcap/libcap.mk
+++ b/package/libcap/libcap.mk
@@ -33,20 +33,39 @@ LIBCAP_MAKE_TARGET = all
LIBCAP_MAKE_INSTALL_TARGET = install
endif
+LIBCAP_MAKE_FLAGS = \
+ LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+ BUILD_CC="$(HOSTCC)" \
+ BUILD_CFLAGS="$(HOST_CFLAGS)"
+
+ifeq ($(BR2_PACKAGE_LIBCAP_TOOLS),y)
+define LIBCAP_BUILD_TOOLS_CMDS
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/progs \
+ $(LIBCAP_MAKE_FLAGS)
+endef
+
+define LIBCAP_INSTALL_TOOLS_CMDS
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/progs \
+ RAISE_SETFCAP=no prefix=/usr \
+ DESTDIR=$(TARGET_DIR) $(LIBCAP_MAKE_FLAGS) install
+endef
+endif
+
define LIBCAP_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/libcap \
- LIBATTR=$(LIBCAP_HAVE_LIBATTR) BUILD_CC="$(HOSTCC)" \
- BUILD_CFLAGS="$(HOST_CFLAGS)" $(LIBCAP_MAKE_TARGET)
+ $(LIBCAP_MAKE_FLAGS) $(LIBCAP_MAKE_TARGET)
+ $(LIBCAP_BUILD_TOOLS_CMDS)
endef
define LIBCAP_INSTALL_STAGING_CMDS
- $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libcap LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libcap $(LIBCAP_MAKE_FLAGS) \
DESTDIR=$(STAGING_DIR) prefix=/usr lib=lib $(LIBCAP_MAKE_INSTALL_TARGET)
endef
define LIBCAP_INSTALL_TARGET_CMDS
- $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libcap LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libcap $(LIBCAP_MAKE_FLAGS) \
DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib $(LIBCAP_MAKE_INSTALL_TARGET)
+ $(LIBCAP_INSTALL_TOOLS_CMDS)
endef
define HOST_LIBCAP_BUILD_CMDS