package/gcc: fix libgcc build for xtensa
[buildroot-gz.git] / package / libcap / libcap.mk
blob54844f8d5fa54ef5d579e459dee4dac674613d09
1 ################################################################################
3 # libcap
5 ################################################################################
7 LIBCAP_VERSION = 2.24
8 LIBCAP_SITE = https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2
9 LIBCAP_SOURCE = libcap-$(LIBCAP_VERSION).tar.xz
10 LIBCAP_LICENSE = GPLv2 or BSD-3c
11 LIBCAP_LICENSE_FILES = License
13 LIBCAP_DEPENDENCIES = host-libcap
14 LIBCAP_INSTALL_STAGING = YES
16 ifeq ($(BR2_PACKAGE_ATTR),y)
17 LIBCAP_DEPENDENCIES += attr
18 LIBCAP_HAVE_LIBATTR = yes
19 else
20 LIBCAP_HAVE_LIBATTR = no
21 endif
23 # we don't have host-attr
24 HOST_LIBCAP_DEPENDENCIES =
26 ifeq ($(BR2_STATIC_LIBS),y)
27 LIBCAP_MAKE_TARGET = libcap.a
28 LIBCAP_MAKE_INSTALL_TARGET = install-static
29 else
30 LIBCAP_MAKE_TARGET = all
31 LIBCAP_MAKE_INSTALL_TARGET = install
32 endif
34 LIBCAP_MAKE_FLAGS = \
35 LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
36 BUILD_CC="$(HOSTCC)" \
37 BUILD_CFLAGS="$(HOST_CFLAGS)"
39 ifeq ($(BR2_PACKAGE_LIBCAP_TOOLS),y)
40 define LIBCAP_BUILD_TOOLS_CMDS
41 $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/progs \
42 $(LIBCAP_MAKE_FLAGS)
43 endef
45 define LIBCAP_INSTALL_TOOLS_CMDS
46 $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/progs \
47 RAISE_SETFCAP=no prefix=/usr \
48 DESTDIR=$(TARGET_DIR) $(LIBCAP_MAKE_FLAGS) install
49 endef
50 endif
52 define LIBCAP_BUILD_CMDS
53 $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/libcap \
54 $(LIBCAP_MAKE_FLAGS) $(LIBCAP_MAKE_TARGET)
55 $(LIBCAP_BUILD_TOOLS_CMDS)
56 endef
58 define LIBCAP_INSTALL_STAGING_CMDS
59 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libcap $(LIBCAP_MAKE_FLAGS) \
60 DESTDIR=$(STAGING_DIR) prefix=/usr lib=lib $(LIBCAP_MAKE_INSTALL_TARGET)
61 endef
63 define LIBCAP_INSTALL_TARGET_CMDS
64 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libcap $(LIBCAP_MAKE_FLAGS) \
65 DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib $(LIBCAP_MAKE_INSTALL_TARGET)
66 $(LIBCAP_INSTALL_TOOLS_CMDS)
67 endef
69 define HOST_LIBCAP_BUILD_CMDS
70 $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) LIBATTR=no
71 endef
73 define HOST_LIBCAP_INSTALL_CMDS
74 $(HOST_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(HOST_DIR) \
75 prefix=/usr lib=lib install
76 endef
78 $(eval $(generic-package))
79 $(eval $(host-generic-package))