aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDan Streetman <ddstreet@canonical.com>2021-01-19 12:20:46 -0500
committerDaniel P. Berrangé <berrange@redhat.com>2021-01-29 17:07:53 +0000
commit7d7dbf9dc15be6e1465c756c2c5ae7f1ab104fc8 (patch)
tree9e7c34e8604e35dd187704799341fbaf0a1c5944 /Makefile
parentf029f9112257c9a0e669c2955e8ace21a96704c1 (diff)
configure: replace --enable/disable-git-update with --with-git-submodules
Replace the --enable-git-update and --disable-git-update configure params with the param --with-git-submodules=(update|validate|ignore) to allow 3 options for building from a git repo. This is needed because downstream packagers, e.g. Debian, Ubuntu, etc, also keep the source code in git, but do not want to enable the 'git_update' mode; with the current code, that's not possible even if the downstream package specifies --disable-git-update. The previous parameters are deprecated but still available; the --enable-git-update parameter maps to --with-git-submodules=update and --disable-git-update parameter maps to --with-git-submodules=validate. The configure script behavior is slightly modified, where previously the dtc, capstone, and slirp submodules were not validated when --disable-git-update was specified (but were updated with git-update enabled), now they are validated when using --with-git-submodules=validate and are only ignored when using --with-git-submodules=ignore. Signed-off-by: Dan Streetman <ddstreet@canonical.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 2 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 291ea19f2e..b0dff73904 100644
--- a/Makefile
+++ b/Makefile
@@ -47,30 +47,10 @@ git-submodule-update:
Makefile: .git-submodule-status
.PHONY: git-submodule-update
-
-git_module_status := $(shell \
- cd '$(SRC_PATH)' && \
- GIT="$(GIT)" ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \
- echo $$?; \
-)
-
-ifeq (1,$(git_module_status))
-ifeq (no,$(GIT_UPDATE))
git-submodule-update:
$(call quiet-command, \
- echo && \
- echo "GIT submodule checkout is out of date. Please run" && \
- echo " scripts/git-submodule.sh update $(GIT_SUBMODULES)" && \
- echo "from the source directory checkout $(SRC_PATH)" && \
- echo && \
- exit 1)
-else
-git-submodule-update:
- $(call quiet-command, \
- (cd $(SRC_PATH) && GIT="$(GIT)" ./scripts/git-submodule.sh update $(GIT_SUBMODULES)), \
- "GIT","$(GIT_SUBMODULES)")
-endif
-endif
+ (GIT="$(GIT)" "$(SRC_PATH)/scripts/git-submodule.sh" $(GIT_SUBMODULES_ACTION) $(GIT_SUBMODULES)), \
+ "GIT","$(GIT_SUBMODULES)")
# 0. ensure the build tree is okay