Browse Source

- add $(PKG)_CONFIGURE_CMDS

master
vanhofen 3 years ago
parent
commit
453ef9b48f
  1. 32
      package/pkg-autotools.mk
  2. 10
      package/pkg-utils.mk

32
package/pkg-autotools.mk

@ -63,18 +63,20 @@ TARGET_CONFIGURE_OPTS = \
--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)( \
define TARGET_CONFIGURE_CMDS
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
test -f ./$($(PKG)_CONFIGURE_CMD) || ./autogen.sh && \
CONFIG_SITE=/dev/null \
$(TARGET_CONFIGURE_ENV) $($(PKG)_CONF_ENV) \
./$($(PKG)_CONFIGURE_CMD) \
$(TARGET_CONFIGURE_OPTS) $($(PKG)_CONF_OPTS); \
)
$(TARGET_CONFIGURE_OPTS) $($(PKG)_CONF_OPTS)
endef
define TARGET_CONFIGURE
@$(call MESSAGE,"Configuring")
$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
$(call AUTORECONF_HOOK)
$(Q)$(call $(PKG)_CONFIGURE_CMDS)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
endef
@ -117,18 +119,20 @@ 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)( \
define HOST_CONFIGURE_CMDS
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
test -f ./$($(PKG)_CONFIGURE_CMD) || ./autogen.sh && \
CONFIG_SITE=/dev/null \
$(HOST_CONFIGURE_ENV) $($(PKG)_CONF_ENV) \
./$($(PKG)_CONFIGURE_CMD) \
$(HOST_CONFIGURE_OPTS) $($(PKG)_CONF_OPTS); \
)
$(HOST_CONFIGURE_OPTS) $($(PKG)_CONF_OPTS)
endef
define HOST_CONFIGURE
@$(call MESSAGE,"Configuring")
$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
$(call AUTORECONF_HOOK)
$(Q)$(call $(PKG)_CONFIGURE_CMDS)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
endef

10
package/pkg-utils.mk

@ -13,6 +13,9 @@ PKG_BUILD_DIR = $(BUILD_DIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR)
PKG_FILES_DIR = $(PACKAGE_DIR)/$(subst host-,,$(pkgname))/files
PKG_PATCHES_DIR = $(PACKAGE_DIR)/$(subst host-,,$(pkgname))/patches
PKG_HOST_PACKAGE = $(if $(filter $(firstword $(subst -, ,$(pkg))),host),YES,NO)
PKG_TARGET_PACKAGE = $(if $(filter $(PKG_HOST_PACKAGE),NO),YES,NO)
# -----------------------------------------------------------------------------
# check for necessary $(PKG) variables
@ -47,6 +50,13 @@ endif
ifndef $(PKG)_CONFIGURE_CMD
$(PKG)_CONFIGURE_CMD = configure
endif
ifndef $(PKG)_CONFIGURE_CMDS
ifeq ($(PKG_HOST_PACKAGE),YES)
$(PKG)_CONFIGURE_CMDS = $$(HOST_CONFIGURE_CMDS)
else
$(PKG)_CONFIGURE_CMDS = $$(TARGET_CONFIGURE_CMDS)
endif
endif
ifndef $(PKG)_CONF_ENV
$(PKG)_CONF_ENV =
endif

Loading…
Cancel
Save