Skip to content

Commit 1a05274

Browse files
committed
Add submodule management to configure script
1 parent 7d741d6 commit 1a05274

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

configure

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,8 @@ for i in \
425425
nd nd/std \
426426
dl \
427427
test/run-pass test/run-fail test/compile-fail \
428-
test/bench test/perf test/pretty
428+
test/bench test/perf test/pretty \
429+
llvm/build llvm/install
429430
do
430431
make_dir $i
431432
done
@@ -466,6 +467,39 @@ do
466467
done
467468
done
468469

470+
471+
# Configure submodules
472+
step_msg "configuring submodules"
473+
474+
# Have to be in the top of src directory for this
475+
cd ${CFG_SRC_DIR}
476+
477+
SUBMODULE_STATUS=$("${CFG_GIT}" submodule status)
478+
NEED_INIT_COUNT=$(echo "$SUBMODULE_STATUS" | grep -c "^-")
479+
NEED_UPDATE_COUNT=$(echo "$SUBMODULE_STATUS" | grep -c "^+")
480+
NEED_INIT=$(test $NEED_INIT_COUNT -gt 0)$?
481+
NEED_UPDATE=$(test "($NEED_INIT)" -o "$NEED_UPDATE_COUNT" -gt 0)$?
482+
483+
if [ $NEED_INIT ]
484+
then
485+
msg "git: submodule init"
486+
${CFG_GIT} submodule init --quiet
487+
fi
488+
489+
if [ $NEED_UPDATE ]
490+
then
491+
msg "git: submodule update"
492+
${CFG_GIT} submodule update --quiet
493+
fi
494+
495+
cd ${CFG_BUILD_DIR}
496+
497+
msg
498+
499+
500+
# Configure llvm
501+
502+
469503
copy ${CFG_SRC_DIR}Makefile.in ./Makefile
470504

471505
step_msg "complete"

0 commit comments

Comments
 (0)