kumquat-buildroot/package/bzip2/bzip2.mk
Thomas Petazzoni 665e13c85e Rename BR2_PREFER_STATIC_LIB to BR2_STATIC_LIBS
Since a while, the semantic of BR2_PREFER_STATIC_LIB has been changed
from "prefer static libraries when possible" to "use only static
libraries". The former semantic didn't make much sense, since the user
had absolutely no control/idea of which package would use static
libraries, and which packages would not. Therefore, for quite some
time, we have been starting to enforce that BR2_PREFER_STATIC_LIB
should really build everything with static libraries.

As a consequence, this patch renames BR2_PREFER_STATIC_LIB to
BR2_STATIC_LIBS, and adjust the Config.in option accordingly.

This also helps preparing the addition of other options to select
shared, shared+static or just static.

Note that we have verified that this commit can be reproduced by
simply doing a global rename of BR2_PREFER_STATIC_LIB to
BR2_STATIC_LIBS plus adding BR2_PREFER_STATIC_LIB to Config.in.legacy.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2014-12-11 22:48:13 +01:00

70 lines
1.9 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_STATIC_LIBS),)
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_STATIC_LIBS),)
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_STATIC_LIBS),)
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 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
$(HOST_MAKE_ENV) \
$(MAKE) -f Makefile-libbz2_so PREFIX=$(HOST_DIR)/usr -C $(@D) install
endef
$(eval $(generic-package))
$(eval $(host-generic-package))