From 8d7863fad045edff9d9c825b48e72dd022c6fad5 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 28 Nov 2011 17:50:23 -0800 Subject: [PATCH] configure: Add --disable-manage-submodules switch This will keep configure/make from updating submodules, which becomes very annoying when you are working on LLVM --- Makefile.in | 4 ++++ configure | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/Makefile.in b/Makefile.in index 4a2e40b06aa..b9920aa60ad 100644 --- a/Makefile.in +++ b/Makefile.in @@ -340,8 +340,12 @@ endif # Re-configuration ###################################################################### +ifndef CFG_DISABLE_MANAGE_SUBMODULES # This is a pretty expensive operation but I don't see any way to avoid it NEED_GIT_RECONFIG=$(shell cd "$(CFG_SRC_DIR)" && "$(CFG_GIT)" submodule status | grep -c '^\(+\|-\)') +else +NEED_GIT_RECONFIG=0 +endif ifeq ($(NEED_GIT_RECONFIG),0) else diff --git a/configure b/configure index bc904afbeeb..dc539d0af0c 100755 --- a/configure +++ b/configure @@ -253,6 +253,7 @@ opt docs 1 "build documentation" opt optimize 1 "build optimized rust code" opt optimize-cxx 1 "build optimized C++ code" opt optimize-llvm 1 "build optimized LLVM" +opt manage-submodules 1 "let the build manage the git submodules" opt mingw-cross 0 "cross-compile for win32 using mingw" opt clang 0 "prefer gcc to clang for building the runtime" valopt prefix "/usr/local" "set installation prefix" @@ -404,11 +405,17 @@ step_msg "configuring submodules" # Have to be in the top of src directory for this cd ${CFG_SRC_DIR} +if [ -z $CFG_DISABLE_MANAGE_SUBMODULES ] +then SUBMODULE_STATUS=$("${CFG_GIT}" submodule status) NEED_INIT_COUNT=$(echo "$SUBMODULE_STATUS" | grep -c "^-") NEED_UPDATE_COUNT=$(echo "$SUBMODULE_STATUS" | grep -c "^+") NEED_INIT=$(test $NEED_INIT_COUNT -gt 0)$? NEED_UPDATE=$(test "($NEED_INIT)" -o "$NEED_UPDATE_COUNT" -gt 0)$? +else +NEED_INIT= +NEED_UPDATE= +fi if [ $NEED_INIT ] then