2002-05-11 07:48:55 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# zlib
|
|
|
|
#
|
|
|
|
#############################################################
|
2007-07-11 16:06:06 +02:00
|
|
|
ZLIB_VERSION:=1.2.3
|
|
|
|
ZLIB_SOURCE:=zlib-$(ZLIB_VERSION).tar.bz2
|
2007-06-29 10:18:13 +02:00
|
|
|
ZLIB_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/libpng
|
2009-10-27 08:53:12 +01:00
|
|
|
ZLIB_INSTALL_STAGING=YES
|
2002-05-11 07:48:55 +02:00
|
|
|
|
2009-09-30 00:36:03 +02:00
|
|
|
ifeq ($(BR2_PREFER_STATIC_LIB),y)
|
2008-12-08 15:41:47 +01:00
|
|
|
ZLIB_PIC :=
|
|
|
|
ZLIB_SHARED :=
|
2009-09-30 00:36:03 +02:00
|
|
|
else
|
|
|
|
ZLIB_PIC := -fPIC
|
|
|
|
ZLIB_SHARED := --shared
|
2008-12-08 15:41:47 +01:00
|
|
|
endif
|
|
|
|
|
2009-10-27 08:53:12 +01:00
|
|
|
define ZLIB_CONFIGURE_CMDS
|
|
|
|
(cd $(@D); rm -rf config.cache; \
|
2007-07-30 20:17:13 +02:00
|
|
|
$(TARGET_CONFIGURE_ARGS) \
|
2005-08-31 00:46:58 +02:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2008-12-08 15:41:47 +01:00
|
|
|
CFLAGS="$(TARGET_CFLAGS) $(ZLIB_PIC)" \
|
2003-01-17 09:03:59 +01:00
|
|
|
./configure \
|
2008-12-08 15:41:47 +01:00
|
|
|
$(ZLIB_SHARED) \
|
2003-01-17 09:03:59 +01:00
|
|
|
--prefix=/usr \
|
|
|
|
--exec-prefix=$(STAGING_DIR)/usr/bin \
|
2007-04-16 20:51:20 +02:00
|
|
|
--libdir=$(STAGING_DIR)/usr/lib \
|
|
|
|
--includedir=$(STAGING_DIR)/usr/include \
|
2007-06-29 10:18:13 +02:00
|
|
|
)
|
2009-10-27 08:53:12 +01:00
|
|
|
endef
|
|
|
|
|
2010-02-20 18:19:06 +01:00
|
|
|
define HOST_ZLIB_CONFIGURE_CMDS
|
|
|
|
(cd $(@D); rm -rf config.cache; \
|
|
|
|
$(HOST_CONFIGURE_ARGS) \
|
|
|
|
$(HOST_CONFIGURE_OPTS) \
|
|
|
|
CFLAGS="$(ZLIB_PIC)" \
|
|
|
|
./configure \
|
|
|
|
$(ZLIB_SHARED) \
|
|
|
|
--prefix="$(HOST_DIR)/usr" \
|
|
|
|
--sysconfdir="$(HOST_DIR)/etc" \
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2009-10-27 08:53:12 +01:00
|
|
|
define ZLIB_BUILD_CMDS
|
|
|
|
$(MAKE) -C $(@D) all libz.a
|
|
|
|
endef
|
|
|
|
|
2010-02-20 18:19:06 +01:00
|
|
|
define HOST_ZLIB_BUILD_CMDS
|
|
|
|
$(MAKE) -C $(@D) all libz.a
|
|
|
|
endef
|
|
|
|
|
2009-10-27 08:53:12 +01:00
|
|
|
define ZLIB_INSTALL_STAGING_CMDS
|
|
|
|
$(INSTALL) -D $(@D)/libz.a $(STAGING_DIR)/usr/lib/libz.a
|
|
|
|
$(INSTALL) -D $(@D)/zlib.h $(STAGING_DIR)/usr/include/zlib.h
|
|
|
|
$(INSTALL) $(@D)/zconf.h $(STAGING_DIR)/usr/include/
|
|
|
|
cp -dpf $(@D)/libz.so* $(STAGING_DIR)/usr/lib/
|
|
|
|
endef
|
|
|
|
|
2010-02-20 18:19:06 +01:00
|
|
|
define HOST_ZLIB_INSTALL_CMDS
|
|
|
|
$(INSTALL) -D $(@D)/libz.a $(HOST_DIR)/usr/lib/libz.a
|
|
|
|
$(INSTALL) -D $(@D)/zlib.h $(HOST_DIR)/usr/include/zlib.h
|
|
|
|
$(INSTALL) $(@D)/zconf.h $(HOST_DIR)/usr/include/
|
|
|
|
cp -dpf $(@D)/libz.so* $(HOST_DIR)/usr/lib/
|
|
|
|
endef
|
|
|
|
|
2009-10-27 08:53:12 +01:00
|
|
|
ifeq ($(BR2_HAVE_DEVFILES),y)
|
|
|
|
define ZLIB_INSTALL_TARGET_HEADERS
|
2010-01-27 02:08:49 +01:00
|
|
|
$(INSTALL) -D $(@D)/zlib.h $(TARGET_DIR)/usr/include/zlib.h
|
|
|
|
$(INSTALL) $(@D)/zconf.h $(TARGET_DIR)/usr/include/
|
2009-10-27 08:53:12 +01:00
|
|
|
endef
|
|
|
|
endif
|
2002-05-11 07:48:55 +02:00
|
|
|
|
2009-10-27 08:53:12 +01:00
|
|
|
define ZLIB_INSTALL_TARGET_CMDS
|
2008-10-31 17:37:01 +01:00
|
|
|
mkdir -p $(TARGET_DIR)/usr/lib
|
2009-10-27 08:53:12 +01:00
|
|
|
cp -dpf $(@D)/libz.so* $(TARGET_DIR)/usr/lib
|
|
|
|
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libz.so*
|
|
|
|
$(INSTALL) -D $(@D)/libz.a $(TARGET_DIR)/usr/lib/libz.a
|
|
|
|
$(ZLIB_INSTALL_TARGET_HEADERS)
|
|
|
|
endef
|
2002-05-11 07:48:55 +02:00
|
|
|
|
2009-10-27 08:53:12 +01:00
|
|
|
$(eval $(call GENTARGETS,package,zlib))
|
2010-02-20 18:19:06 +01:00
|
|
|
$(eval $(call GENTARGETS,package,zlib,host))
|
|
|
|
|