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
|
2006-11-17 16:43:51 +01:00
|
|
|
ZLIB_CAT:=$(BZCAT)
|
2007-06-29 10:18:13 +02:00
|
|
|
ZLIB_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/libpng
|
2007-07-11 16:06:06 +02:00
|
|
|
ZLIB_DIR:=$(BUILD_DIR)/zlib-$(ZLIB_VERSION)
|
2002-05-11 07:48:55 +02:00
|
|
|
|
|
|
|
$(DL_DIR)/$(ZLIB_SOURCE):
|
2009-01-16 12:42:52 +01:00
|
|
|
$(call DOWNLOAD,$(ZLIB_SITE),$(ZLIB_SOURCE))
|
2002-05-11 07:48:55 +02:00
|
|
|
|
2007-04-16 20:51:20 +02:00
|
|
|
$(ZLIB_DIR)/.patched: $(DL_DIR)/$(ZLIB_SOURCE)
|
2006-11-17 16:43:51 +01:00
|
|
|
$(ZLIB_CAT) $(DL_DIR)/$(ZLIB_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
2005-08-31 00:46:58 +02:00
|
|
|
toolchain/patch-kernel.sh $(ZLIB_DIR) package/zlib/ zlib\*.patch
|
2007-04-16 20:51:20 +02:00
|
|
|
$(CONFIG_UPDATE) $(@D)
|
|
|
|
touch $@
|
2002-05-11 07:48:55 +02:00
|
|
|
|
2008-12-08 15:41:47 +01:00
|
|
|
ifneq ($(BR2_PREFER_STATIC_LIB),y)
|
|
|
|
ZLIB_PIC := -fPIC
|
|
|
|
ZLIB_SHARED := --shared
|
|
|
|
ZLIB_TARGET := $(TARGET_DIR)/usr/lib/libz.so
|
|
|
|
else
|
|
|
|
ZLIB_PIC :=
|
|
|
|
ZLIB_SHARED :=
|
|
|
|
ZLIB_TARGET := $(STAGING_DIR)/usr/lib/libz.a
|
|
|
|
endif
|
|
|
|
|
2007-04-16 20:51:20 +02:00
|
|
|
$(ZLIB_DIR)/.configured: $(ZLIB_DIR)/.patched
|
2007-08-22 11:56:41 +02:00
|
|
|
(cd $(ZLIB_DIR); 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
|
|
|
)
|
2007-04-16 20:51:20 +02:00
|
|
|
touch $@
|
2002-05-11 07:48:55 +02:00
|
|
|
|
2008-12-08 15:41:47 +01:00
|
|
|
$(ZLIB_DIR)/libz.a: $(ZLIB_DIR)/.configured
|
2005-08-31 00:46:58 +02:00
|
|
|
$(MAKE) -C $(ZLIB_DIR) all libz.a
|
2008-07-17 15:19:54 +02:00
|
|
|
touch -c $@
|
2002-05-11 07:48:55 +02:00
|
|
|
|
2008-12-08 15:41:47 +01:00
|
|
|
$(STAGING_DIR)/usr/lib/libz.a: $(ZLIB_DIR)/libz.a
|
2008-10-31 17:37:01 +01:00
|
|
|
$(INSTALL) -D $(ZLIB_DIR)/libz.a $(STAGING_DIR)/usr/lib/libz.a
|
|
|
|
$(INSTALL) -D $(ZLIB_DIR)/zlib.h $(STAGING_DIR)/usr/include/zlib.h
|
2008-10-31 13:10:10 +01:00
|
|
|
$(INSTALL) $(ZLIB_DIR)/zconf.h $(STAGING_DIR)/usr/include/
|
2008-12-08 15:41:47 +01:00
|
|
|
touch -c $@
|
|
|
|
|
|
|
|
$(STAGING_DIR)/usr/lib/libz.so: $(STAGING_DIR)/usr/lib/libz.a
|
2008-12-11 15:40:56 +01:00
|
|
|
cp -dpf $(ZLIB_DIR)/libz.so* $(STAGING_DIR)/usr/lib/
|
2007-04-16 20:51:20 +02:00
|
|
|
touch -c $@
|
2002-05-11 07:48:55 +02:00
|
|
|
|
2008-07-17 15:19:54 +02:00
|
|
|
$(TARGET_DIR)/usr/lib/libz.so: $(STAGING_DIR)/usr/lib/libz.so
|
2008-10-31 17:37:01 +01:00
|
|
|
mkdir -p $(TARGET_DIR)/usr/lib
|
|
|
|
cp -dpf $(STAGING_DIR)/usr/lib/libz.so* $(TARGET_DIR)/usr/lib
|
2008-07-17 15:19:54 +02:00
|
|
|
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@
|
2007-04-16 20:51:20 +02:00
|
|
|
touch -c $@
|
2002-05-11 07:48:55 +02:00
|
|
|
|
2008-12-08 15:41:47 +01:00
|
|
|
$(TARGET_DIR)/usr/lib/libz.a: $(STAGING_DIR)/usr/lib/libz.a
|
2008-10-31 17:37:01 +01:00
|
|
|
$(INSTALL) -D $(STAGING_DIR)/usr/include/zlib.h $(TARGET_DIR)/usr/include/zlib.h
|
2008-10-31 13:10:10 +01:00
|
|
|
$(INSTALL) $(STAGING_DIR)/usr/include/zconf.h $(TARGET_DIR)/usr/include/
|
2008-10-31 17:37:01 +01:00
|
|
|
$(INSTALL) -D $(STAGING_DIR)/usr/lib/libz.a $(TARGET_DIR)/usr/lib/libz.a
|
2007-04-16 20:51:20 +02:00
|
|
|
touch -c $@
|
2003-01-08 19:17:28 +01:00
|
|
|
|
2003-01-21 08:34:29 +01:00
|
|
|
zlib-headers: $(TARGET_DIR)/usr/lib/libz.a
|
2003-01-08 19:17:28 +01:00
|
|
|
|
2009-09-02 17:02:02 +02:00
|
|
|
zlib: $(ZLIB_TARGET)
|
2002-05-11 07:48:55 +02:00
|
|
|
|
2003-11-12 10:31:12 +01:00
|
|
|
zlib-source: $(DL_DIR)/$(ZLIB_SOURCE)
|
|
|
|
|
2002-05-11 07:48:55 +02:00
|
|
|
zlib-clean:
|
2008-07-17 15:19:54 +02:00
|
|
|
rm -f $(TARGET_DIR)/usr/lib/libz.* \
|
|
|
|
$(TARGET_DIR)/usr/include/zlib.h \
|
|
|
|
$(TARGET_DIR)/usr/include/zconf.h \
|
|
|
|
$(STAGING_DIR)/usr/include/zlib.h \
|
|
|
|
$(STAGING_DIR)/usr/include/zconf.h \
|
|
|
|
$(STAGING_DIR)/usr/lib/libz.*
|
2003-01-17 09:03:59 +01:00
|
|
|
-$(MAKE) -C $(ZLIB_DIR) clean
|
2002-05-11 07:48:55 +02:00
|
|
|
|
|
|
|
zlib-dirclean:
|
|
|
|
rm -rf $(ZLIB_DIR)
|
|
|
|
|
2005-02-10 04:06:39 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_ZLIB),y)
|
2005-02-10 04:06:39 +01:00
|
|
|
TARGETS+=zlib
|
|
|
|
endif
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_ZLIB_TARGET_HEADERS),y)
|
2005-07-12 21:53:12 +02:00
|
|
|
TARGETS+=zlib-headers
|
|
|
|
endif
|