28cae90247
Instead of doing some nasty SED tricks, use a patch that modifies the bzip2 build system to make it a little bit nicer. Those SEDs were made differently for the host and target packages, which is contrary to the logic of not having any difference in the source tree between the host build and the target build. This commit also makes sure that bzip2.mk behaves properly in a BR2_PREFER_STATIC_LIB=y context. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
78 lines
2.0 KiB
Makefile
78 lines
2.0 KiB
Makefile
#############################################################
|
|
#
|
|
# bzip2
|
|
#
|
|
#############################################################
|
|
|
|
BZIP2_VERSION = 1.0.6
|
|
BZIP2_SITE = http://www.bzip.org/$(BZIP2_VERSION)
|
|
BZIP2_INSTALL_STAGING = YES
|
|
BZIP2_LICENSE = bzip2 license
|
|
BZIP2_LICENSE_FILES = LICENSE
|
|
|
|
ifeq ($(BR2_PREFER_STATIC_LIB),)
|
|
define BZIP2_BUILD_SHARED_CMDS
|
|
$(TARGET_MAKE_ENV)
|
|
$(MAKE) -C $(@D) -f Makefile-libbz2_so $(TARGET_CONFIGURE_OPTS)
|
|
endef
|
|
endif
|
|
|
|
define BZIP2_BUILD_CMDS
|
|
$(TARGET_MAKE_ENV)
|
|
$(MAKE) -C $(@D) libbz2.a bzip2 bzip2recover $(TARGET_CONFIGURE_OPTS)
|
|
$(BZIP2_BUILD_SHARED_CMDS)
|
|
endef
|
|
|
|
ifeq ($(BR2_PREFER_STATIC_LIB),)
|
|
define BZIP2_INSTALL_STAGING_SHARED_CMDS
|
|
$(TARGET_MAKE_ENV) $(MAKE) \
|
|
-f Makefile-libbz2_so PREFIX=$(STAGING_DIR)/usr -C $(@D) install
|
|
endef
|
|
endif
|
|
|
|
define BZIP2_INSTALL_STAGING_CMDS
|
|
$(TARGET_MAKE_ENV) $(MAKE) \
|
|
PREFIX=$(STAGING_DIR)/usr -C $(@D) install
|
|
$(BZIP2_INSTALL_STAGING_SHARED_CMDS)
|
|
endef
|
|
|
|
ifeq ($(BR2_PREFER_STATIC_LIB),)
|
|
define BZIP2_INSTALL_TARGET_SHARED_CMDS
|
|
$(TARGET_MAKE_ENV) $(MAKE) \
|
|
-f Makefile-libbz2_so PREFIX=$(TARGET_DIR)/usr -C $(@D) install
|
|
endef
|
|
endif
|
|
|
|
# make sure busybox doesn't get overwritten by make install
|
|
define BZIP2_INSTALL_TARGET_CMDS
|
|
rm -f $(addprefix $(TARGET_DIR)/usr/bin/,bzip2 bunzip2 bzcat)
|
|
$(TARGET_MAKE_ENV) $(MAKE) \
|
|
PREFIX=$(TARGET_DIR)/usr -C $(@D) install
|
|
$(BZIP2_INSTALL_TARGET_SHARED_CMDS)
|
|
endef
|
|
|
|
define BZIP2_CLEAN_CMDS
|
|
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)
|
|
-$(MAKE) -C $(@D) clean
|
|
endef
|
|
|
|
define HOST_BZIP2_BUILD_CMDS
|
|
$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) \
|
|
$(MAKE) -C $(@D) -f Makefile-libbz2_so
|
|
$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) \
|
|
$(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
|
|
|
|
$(eval $(generic-package))
|
|
$(eval $(host-generic-package))
|