1 ################################################################################
5 ################################################################################
7 LIBZLIB_VERSION = 1.2.11
8 LIBZLIB_SOURCE = zlib-$(LIBZLIB_VERSION).tar.xz
9 LIBZLIB_SITE = http://www.zlib.net
10 LIBZLIB_LICENSE = Zlib
11 LIBZLIB_LICENSE_FILES = README
12 LIBZLIB_INSTALL_STAGING = YES
13 LIBZLIB_PROVIDES = zlib
15 # It is not possible to build only a shared version of zlib, so we build both
16 # shared and static, unless we only want the static libs, and we eventually
17 # selectively remove what we do not want
18 ifeq ($(BR2_STATIC_LIBS),y)
20 LIBZLIB_SHARED = --static
23 LIBZLIB_SHARED = --shared
26 define LIBZLIB_CONFIGURE_CMDS
27 (cd $(@D); rm -rf config.cache; \
28 $(TARGET_CONFIGURE_ARGS) \
29 $(TARGET_CONFIGURE_OPTS) \
30 CFLAGS="$(TARGET_CFLAGS) $(LIBZLIB_PIC)" \
37 define HOST_LIBZLIB_CONFIGURE_CMDS
38 (cd $(@D); rm -rf config.cache; \
39 $(HOST_CONFIGURE_ARGS) \
40 $(HOST_CONFIGURE_OPTS) \
42 --prefix="$(HOST_DIR)" \
43 --sysconfdir="$(HOST_DIR)/etc" \
47 define LIBZLIB_BUILD_CMDS
48 $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D)
51 define HOST_LIBZLIB_BUILD_CMDS
52 $(HOST_MAKE_ENV) $(MAKE1) -C $(@D)
55 define LIBZLIB_INSTALL_STAGING_CMDS
56 $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR) LDCONFIG=true install
59 define LIBZLIB_INSTALL_TARGET_CMDS
60 $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR=$(TARGET_DIR) LDCONFIG=true install
63 # We don't care removing the .a from target, since it not used at link
64 # time to build other packages, and it is anyway removed later before
65 # assembling the filesystem images anyway.
66 ifeq ($(BR2_SHARED_LIBS),y)
67 define LIBZLIB_RM_STATIC_STAGING
68 rm -f $(STAGING_DIR)/usr/lib/libz.a
70 LIBZLIB_POST_INSTALL_STAGING_HOOKS += LIBZLIB_RM_STATIC_STAGING
73 define HOST_LIBZLIB_INSTALL_CMDS
74 $(HOST_MAKE_ENV) $(MAKE1) -C $(@D) LDCONFIG=true install
77 $(eval $(generic-package))
78 $(eval $(host-generic-package))