aboutsummaryrefslogtreecommitdiff
path: root/package/libcap/libcap.mk
diff options
context:
space:
mode:
authorGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2013-11-01 18:47:27 +0100
committerGravatar Peter Korsgaard <peter@korsgaard.com>2013-11-04 21:55:54 +0100
commitc016a48b99759164375bcbb99f555c293b042245 (patch)
tree52191c8a66c50c123b67ca48948d80b6e6f4c081 /package/libcap/libcap.mk
parent2bea7b8c381fa7c62f40f63f9e9f80e530fa9f3a (diff)
downloadbuildroot-c016a48b99759164375bcbb99f555c293b042245.tar.gz
buildroot-c016a48b99759164375bcbb99f555c293b042245.tar.bz2
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>
Diffstat (limited to 'package/libcap/libcap.mk')
-rw-r--r--package/libcap/libcap.mk27
1 files changed, 14 insertions, 13 deletions
diff --git a/package/libcap/libcap.mk b/package/libcap/libcap.mk
index 16afaef24a..17e2eb5191 100644
--- a/package/libcap/libcap.mk
+++ b/package/libcap/libcap.mk
@@ -25,29 +25,30 @@ 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) \
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/libcap \
LIBATTR=$(LIBCAP_HAVE_LIBATTR) BUILD_CC="$(HOSTCC)" \
- BUILD_CFLAGS="$(HOST_CFLAGS)"
+ BUILD_CFLAGS="$(HOST_CFLAGS)" $(LIBCAP_MAKE_TARGET)
endef
define LIBCAP_INSTALL_STAGING_CMDS
- $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
- DESTDIR=$(STAGING_DIR) prefix=/usr lib=lib install
+ $(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) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
- DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib install
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libcap LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+ DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib $(LIBCAP_MAKE_INSTALL_TARGET)
endef
-# progs use fork()
-define LIBCAP_DISABLE_PROGS
- $(SED) '/-C progs/d' $(@D)/Makefile
-endef
-
-LIBCAP_POST_PATCH_HOOKS += LIBCAP_DISABLE_PROGS
-
define HOST_LIBCAP_BUILD_CMDS
$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) LIBATTR=no
endef