1 ################################################################################
5 ################################################################################
8 ZLIB_SOURCE
= zlib-
$(ZLIB_VERSION
).
tar.xz
9 ZLIB_SITE
= http
://www.zlib.net
10 ZLIB_LICENSE
= zlib license
11 ZLIB_LICENSE_FILES
= README
12 ZLIB_INSTALL_STAGING
= YES
14 # It is not possible to build only a shared version of zlib, so we build both
15 # shared and static, unless we only want the static libs, and we eventually
16 # selectively remove what we do not want
17 ifeq ($(BR2_STATIC_LIBS
),y
)
19 ZLIB_SHARED
= --static
22 ZLIB_SHARED
= --shared
25 define ZLIB_CONFIGURE_CMDS
26 (cd
$(@D
); rm -rf config.cache
; \
27 $(TARGET_CONFIGURE_ARGS
) \
28 $(TARGET_CONFIGURE_OPTS
) \
29 CFLAGS
="$(TARGET_CFLAGS) $(ZLIB_PIC)" \
36 define HOST_ZLIB_CONFIGURE_CMDS
37 (cd
$(@D
); rm -rf config.cache
; \
38 $(HOST_CONFIGURE_ARGS
) \
39 $(HOST_CONFIGURE_OPTS
) \
41 --prefix="$(HOST_DIR)/usr" \
42 --sysconfdir
="$(HOST_DIR)/etc" \
46 define ZLIB_BUILD_CMDS
47 $(TARGET_MAKE_ENV
) $(MAKE1
) -C
$(@D
)
50 define HOST_ZLIB_BUILD_CMDS
51 $(HOST_MAKE_ENV
) $(MAKE1
) -C
$(@D
)
54 define ZLIB_INSTALL_STAGING_CMDS
55 $(TARGET_MAKE_ENV
) $(MAKE1
) -C
$(@D
) DESTDIR
=$(STAGING_DIR
) LDCONFIG
=true
install
58 define ZLIB_INSTALL_TARGET_CMDS
59 $(TARGET_MAKE_ENV
) $(MAKE1
) -C
$(@D
) DESTDIR
=$(TARGET_DIR
) LDCONFIG
=true
install
62 # We don't care removing the .a from target, since it not used at link
63 # time to build other packages, and it is anyway removed later before
64 # assembling the filesystem images anyway.
65 ifeq ($(BR2_SHARED_LIBS
),y
)
66 define ZLIB_RM_STATIC_STAGING
67 rm -f
$(STAGING_DIR
)/usr
/lib
/libz.a
69 ZLIB_POST_INSTALL_STAGING_HOOKS
+= ZLIB_RM_STATIC_STAGING
72 define HOST_ZLIB_INSTALL_CMDS
73 $(HOST_MAKE_ENV
) $(MAKE1
) -C
$(@D
) LDCONFIG
=true
install
76 $(eval
$(generic-package
))
77 $(eval
$(host-generic-package
))