2003-02-12 11:40:28 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# bzip2
|
|
|
|
#
|
|
|
|
#############################################################
|
2012-06-08 07:30:46 +02:00
|
|
|
|
|
|
|
BZIP2_VERSION = 1.0.6
|
|
|
|
BZIP2_SITE = http://www.bzip.org/$(BZIP2_VERSION)
|
|
|
|
BZIP2_INSTALL_STAGING = YES
|
2003-03-10 21:48:19 +01:00
|
|
|
|
2010-03-02 22:29:52 +01:00
|
|
|
define BZIP2_FIX_MAKEFILE
|
|
|
|
$(SED) "s,ln \$$(,ln -snf \$$(,g" $(@D)/Makefile
|
2012-06-08 07:30:46 +02:00
|
|
|
$(SED) "s,ln -s (lib.*),ln -snf \$$1; ln -snf libbz2.so.$(BZIP2_VERSION)) \
|
2010-03-02 22:29:52 +01:00
|
|
|
libbz2.so,g" $(@D)/Makefile-libbz2_so
|
|
|
|
$(SED) "s:-O2:$(TARGET_CFLAGS):" $(@D)/Makefile
|
|
|
|
$(SED) "s:-O2:$(TARGET_CFLAGS):" $(@D)/Makefile-libbz2_so
|
|
|
|
endef
|
2003-02-12 11:40:28 +01:00
|
|
|
|
2010-03-02 22:29:52 +01:00
|
|
|
BZIP2_POST_PATCH_HOOKS += BZIP2_FIX_MAKEFILE
|
|
|
|
|
|
|
|
define BZIP2_NOLARGEFILE_FIX_MAKEFILE
|
|
|
|
$(SED) "s,^BIGFILES,#BIGFILES,g" $(@D)/Makefile
|
|
|
|
$(SED) "s,^BIGFILES,#BIGFILES,g" $(@D)/Makefile-libbz2_so
|
|
|
|
endef
|
2003-03-10 21:48:19 +01:00
|
|
|
|
2005-01-23 11:48:46 +01:00
|
|
|
ifneq ($(BR2_LARGEFILE),y)
|
2010-03-02 22:29:52 +01:00
|
|
|
BZIP2_POST_PATCH_HOOKS += BZIP2_NOLARGEFILE_FIX_MAKEFILE
|
2003-12-03 02:16:29 +01:00
|
|
|
endif
|
2003-03-10 21:48:19 +01:00
|
|
|
|
2010-03-02 22:29:52 +01:00
|
|
|
define BZIP2_BUILD_CMDS
|
|
|
|
$(TARGET_MAKE_ENV) \
|
|
|
|
$(MAKE) -C $(@D) -f Makefile-libbz2_so \
|
|
|
|
CC="$(TARGET_CC)" RANLIB="$(TARGET_RANLIB)" AR="$(TARGET_AR)"
|
|
|
|
$(TARGET_MAKE_ENV) \
|
|
|
|
$(MAKE) -C $(@D) \
|
|
|
|
CC="$(TARGET_CC)" RANLIB="$(TARGET_RANLIB)" AR="$(TARGET_AR)" \
|
|
|
|
libbz2.a bzip2 bzip2recover
|
|
|
|
endef
|
|
|
|
|
|
|
|
define BZIP2_INSTALL_STAGING_CMDS
|
2010-12-09 10:55:13 +01:00
|
|
|
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
|
|
|
|
$(MAKE) PREFIX=$(STAGING_DIR)/usr -C $(@D) install
|
|
|
|
$(INSTALL) -m 0755 -d $(STAGING_DIR)/usr/lib
|
2012-06-08 07:30:46 +02:00
|
|
|
cp $(@D)/libbz2.so.$(BZIP2_VERSION) $(STAGING_DIR)/usr/lib/
|
2010-03-02 22:29:52 +01:00
|
|
|
cp $(@D)/libbz2.a $(STAGING_DIR)/usr/lib/
|
2007-09-17 14:30:31 +02:00
|
|
|
(cd $(STAGING_DIR)/usr/lib/; \
|
2012-06-08 07:30:46 +02:00
|
|
|
ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so; \
|
|
|
|
ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so.1.0; \
|
|
|
|
ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so.1; \
|
2007-09-17 14:30:31 +02:00
|
|
|
)
|
2010-03-02 22:29:52 +01:00
|
|
|
endef
|
2003-03-10 21:48:19 +01:00
|
|
|
|
2010-07-07 23:34:32 +02:00
|
|
|
# make sure busybox doesn't get overwritten by make install
|
2010-05-03 15:07:05 +02:00
|
|
|
define BZIP2_INSTALL_TARGET_CMDS
|
2010-07-07 23:34:32 +02:00
|
|
|
rm -f $(addprefix $(TARGET_DIR)/usr/bin/,bzip2 bunzip2 bzcat)
|
2010-03-02 22:29:52 +01:00
|
|
|
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
|
|
|
|
$(MAKE) PREFIX=$(TARGET_DIR)/usr -C $(@D) install
|
2012-06-08 07:30:46 +02:00
|
|
|
cp $(@D)/libbz2.so.$(BZIP2_VERSION) $(TARGET_DIR)/usr/lib/
|
2003-03-10 21:48:19 +01:00
|
|
|
(cd $(TARGET_DIR)/usr/lib; \
|
2012-06-08 07:30:46 +02:00
|
|
|
ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so.1.0; \
|
|
|
|
ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so.1; \
|
|
|
|
ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so; \
|
2007-09-17 14:30:31 +02:00
|
|
|
)
|
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; \
|
|
|
|
)
|
2010-03-02 22:29:52 +01:00
|
|
|
endef
|
2003-02-12 11:40:28 +01:00
|
|
|
|
2010-03-02 22:29:52 +01:00
|
|
|
define BZIP2_CLEAN_CMDS
|
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)
|
2010-03-02 22:29:52 +01:00
|
|
|
-$(MAKE) -C $(@D) clean
|
|
|
|
endef
|
2003-02-12 11:40:28 +01:00
|
|
|
|
2010-03-02 22:29:52 +01:00
|
|
|
define HOST_BZIP2_FIX_MAKEFILE
|
|
|
|
$(SED) "s,ln \$$(,ln -snf \$$(,g" $(@D)/Makefile
|
2012-06-08 07:30:46 +02:00
|
|
|
$(SED) "s,ln -s (lib.*),ln -snf \$$1; ln -snf libbz2.so.$(BZIP2_VERSION) \
|
2010-03-02 22:29:52 +01:00
|
|
|
libbz2.so,g" $(@D)/Makefile-libbz2_so
|
|
|
|
$(SED) "s:-O2:$(HOST_CFLAGS):" $(@D)/Makefile
|
|
|
|
$(SED) "s:-O2:$(HOST_CFLAGS):" $(@D)/Makefile-libbz2_so
|
|
|
|
endef
|
2003-02-12 11:40:28 +01:00
|
|
|
|
2010-03-02 22:29:52 +01:00
|
|
|
HOST_BZIP2_POST_PATCH_HOOKS += HOST_BZIP2_FIX_MAKEFILE
|
|
|
|
|
|
|
|
define HOST_BZIP2_BUILD_CMDS
|
|
|
|
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) -f Makefile-libbz2_so
|
|
|
|
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) libbz2.a bzip2 bzip2recover
|
|
|
|
endef
|
|
|
|
|
|
|
|
define HOST_BZIP2_INSTALL_CMDS
|
|
|
|
$(HOST_MAKE_ENV) \
|
|
|
|
$(MAKE) PREFIX=$(HOST_DIR)/usr -C $(@D) install
|
|
|
|
endef
|
|
|
|
|
2011-09-29 21:57:42 +02:00
|
|
|
$(eval $(call GENTARGETS))
|
2012-02-09 23:25:13 +01:00
|
|
|
$(eval $(call GENTARGETS,host))
|