diff options
author | Yann E. MORIN <yann.morin.1998@free.fr> | 2014-12-16 22:46:58 +0100 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2014-12-20 21:55:23 +0100 |
commit | bef6d517fb0a87d2564a94273815f7b3862feaf9 (patch) | |
tree | 33df8d746aba7aed7cd57f39fd919fe12114664a | |
parent | 7f7dc71cc8545dacf23f9a25f33c184d15bed65c (diff) |
package/zlib: allow shared-only builds
Currently, we can build a static-only zlib, but not a shared-only one.
This is because zlib's build-system is a custom ./configure (not using
autotools), and does not allow building/installing only the shared
library.
Simply remove the .a as a post-staging install hook. We don't care
removing it from target, since it is not used at link time to build
other packages, and it is anyway removed later before assembling the
filesystem images anyway.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r-- | package/zlib/zlib.mk | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/package/zlib/zlib.mk b/package/zlib/zlib.mk index 7c849cd53..aec9daf6f 100644 --- a/package/zlib/zlib.mk +++ b/package/zlib/zlib.mk @@ -11,6 +11,9 @@ ZLIB_LICENSE = zlib license ZLIB_LICENSE_FILES = README ZLIB_INSTALL_STAGING = YES +# It is not possible to build only a shared version of zlib, so we build both +# shared and static, unless we only want the static libs, and we eventually +# selectively remove what we do not want ifeq ($(BR2_STATIC_LIBS),y) ZLIB_PIC = ZLIB_SHARED = --static @@ -56,6 +59,16 @@ define ZLIB_INSTALL_TARGET_CMDS $(MAKE1) -C $(@D) DESTDIR=$(TARGET_DIR) LDCONFIG=true install endef +# We don't care removing the .a from target, since it not used at link +# time to build other packages, and it is anyway removed later before +# assembling the filesystem images anyway. +ifeq ($(BR2_SHARED_LIBS),y) +define ZLIB_RM_STATIC_STAGING + rm -f $(STAGING_DIR)/usr/lib/libz.a +endef +ZLIB_POST_INSTALL_STAGING_HOOKS += ZLIB_RM_STATIC_STAGING +endif + define HOST_ZLIB_INSTALL_CMDS $(MAKE1) -C $(@D) LDCONFIG=true install endef |