kumquat-buildroot/package/libcap/libcap.mk
Thomas Petazzoni c016a48b99 libcap: fix static link
With BR2_PREFER_STATIC_LIB, libcap fails to build:

  http://autobuild.buildroot.net/results/619bceb3491ecd2ed4e1ae552fdb237a0ed2fa47/build-end.log

This is due to the fact that it still tries to build a shared
library. This commit fixes that by adding a patch that makes libcap
provide install-shared/install-static targets. We also now only build
the $(@D)/libcap subdirectory, so removing the build of the progs
subdirectory is no longer needed.

[Peter: fixup description]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-04 21:55:54 +01:00

63 lines
1.8 KiB
Makefile

################################################################################
#
# libcap
#
################################################################################
LIBCAP_VERSION = 2.22
# Until kernel.org is completely back up use debian mirror
#LIBCAP_SITE = http://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2
LIBCAP_SITE = $(BR2_DEBIAN_MIRROR)/debian/pool/main/libc/libcap2
LIBCAP_SOURCE = libcap2_$(LIBCAP_VERSION).orig.tar.gz
LIBCAP_LICENSE = GPLv2 or BSD-3c
LIBCAP_LICENSE_FILES = License
LIBCAP_DEPENDENCIES = host-libcap
LIBCAP_INSTALL_STAGING = YES
ifeq ($(BR2_PACKAGE_ATTR),y)
LIBCAP_DEPENDENCIES += attr
LIBCAP_HAVE_LIBATTR = yes
else
LIBCAP_HAVE_LIBATTR = no
endif
# we don't have host-attr
HOST_LIBCAP_DEPENDENCIES =
ifeq ($(BR2_PREFER_STATIC_LIB),y)
LIBCAP_MAKE_TARGET = libcap.a
LIBCAP_MAKE_INSTALL_TARGET = install-static
else
LIBCAP_MAKE_TARGET = all
LIBCAP_MAKE_INSTALL_TARGET = install
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)
endef
define LIBCAP_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libcap LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
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) \
DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib $(LIBCAP_MAKE_INSTALL_TARGET)
endef
define HOST_LIBCAP_BUILD_CMDS
$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) LIBATTR=no
endef
define HOST_LIBCAP_INSTALL_CMDS
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(HOST_DIR) \
prefix=/usr lib=lib install
endef
$(eval $(generic-package))
$(eval $(host-generic-package))