Browse Source

- add PKG_CHECK_VARIABLES define

master
vanhofen 3 years ago
parent
commit
b86d88fc48
  1. 1
      make/buildsystem-helpers.mk
  2. 10
      package/pkg-autotools.mk
  3. 4
      package/pkg-cmake.mk
  4. 16
      package/pkg-generic.mk
  5. 2
      package/pkg-kernel-module.mk
  6. 58
      package/pkg-utils.mk

1
make/buildsystem-helpers.mk

@ -165,6 +165,7 @@ endef
# prepare for build
define PREPARE
$(eval $(pkg-check-variables))
$(call STARTUP)
$(call DEPENDENCIES)
$(call DOWNLOAD,$($(PKG)_SOURCE))

10
package/pkg-autotools.mk

@ -10,7 +10,7 @@ define AUTORECONF_HOOK
$(call MESSAGE,"Autoreconfiguring"); \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$($(PKG)_AUTORECONF_ENV) \
autoreconf -fi \
$($(PKG)_AUTORECONF_CMD) \
$($(PKG)_AUTORECONF_OPTS); \
fi; \
)
@ -69,10 +69,10 @@ define TARGET_CONFIGURE
$(call AUTORECONF_HOOK)
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
test -f ./configure || ./autogen.sh && \
test -f ./$($(PKG)_CONFIGURE_CMD) || ./autogen.sh && \
CONFIG_SITE=/dev/null \
$(TARGET_CONFIGURE_ENV) $($(PKG)_CONF_ENV) \
./configure \
./$($(PKG)_CONFIGURE_CMD) \
$(TARGET_CONFIGURE_OPTS) $($(PKG)_CONF_OPTS); \
)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
@ -123,10 +123,10 @@ define HOST_CONFIGURE
$(call AUTORECONF_HOOK)
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
test -f ./configure || ./autogen.sh && \
test -f ./$($(PKG)_CONFIGURE_CMD) || ./autogen.sh && \
CONFIG_SITE=/dev/null \
$(HOST_CONFIGURE_ENV) $($(PKG)_CONF_ENV) \
./configure \
./$($(PKG)_CONFIGURE_CMD) \
$(HOST_CONFIGURE_OPTS) $($(PKG)_CONF_OPTS); \
)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))

4
package/pkg-cmake.mk

@ -51,7 +51,7 @@ define TARGET_CMAKE
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
rm -f CMakeCache.txt; \
$(TARGET_CMAKE_ENV) $($(PKG)_CONF_ENV) \
cmake \
$($(PKG)_CMAKE) \
$(TARGET_CMAKE_OPTS) $($(PKG)_CONF_OPTS); \
)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
@ -95,7 +95,7 @@ define HOST_CMAKE
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
rm -f CMakeCache.txt; \
$(HOST_CMAKE_ENV) $($(PKG)_CONF_ENV) \
cmake \
$($(PKG)_CMAKE) \
$(HOST_CMAKE_OPTS) $($(PKG)_CONF_OPTS); \
)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))

16
package/pkg-generic.mk

@ -12,7 +12,7 @@ define TARGET_MAKE
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(TARGET_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$(MAKE) \
$($(PKG)_MAKE) \
$($(PKG)_MAKE_OPTS); \
)
$(foreach hook,$($(PKG)_POST_COMPILE_HOOKS),$(call $(hook))$(sep))
@ -23,9 +23,9 @@ define TARGET_MAKE_INSTALL
$(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(TARGET_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$(MAKE) install DESTDIR=$(TARGET_DIR) \
$($(PKG)_MAKE_OPTS); \
$(TARGET_MAKE_ENV) $($(PKG)_MAKE_INSTALL_ENV) \
$($(PKG)_MAKE) install DESTDIR=$(TARGET_DIR) \
$($(PKG)_MAKE_INSTALL_OPTS); \
)
$(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
endef
@ -49,7 +49,7 @@ define HOST_MAKE
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(HOST_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$(MAKE) \
$($(PKG)_MAKE) \
$($(PKG)_MAKE_OPTS); \
)
$(foreach hook,$($(PKG)_POST_COMPILE_HOOKS),$(call $(hook))$(sep))
@ -60,9 +60,9 @@ define HOST_MAKE_INSTALL
$(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(HOST_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$(MAKE) install \
$($(PKG)_MAKE_OPTS); \
$(HOST_MAKE_ENV) $($(PKG)_MAKE_INSTALL_ENV) \
$($(PKG)_MAKE) install \
$($(PKG)_MAKE_INSTALL_OPTS); \
)
$(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
endef

2
package/pkg-kernel-module.mk

@ -21,7 +21,7 @@ define KERNEL_MODULE_BUILD
@$(call MESSAGE,"Building kernel module")
$(CHDIR)/$($(PKG)_DIR); \
$(TARGET_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$(MAKE) \
$($(PKG)_MAKE) \
$($(PKG)_MAKE_OPTS) $(KERNEL_MAKE_VARS)
endef

58
package/pkg-utils.mk

@ -15,6 +15,64 @@ PKG_PATCHES_DIR = $(PACKAGE_DIR)/$(subst host-,,$(pkgname))/patches
# -----------------------------------------------------------------------------
# check for necessary $(PKG) variables
define PKG_CHECK_VARIABLES
# autoreconf
ifndef $(PKG)_AUTORECONF
$(PKG)_AUTORECONF = NO
endif
ifndef $(PKG)_AUTORECONF_CMD
$(PKG)_AUTORECONF_CMD = autoreconf -fi
endif
ifndef $(PKG)_AUTORECONF_ENV
$(PKG)_AUTORECONF_ENV =
endif
ifndef $(PKG)_AUTORECONF_OPTS
$(PKG)_AUTORECONF_OPTS =
endif
# cmake / configure / meson
ifndef $(PKG)_CMAKE
$(PKG)_CMAKE = cmake
endif
ifndef $(PKG)_CONFIGURE_CMD
$(PKG)_CONFIGURE_CMD = configure
endif
ifndef $(PKG)_CONF_ENV
$(PKG)_CONF_ENV =
endif
ifndef $(PKG)_CONF_OPTS
$(PKG)_CONF_OPTS =
endif
# make
ifndef $(PKG)_MAKE
$(PKG)_MAKE = $(MAKE)
endif
ifndef $(PKG)_MAKE_ENV
$(PKG)_MAKE_ENV =
endif
ifndef $(PKG)_MAKE_OPTS
$(PKG)_MAKE_OPTS =
endif
# make install
ifndef $(PKG)_MAKE_INSTALL_ENV
$(PKG)_MAKE_INSTALL_ENV = $($(PKG)_MAKE_ENV)
endif
ifndef $(PKG)_MAKE_INSTALL_OPTS
$(PKG)_MAKE_INSTALL_OPTS = $($(PKG)_MAKE_OPTS)
endif
# ninja
ifndef $(PKG)_NINJA_ENV
$(PKG)_NINJA_ENV =
endif
ifndef $(PKG)_NINJA_OPTS
$(PKG)_NINJA_OPTS =
endif
endef
pkg-check-variables = $(call PKG_CHECK_VARIABLES)
# -----------------------------------------------------------------------------
# PKG "control-flag" variables
PKG_NO_EXTRACT = pkg-no-extract
PKG_NO_PATCHES = pkg-no-patches

Loading…
Cancel
Save