@@ -21,13 +21,15 @@ CONFIGUREEXTRA="$@" export CONFIGUREEXTRA # Determine path to "tclConfig.sh" -rm -rf tcl/build tcl/inst-* -rm -f platform.magic.* rm -rf */out +if [ "${CLEANONLY}" = "1" ]; then + rm -rf tcl/build tcl/inst-* + rm -f platform.magic.* +fi if [ "${DISTCLEAN}" = "1" ]; then rm -rf tcl fi if [ "${CLEANONLY}" = "0" ]; then @@ -37,10 +39,16 @@ for TCLVERS in 8.5.9 8.4.19; do TCLSHORTVERS="$(echo "${TCLVERS}" | cut -f 1-2 -d '.')" TCLPRIVATE="$(pwd)/tcl/build/tcl${TCLVERS}" TCLINSTDIR="$(pwd)/tcl/inst-${TCLSHORTVERS}" export TCLVERS TCLPRIVATE TCLINSTDIR + + if [ -f "${TCLINSTDIR}/lib/tclConfig.sh" ]; then + echo "Skipping build of Tcl ${TCLVERS} (already found)" + + continue + fi mkdir tcl tcl/build >/dev/null 2>/dev/null if [ ! -f "tcl/src/tcl${TCLVERS}.tar.gz" ]; then mkdir tcl/src >/dev/null 2>/dev/null @@ -182,13 +190,10 @@ faileddirs="${faileddirs} ${dir}" echo "Failed to build ${dir}" fi done -# Clean magic-related files -rm -f platform.magic.* - # Cleanup is done at this point if [ "${CLEANONLY}" = "1" ]; then exit 0 fi