Add submodule management to configure script

This commit is contained in:
Brian Anderson 2011-10-31 16:51:15 -07:00
parent 7d741d69cb
commit 1a05274738

36
configure vendored
View File

@ -425,7 +425,8 @@ for i in \
nd nd/std \
dl \
test/run-pass test/run-fail test/compile-fail \
test/bench test/perf test/pretty
test/bench test/perf test/pretty \
llvm/build llvm/install
do
make_dir $i
done
@ -466,6 +467,39 @@ do
done
done
# Configure submodules
step_msg "configuring submodules"
# Have to be in the top of src directory for this
cd ${CFG_SRC_DIR}
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)$?
if [ $NEED_INIT ]
then
msg "git: submodule init"
${CFG_GIT} submodule init --quiet
fi
if [ $NEED_UPDATE ]
then
msg "git: submodule update"
${CFG_GIT} submodule update --quiet
fi
cd ${CFG_BUILD_DIR}
msg
# Configure llvm
copy ${CFG_SRC_DIR}Makefile.in ./Makefile
step_msg "complete"