From 1b1ce789bae0081a93865616d881cba43798beaa Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Wed, 20 Nov 2024 22:06:10 +0100 Subject: [PATCH] make-rules: convert configure.mk to use common-rules.mk --- make-rules/cargo.mk | 5 ++++ make-rules/common-rules.mk | 21 ++++++++++---- make-rules/configure.mk | 71 +++++++++------------------------------------- make-rules/setup.py.mk | 6 ++++ 4 files changed, 40 insertions(+), 63 deletions(-) diff --git a/make-rules/cargo.mk b/make-rules/cargo.mk index 40ff797ace..f430c13586 100644 --- a/make-rules/cargo.mk +++ b/make-rules/cargo.mk @@ -42,8 +42,11 @@ COMPONENT_PREP_ACTION += $(ENV) CARGO_HOME=$(CARGO_ARCHIVES) \ CARGO_ENV += CARGO_HOME=$(@D)/.cargo CARGO_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" +# Configure # Some tests fails with the default symlink cloney mode CLONEY_MODE = copy +# this is needed to override the default set in shared-macros.mk +CONFIG_SHELL = # Build COMPONENT_BUILD_CMD = $(CARGO) build @@ -62,6 +65,8 @@ COMPONENT_INSTALL_ARGS += --force COMPONENT_INSTALL_ARGS += --no-track COMPONENT_INSTALL_ARGS += --offline COMPONENT_INSTALL_ARGS += --locked +# this is needed to override the default set in shared-macros.mk +COMPONENT_INSTALL_TARGETS = COMPONENT_INSTALL_ENV += $(CARGO_ENV) # Test diff --git a/make-rules/common-rules.mk b/make-rules/common-rules.mk index 741bf1708c..d5c33b58e2 100644 --- a/make-rules/common-rules.mk +++ b/make-rules/common-rules.mk @@ -22,18 +22,28 @@ # # -# Common rules used for building, installing, and testing of components. +# Common rules for components # -# build the configured source -$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep +# configure the unpacked source for building +$(BUILD_DIR)/%/.configured: $(SOURCE_DIR)/.prep $(RM) -r $(@D) ; $(MKDIR) $(@D) $(if $(filter none,$(CLONEY_MODE)),,$(ENV) \ $(CLONEY_ARGS) $(CLONEY_MODE:%=CLONEY_MODE="%") \ $(CLONEY) $(SOURCE_DIR) $(@D)) + $(COMPONENT_PRE_CONFIGURE_ACTION) + (cd $(@D)$(COMPONENT_SUBDIR:%=/%) ; $(ENV) $(CONFIGURE_ENV) \ + $(CONFIG_SHELL) \ + $(CONFIGURE_SCRIPT) $(CONFIGURE_OPTIONS)) + $(COMPONENT_POST_CONFIGURE_ACTION) + $(TOUCH) $@ + +# build the configured source +$(BUILD_DIR)/%/.built: $(BUILD_DIR)/%/.configured $(COMPONENT_PRE_BUILD_ACTION) (cd $(@D)$(COMPONENT_SUBDIR:%=/%) ; $(ENV) $(COMPONENT_BUILD_ENV) \ - $(COMPONENT_BUILD_CMD) $(COMPONENT_BUILD_ARGS)) + $(COMPONENT_BUILD_CMD) $(COMPONENT_BUILD_ARGS) \ + $(COMPONENT_BUILD_TARGETS)) $(COMPONENT_POST_BUILD_ACTION) $(TOUCH) $@ @@ -41,7 +51,8 @@ $(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep $(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built $(COMPONENT_PRE_INSTALL_ACTION) (cd $(@D)$(COMPONENT_SUBDIR:%=/%) ; $(ENV) $(COMPONENT_INSTALL_ENV) \ - $(COMPONENT_INSTALL_CMD) $(COMPONENT_INSTALL_ARGS)) + $(COMPONENT_INSTALL_CMD) $(COMPONENT_INSTALL_ARGS) \ + $(COMPONENT_INSTALL_TARGETS)) $(COMPONENT_POST_INSTALL_ACTION) $(TOUCH) $@ diff --git a/make-rules/configure.mk b/make-rules/configure.mk index bb1eb4caa8..046fa96666 100644 --- a/make-rules/configure.mk +++ b/make-rules/configure.mk @@ -172,33 +172,18 @@ CONFIGURE_ENV += $(CONFIGURE_ENV.$(BITS)) CONFIGURE_ENV += "ac_cv_func_realloc_0_nonnull=yes" COMPONENT_BUILD_ENV += "ac_cv_func_realloc_0_nonnull=yes" -# configure the unpacked source for building 32 and 64 bit version +# Configure +CLONEY_MODE = none CONFIGURE_SCRIPT = $(SOURCE_DIR)/configure -$(BUILD_DIR)/%/.configured: $(SOURCE_DIR)/.prep - ($(RM) -rf $(@D) ; $(MKDIR) $(@D)) - $(COMPONENT_PRE_CONFIGURE_ACTION) - (cd $(@D) ; $(ENV) $(CONFIGURE_ENV) $(CONFIG_SHELL) \ - $(CONFIGURE_SCRIPT) $(CONFIGURE_OPTIONS)) - $(COMPONENT_POST_CONFIGURE_ACTION) - $(TOUCH) $@ - -# build the configured source -$(BUILD_DIR)/%/.built: $(BUILD_DIR)/%/.configured - $(COMPONENT_PRE_BUILD_ACTION) - (cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \ - $(GMAKE) $(COMPONENT_BUILD_GMAKE_ARGS) $(COMPONENT_BUILD_ARGS) \ - $(COMPONENT_BUILD_TARGETS)) - $(COMPONENT_POST_BUILD_ACTION) - $(TOUCH) $@ - -# install the built source into a prototype area -$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built - $(COMPONENT_PRE_INSTALL_ACTION) - (cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \ - $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS)) - $(COMPONENT_POST_INSTALL_ACTION) - $(TOUCH) $@ +# Build +COMPONENT_BUILD_CMD = $(GMAKE) +COMPONENT_BUILD_ARGS += $(COMPONENT_BUILD_GMAKE_ARGS) + +# Install +COMPONENT_INSTALL_CMD = $(GMAKE) + +# Test CONFIGURE_TEST_TRANSFORMS = \ '-n ' \ '-e "/TOTAL:/p" ' \ @@ -212,38 +197,8 @@ ifeq ($(strip $(USE_DEFAULT_TEST_TRANSFORMS)),yes) COMPONENT_TEST_TRANSFORMS+= $(CONFIGURE_TEST_TRANSFORMS) endif -# test the built source -$(BUILD_DIR)/%/.tested-and-compared: $(COMPONENT_TEST_DEP) - $(RM) -rf $(COMPONENT_TEST_BUILD_DIR) - $(MKDIR) $(COMPONENT_TEST_BUILD_DIR) - $(COMPONENT_PRE_TEST_ACTION) - -(cd $(COMPONENT_TEST_DIR) ; \ - $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \ - $(COMPONENT_TEST_CMD) \ - $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \ - &> $(COMPONENT_TEST_OUTPUT) - $(COMPONENT_POST_TEST_ACTION) - $(COMPONENT_TEST_CREATE_TRANSFORMS) - $(COMPONENT_TEST_PERFORM_TRANSFORM) - $(COMPONENT_TEST_COMPARE) - $(COMPONENT_TEST_CLEANUP) - $(TOUCH) $@ - -$(BUILD_DIR)/%/.tested: SHELLOPTS=pipefail -$(BUILD_DIR)/%/.tested: $(COMPONENT_TEST_DEP) - $(RM) -rf $(COMPONENT_TEST_BUILD_DIR) - $(MKDIR) $(COMPONENT_TEST_BUILD_DIR) - $(COMPONENT_PRE_TEST_ACTION) - (cd $(COMPONENT_TEST_DIR) ; \ - $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \ - $(COMPONENT_TEST_CMD) \ - $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \ - |& $(TEE) $(COMPONENT_TEST_OUTPUT) - $(COMPONENT_POST_TEST_ACTION) - $(COMPONENT_TEST_CREATE_TRANSFORMS) - $(COMPONENT_TEST_PERFORM_TRANSFORM) - $(COMPONENT_TEST_CLEANUP) - $(TOUCH) $@ - clean:: $(RM) -r $(BUILD_DIR) $(PROTO_DIR) + +# Use common rules +USE_COMMON_RULES = yes diff --git a/make-rules/setup.py.mk b/make-rules/setup.py.mk index cfa0670590..ed6cf8eaab 100644 --- a/make-rules/setup.py.mk +++ b/make-rules/setup.py.mk @@ -176,6 +176,9 @@ $(foreach pyver,$(filter-out $(PYTHON_VERSION),$(PYTHON_VERSIONS)),$(eval $(call # where egg-info is re-generated CLONEY_ARGS = CLONEY_MODE="copy" +# this is needed to override the default set in shared-macros.mk +CONFIG_SHELL = + COMPONENT_BUILD_CMD = $(PYTHON) setup.py --no-user-cfg build $(COMPONENT_BUILD_SETUP_PY_ARGS) @@ -187,6 +190,9 @@ COMPONENT_INSTALL_ARGS += --install-data=$(PYTHON_DATA) COMPONENT_INSTALL_ARGS += --skip-build COMPONENT_INSTALL_ARGS += --force +# this is needed to override the default set in shared-macros.mk +COMPONENT_INSTALL_TARGETS = + ifeq ($(strip $(SINGLE_PYTHON_VERSION)),no) # Rename binaries in /usr/bin to contain version number COMPONENT_POST_INSTALL_ACTION += \ -- 2.11.4.GIT