You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

131 lines
3.5 KiB

################################################################################
#
# Autotools packages
#
################################################################################
define AUTORECONF_HOOK
$(Q)( \
if [ "$($(PKG)_AUTORECONF)" == "YES" ]; then \
$(call MESSAGE,"Autoreconfiguring"); \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$($(PKG)_AUTORECONF_ENV) \
autoreconf -fi \
$($(PKG)_AUTORECONF_OPTS); \
fi; \
)
endef
# -----------------------------------------------------------------------------
TARGET_CONFIGURE_ENVIRONMENT = \
CROSS_COMPILE="$(TARGET_CROSS)" \
CC="$(TARGET_CC)" \
GCC="$(TARGET_CC)" \
CPP="$(TARGET_CPP)" \
CXX="$(TARGET_CXX)" \
LD="$(TARGET_LD)" \
AR="$(TARGET_AR)" \
AS="$(TARGET_AS)" \
NM="$(TARGET_NM)" \
OBJCOPY="$(TARGET_OBJCOPY)" \
OBJDUMP="$(TARGET_OBJDUMP)" \
RANLIB="$(TARGET_RANLIB)" \
READELF="$(TARGET_READELF)" \
STRIP="$(TARGET_STRIP)" \
ARCH=$(TARGET_ARCH)
TARGET_CONFIGURE_ENV += \
$(TARGET_CONFIGURE_ENVIRONMENT) \
CFLAGS="$(TARGET_CFLAGS)" \
CPPFLAGS="$(TARGET_CPPFLAGS)" \
CXXFLAGS="$(TARGET_CXXFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)"
TARGET_CONFIGURE_ENV += \
PKG_CONFIG=$(PKG_CONFIG) \
PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" \
PKG_CONFIG_SYSROOT_DIR=$(PKG_CONFIG_SYSROOT_DIR)
TARGET_CONFIGURE_OPTS = \
--build=$(GNU_HOST_NAME) \
--host=$(TARGET) \
--target=$(TARGET) \
\
--program-prefix="" \
--program-suffix="" \
\
--prefix=$(prefix) \
--exec_prefix=$(exec_prefix) \
--sysconfdir=$(sysconfdir) \
--localstatedir=$(localstatedir) \
\
--mandir=$(REMOVE_mandir) \
--infodir=$(REMOVE_infodir)
define TARGET_CONFIGURE
@$(call MESSAGE,"Configuring")
$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
$(call AUTORECONF_HOOK)
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
test -f ./configure || ./autogen.sh && \
CONFIG_SITE=/dev/null \
$(TARGET_CONFIGURE_ENV) $($(PKG)_CONF_ENV) \
./configure \
$(TARGET_CONFIGURE_OPTS) $($(PKG)_CONF_OPTS); \
)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
endef
# -----------------------------------------------------------------------------
define autotools-package
$(call PREPARE,$(1))
$(call TARGET_CONFIGURE)
$(if $(filter $(1),$(PKG_NO_BUILD)),,$(call TARGET_MAKE))
$(if $(filter $(1),$(PKG_NO_INSTALL)),,$(call TARGET_MAKE_INSTALL))
$(call TARGET_FOLLOWUP)
endef
# -----------------------------------------------------------------------------
HOST_CONFIGURE_ENV = \
$(HOST_MAKE_OPTS) \
CFLAGS="$(HOST_CFLAGS)" \
CPPFLAGS="$(HOST_CPPFLAGS)" \
CXXFLAGS="$(HOST_CXXFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)"
HOST_CONFIGURE_ENV += \
PKG_CONFIG=/usr/bin/pkg-config \
PKG_CONFIG_LIBDIR="$(HOST_DIR)/lib/pkgconfig"
HOST_CONFIGURE_OPTS = \
--prefix=$(HOST_DIR) \
--sysconfdir=$(HOST_DIR)/etc
define HOST_CONFIGURE
@$(call MESSAGE,"Configuring")
$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
$(call AUTORECONF_HOOK)
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
test -f ./configure || ./autogen.sh && \
CONFIG_SITE=/dev/null \
$(HOST_CONFIGURE_ENV) $($(PKG)_CONF_ENV) \
./configure \
$(HOST_CONFIGURE_OPTS) $($(PKG)_CONF_OPTS); \
)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
endef
# -----------------------------------------------------------------------------
define host-autotools-package
$(call PREPARE,$(1))
$(call HOST_CONFIGURE)
$(if $(filter $(1),$(PKG_NO_BUILD)),,$(call HOST_MAKE))
$(if $(filter $(1),$(PKG_NO_INSTALL)),,$(call HOST_MAKE_INSTALL))
$(call HOST_FOLLOWUP)
endef