2013-06-06 07:53:30 +08:00
|
|
|
################################################################################
|
2002-05-11 13:48:55 +08:00
|
|
|
#
|
|
|
|
# zlib
|
|
|
|
#
|
2013-06-06 07:53:30 +08:00
|
|
|
################################################################################
|
2012-02-13 18:25:18 +08:00
|
|
|
|
2013-07-20 17:47:23 +08:00
|
|
|
ZLIB_VERSION = 1.2.8
|
|
|
|
ZLIB_SOURCE = zlib-$(ZLIB_VERSION).tar.xz
|
2012-08-23 06:11:55 +08:00
|
|
|
ZLIB_SITE = http://downloads.sourceforge.net/project/libpng/zlib/$(ZLIB_VERSION)
|
2012-08-20 04:08:43 +08:00
|
|
|
ZLIB_LICENSE = zlib license
|
|
|
|
ZLIB_LICENSE_FILES = README
|
2012-02-13 18:25:18 +08:00
|
|
|
ZLIB_INSTALL_STAGING = YES
|
2002-05-11 13:48:55 +08:00
|
|
|
|
2014-12-17 05:46:58 +08:00
|
|
|
# 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
|
2014-12-04 05:41:29 +08:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
2013-01-20 17:45:47 +08:00
|
|
|
ZLIB_PIC =
|
|
|
|
ZLIB_SHARED = --static
|
2009-09-30 06:36:03 +08:00
|
|
|
else
|
2013-01-20 17:45:47 +08:00
|
|
|
ZLIB_PIC = -fPIC
|
|
|
|
ZLIB_SHARED = --shared
|
2008-12-08 22:41:47 +08:00
|
|
|
endif
|
|
|
|
|
2009-10-27 15:53:12 +08:00
|
|
|
define ZLIB_CONFIGURE_CMDS
|
|
|
|
(cd $(@D); rm -rf config.cache; \
|
2007-07-31 02:17:13 +08:00
|
|
|
$(TARGET_CONFIGURE_ARGS) \
|
2005-08-31 06:46:58 +08:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2008-12-08 22:41:47 +08:00
|
|
|
CFLAGS="$(TARGET_CFLAGS) $(ZLIB_PIC)" \
|
2003-01-17 16:03:59 +08:00
|
|
|
./configure \
|
2008-12-08 22:41:47 +08:00
|
|
|
$(ZLIB_SHARED) \
|
2003-01-17 16:03:59 +08:00
|
|
|
--prefix=/usr \
|
2007-06-29 16:18:13 +08:00
|
|
|
)
|
2009-10-27 15:53:12 +08:00
|
|
|
endef
|
|
|
|
|
2010-02-21 01:19:06 +08:00
|
|
|
define HOST_ZLIB_CONFIGURE_CMDS
|
|
|
|
(cd $(@D); rm -rf config.cache; \
|
|
|
|
$(HOST_CONFIGURE_ARGS) \
|
|
|
|
$(HOST_CONFIGURE_OPTS) \
|
|
|
|
./configure \
|
|
|
|
--prefix="$(HOST_DIR)/usr" \
|
|
|
|
--sysconfdir="$(HOST_DIR)/etc" \
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2009-10-27 15:53:12 +08:00
|
|
|
define ZLIB_BUILD_CMDS
|
2010-11-24 23:14:52 +08:00
|
|
|
$(MAKE1) -C $(@D)
|
2009-10-27 15:53:12 +08:00
|
|
|
endef
|
|
|
|
|
2010-02-21 01:19:06 +08:00
|
|
|
define HOST_ZLIB_BUILD_CMDS
|
2010-11-24 23:14:52 +08:00
|
|
|
$(MAKE1) -C $(@D)
|
2010-02-21 01:19:06 +08:00
|
|
|
endef
|
|
|
|
|
2009-10-27 15:53:12 +08:00
|
|
|
define ZLIB_INSTALL_STAGING_CMDS
|
2011-01-26 16:27:03 +08:00
|
|
|
$(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR) LDCONFIG=true install
|
2010-11-24 23:14:52 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define ZLIB_INSTALL_TARGET_CMDS
|
2011-01-26 16:27:03 +08:00
|
|
|
$(MAKE1) -C $(@D) DESTDIR=$(TARGET_DIR) LDCONFIG=true install
|
2009-10-27 15:53:12 +08:00
|
|
|
endef
|
|
|
|
|
2014-12-17 05:46:58 +08:00
|
|
|
# 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
|
|
|
|
|
2010-02-21 01:19:06 +08:00
|
|
|
define HOST_ZLIB_INSTALL_CMDS
|
2011-01-26 16:27:03 +08:00
|
|
|
$(MAKE1) -C $(@D) LDCONFIG=true install
|
2010-02-21 01:19:06 +08:00
|
|
|
endef
|
|
|
|
|
2012-07-03 06:07:32 +08:00
|
|
|
$(eval $(generic-package))
|
2012-07-03 06:06:54 +08:00
|
|
|
$(eval $(host-generic-package))
|