2003-02-12 11:40:28 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# bzip2
|
|
|
|
#
|
|
|
|
#############################################################
|
2007-07-11 16:06:06 +02:00
|
|
|
BZIP2_VERSION:=1.0.4
|
|
|
|
BZIP2_SOURCE:=bzip2-$(BZIP2_VERSION).tar.gz
|
|
|
|
BZIP2_SITE:=http://www.bzip.org/$(BZIP2_VERSION)
|
|
|
|
BZIP2_DIR:=$(BUILD_DIR)/bzip2-$(BZIP2_VERSION)
|
2006-10-01 17:17:52 +02:00
|
|
|
BZIP2_CAT:=$(ZCAT)
|
2003-03-10 21:48:19 +01:00
|
|
|
BZIP2_BINARY:=$(BZIP2_DIR)/bzip2
|
|
|
|
BZIP2_TARGET_BINARY:=$(TARGET_DIR)/usr/bin/bzmore
|
|
|
|
|
2003-02-12 11:40:28 +01:00
|
|
|
$(DL_DIR)/$(BZIP2_SOURCE):
|
|
|
|
$(WGET) -P $(DL_DIR) $(BZIP2_SITE)/$(BZIP2_SOURCE)
|
|
|
|
|
2003-03-10 21:48:19 +01:00
|
|
|
bzip2-source: $(DL_DIR)/$(BZIP2_SOURCE)
|
|
|
|
|
|
|
|
$(BZIP2_DIR)/.unpacked: $(DL_DIR)/$(BZIP2_SOURCE)
|
2004-10-09 23:19:47 +02:00
|
|
|
$(BZIP2_CAT) $(DL_DIR)/$(BZIP2_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
2005-04-15 04:19:11 +02:00
|
|
|
$(SED) "s,ln \$$(,ln -snf \$$(,g" $(BZIP2_DIR)/Makefile
|
2007-08-22 11:56:41 +02:00
|
|
|
$(SED) "s,ln -s (lib.*),ln -snf \$$1; ln -snf libbz2.so.$(BZIP2_VERSION) \
|
2007-07-29 01:02:26 +02:00
|
|
|
libbz2.so,g" $(BZIP2_DIR)/Makefile-libbz2_so
|
2005-01-23 11:48:46 +01:00
|
|
|
ifneq ($(BR2_LARGEFILE),y)
|
2003-12-03 02:16:29 +01:00
|
|
|
$(SED) "s,^BIGFILES,#BIGFILES,g" $(BZIP2_DIR)/Makefile
|
|
|
|
$(SED) "s,^BIGFILES,#BIGFILES,g" $(BZIP2_DIR)/Makefile-libbz2_so
|
|
|
|
endif
|
2004-10-11 17:52:09 +02:00
|
|
|
$(SED) "s:-O2:$(TARGET_CFLAGS):" $(BZIP2_DIR)/Makefile
|
|
|
|
$(SED) "s:-O2:$(TARGET_CFLAGS):" $(BZIP2_DIR)/Makefile-libbz2_so
|
2007-06-25 16:53:24 +02:00
|
|
|
touch $@
|
2003-03-10 21:48:19 +01:00
|
|
|
|
2007-07-11 16:06:06 +02:00
|
|
|
$(STAGING_DIR)/lib/libbz2.so.$(BZIP2_VERSION): $(BZIP2_DIR)/.unpacked
|
2003-03-10 21:48:19 +01:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2007-09-17 14:30:31 +02:00
|
|
|
$(MAKE) CC=$(TARGET_CC) RANLIB=$(TARGET_RANLIB) AR=$(TARGET_AR) \
|
|
|
|
-C $(BZIP2_DIR) -f Makefile-libbz2_so
|
2003-03-10 21:48:19 +01:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2007-09-17 14:30:31 +02:00
|
|
|
$(MAKE) CC=$(TARGET_CC) RANLIB=$(TARGET_RANLIB) AR=$(TARGET_AR) \
|
|
|
|
-C $(BZIP2_DIR) libbz2.a
|
2007-06-25 16:53:24 +02:00
|
|
|
cp $(BZIP2_DIR)/bzlib.h $(STAGING_DIR)/usr/include/
|
2007-07-11 16:06:06 +02:00
|
|
|
cp $(BZIP2_DIR)/libbz2.so.$(BZIP2_VERSION) $(STAGING_DIR)/lib/
|
2007-06-25 16:53:24 +02:00
|
|
|
cp $(BZIP2_DIR)/libbz2.a $(STAGING_DIR)/usr/lib/
|
2007-09-17 14:30:31 +02:00
|
|
|
(cd $(STAGING_DIR)/usr/lib/; \
|
|
|
|
ln -snf ../../lib/libbz2.so.$(BZIP2_VERSION) libbz2.so; \
|
|
|
|
)
|
|
|
|
(cd $(STAGING_DIR)/lib; \
|
|
|
|
ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so.1.0; \
|
|
|
|
ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so.1; \
|
|
|
|
)
|
2003-03-10 21:48:19 +01:00
|
|
|
|
2007-07-11 16:06:06 +02:00
|
|
|
$(BZIP2_BINARY): $(STAGING_DIR)/lib/libbz2.so.$(BZIP2_VERSION)
|
2003-03-10 21:48:19 +01:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
$(MAKE) CC=$(TARGET_CC) -C $(BZIP2_DIR) bzip2 bzip2recover
|
2007-06-25 16:53:24 +02:00
|
|
|
touch -c $@
|
2003-02-12 11:40:28 +01:00
|
|
|
|
2003-03-10 21:48:19 +01:00
|
|
|
$(BZIP2_TARGET_BINARY): $(BZIP2_BINARY)
|
2003-12-03 18:18:41 +01:00
|
|
|
(cd $(TARGET_DIR)/usr/bin; \
|
2007-09-17 14:30:31 +02:00
|
|
|
rm -f bzip2 bunzip2 bzcat bzip2recover \
|
|
|
|
bzgrep bzegrep bzfgrep bzmore bzless bzdiff bzcmp; \
|
|
|
|
)
|
2003-03-10 21:48:19 +01:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
$(MAKE) PREFIX=$(TARGET_DIR)/usr -C $(BZIP2_DIR) install
|
|
|
|
rm -f $(TARGET_DIR)/usr/lib/libbz2.a
|
|
|
|
rm -f $(TARGET_DIR)/usr/include/bzlib.h
|
2007-07-11 16:06:06 +02:00
|
|
|
cp $(BZIP2_DIR)/libbz2.so.$(BZIP2_VERSION) $(TARGET_DIR)/usr/lib/
|
2003-03-10 21:48:19 +01:00
|
|
|
(cd $(TARGET_DIR)/usr/lib; \
|
2007-09-17 14:30:31 +02:00
|
|
|
ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so.1.0; \
|
|
|
|
ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so; \
|
|
|
|
)
|
2003-03-10 21:48:19 +01:00
|
|
|
(cd $(TARGET_DIR)/usr/bin; \
|
2007-09-17 14:30:31 +02:00
|
|
|
ln -snf bzip2 bunzip2; \
|
|
|
|
ln -snf bzip2 bzcat; \
|
|
|
|
ln -snf bzdiff bzcmp; \
|
|
|
|
ln -snf bzmore bzless; \
|
|
|
|
ln -snf bzgrep bzegrep; \
|
|
|
|
ln -snf bzgrep bzfgrep; \
|
|
|
|
)
|
|
|
|
ifneq ($(BR2_HAVE_INFOPAGES),y)
|
|
|
|
rm -rf $(TARGET_DIR)/usr/info
|
|
|
|
endif
|
|
|
|
ifneq ($(BR2_HAVE_MANPAGES),y)
|
|
|
|
rm -rf $(TARGET_DIR)/usr/man
|
|
|
|
endif
|
|
|
|
rm -rf $(TARGET_DIR)/share/locale
|
|
|
|
rm -rf $(TARGET_DIR)/usr/share/doc
|
2003-02-12 11:40:28 +01:00
|
|
|
|
2003-03-10 21:48:19 +01:00
|
|
|
$(TARGET_DIR)/usr/lib/libbz2.a: $(STAGING_DIR)/lib/libbz2.a
|
2005-04-15 04:19:11 +02:00
|
|
|
mkdir -p $(TARGET_DIR)/usr/include
|
2007-06-25 16:53:24 +02:00
|
|
|
cp $(STAGING_DIR)/usr/include/bzlib.h $(TARGET_DIR)/usr/include/
|
2005-04-15 04:19:11 +02:00
|
|
|
cp $(STAGING_DIR)/lib/libbz2.a $(TARGET_DIR)/usr/lib/
|
2003-03-10 21:48:19 +01:00
|
|
|
rm -f $(TARGET_DIR)/lib/libbz2.so
|
|
|
|
(cd $(TARGET_DIR)/usr/lib; \
|
|
|
|
ln -fs /usr/lib/libbz2.so.1.0 libbz2.so; \
|
|
|
|
)
|
2007-10-01 18:15:31 +02:00
|
|
|
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libbz2.so.1.0
|
2007-06-25 16:53:24 +02:00
|
|
|
touch -c $@
|
2003-02-12 11:40:28 +01:00
|
|
|
|
2003-03-10 21:48:19 +01:00
|
|
|
bzip2-headers: $(TARGET_DIR)/usr/lib/libbz2.a
|
2003-02-12 11:40:28 +01:00
|
|
|
|
2003-03-10 21:48:19 +01:00
|
|
|
bzip2: uclibc $(BZIP2_TARGET_BINARY)
|
2003-02-12 11:40:28 +01:00
|
|
|
|
|
|
|
bzip2-clean:
|
2007-09-17 14:30:31 +02:00
|
|
|
rm -f $(addprefix $(TARGET_DIR),/lib/libbz2.* \
|
|
|
|
/usr/lib/libbz2.* \
|
|
|
|
/usr/include/bzlib.h)
|
|
|
|
rm -f $(addprefix $(STAGING_DIR),/lib/libbz2.* \
|
|
|
|
/usr/lib/libbz2.* \
|
|
|
|
/usr/include/bzlib.h)
|
2003-03-10 21:48:19 +01:00
|
|
|
-$(MAKE) -C $(BZIP2_DIR) clean
|
2003-02-12 11:40:28 +01:00
|
|
|
|
|
|
|
bzip2-dirclean:
|
|
|
|
rm -rf $(BZIP2_DIR)
|
|
|
|
|
2005-02-10 04:06:39 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
ifeq ($(strip $(BR2_PACKAGE_BZIP2)),y)
|
|
|
|
TARGETS+=bzip2
|
|
|
|
endif
|