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)
|
2007-07-06 06:26:32 +02:00
|
|
|
ZLIB_CFLAGS:=-fPIC
|
2004-10-09 03:06:03 +02:00
|
|
|
ifeq ($(BR2_LARGEFILE),y)
|
2005-10-29 09:16:38 +02:00
|
|
|
ZLIB_CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
2002-05-11 07:48:55 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
$(DL_DIR)/$(ZLIB_SOURCE):
|
2002-11-21 00:16:10 +01:00
|
|
|
$(WGET) -P $(DL_DIR) $(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
|
|
|
|
2007-04-16 20:51:20 +02:00
|
|
|
$(ZLIB_DIR)/.configured: $(ZLIB_DIR)/.patched
|
|
|
|
(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) \
|
2007-07-06 06:26:32 +02:00
|
|
|
CFLAGS="$(ZLIB_CFLAGS)" \
|
2003-01-17 09:03:59 +01:00
|
|
|
./configure \
|
|
|
|
--shared \
|
|
|
|
--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
|
|
|
|
2007-07-11 16:06:06 +02:00
|
|
|
$(ZLIB_DIR)/libz.so.$(ZLIB_VERSION): $(ZLIB_DIR)/.configured
|
2005-08-31 00:46:58 +02:00
|
|
|
$(MAKE) -C $(ZLIB_DIR) all libz.a
|
2007-07-11 16:06:06 +02:00
|
|
|
touch -c $(ZLIB_DIR)/libz.so.$(ZLIB_VERSION)
|
2002-05-11 07:48:55 +02:00
|
|
|
|
2007-07-11 16:06:06 +02:00
|
|
|
$(STAGING_DIR)/usr/lib/libz.so.$(ZLIB_VERSION): $(ZLIB_DIR)/libz.so.$(ZLIB_VERSION)
|
2007-04-16 20:51:20 +02:00
|
|
|
cp -dpf $(ZLIB_DIR)/libz.a $(STAGING_DIR)/usr/lib/
|
|
|
|
cp -dpf $(ZLIB_DIR)/zlib.h $(STAGING_DIR)/usr/include/
|
|
|
|
cp -dpf $(ZLIB_DIR)/zconf.h $(STAGING_DIR)/usr/include/
|
|
|
|
cp -dpf $(ZLIB_DIR)/libz.so* $(STAGING_DIR)/usr/lib/
|
2007-07-11 16:06:06 +02:00
|
|
|
ln -sf libz.so.$(ZLIB_VERSION) $(STAGING_DIR)/usr/lib/libz.so.1
|
|
|
|
chmod a-x $(STAGING_DIR)/usr/lib/libz.so.$(ZLIB_VERSION)
|
2007-04-16 20:51:20 +02:00
|
|
|
touch -c $@
|
2002-05-11 07:48:55 +02:00
|
|
|
|
2007-07-11 16:06:06 +02:00
|
|
|
$(TARGET_DIR)/usr/lib/libz.so.$(ZLIB_VERSION): $(STAGING_DIR)/usr/lib/libz.so.$(ZLIB_VERSION)
|
2007-06-25 11:07:08 +02:00
|
|
|
mkdir -p $(TARGET_DIR)/usr/lib
|
2007-04-16 20:51:20 +02:00
|
|
|
cp -dpf $(STAGING_DIR)/usr/lib/libz.so* $(TARGET_DIR)/usr/lib
|
|
|
|
-$(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libz.so*
|
|
|
|
touch -c $@
|
2002-05-11 07:48:55 +02:00
|
|
|
|
2007-07-11 16:06:06 +02:00
|
|
|
$(TARGET_DIR)/usr/lib/libz.a: $(STAGING_DIR)/usr/lib/libz.so.$(ZLIB_VERSION)
|
2007-06-25 11:01:53 +02:00
|
|
|
mkdir -p $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib
|
2007-04-16 20:51:20 +02:00
|
|
|
cp -dpf $(STAGING_DIR)/usr/include/zlib.h $(TARGET_DIR)/usr/include/
|
|
|
|
cp -dpf $(STAGING_DIR)/usr/include/zconf.h $(TARGET_DIR)/usr/include/
|
|
|
|
cp -dpf $(STAGING_DIR)/usr/lib/libz.a $(TARGET_DIR)/usr/lib/
|
2007-06-25 11:01:53 +02:00
|
|
|
rm -f $(TARGET_DIR)/lib/libz.so $(TARGET_DIR)/usr/lib/libz.so
|
2007-07-11 16:06:06 +02:00
|
|
|
ln -sf libz.so.$(ZLIB_VERSION) $(TARGET_DIR)/usr/lib/libz.so
|
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
|
|
|
|
2007-07-11 16:06:06 +02:00
|
|
|
zlib: uclibc $(TARGET_DIR)/usr/lib/libz.so.$(ZLIB_VERSION)
|
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:
|
2007-04-16 20:51:20 +02:00
|
|
|
rm -f $(TARGET_DIR)/usr/lib/libz.so* \
|
2007-06-25 11:07:08 +02:00
|
|
|
$(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
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
ifeq ($(strip $(BR2_PACKAGE_ZLIB)),y)
|
|
|
|
TARGETS+=zlib
|
|
|
|
endif
|
2005-07-12 21:53:12 +02:00
|
|
|
ifeq ($(strip $(BR2_PACKAGE_ZLIB_TARGET_HEADERS)),y)
|
|
|
|
TARGETS+=zlib-headers
|
|
|
|
endif
|