@@ -14,10 +14,28 @@ if [ "$1" = "distclean" ]; then CLEANONLY=1 DISTCLEAN=1 fi export CLEANONLY DISTCLEAN + +# Determine path to "tclConfig.sh" +TCLCONFIGDIR=$( + ( + echo "${LD_LIBRARY_PATH}" | tr ':' "\n" + cat /etc/ld.so.conf 2>/dev/null + crle 2>/dev/null | grep '^ *Default Library Path' | sed 's@^ *Default Library Path[^:]*:[^:]*/@/@' | tr ':' "\n" + ) | grep '^/' | while read chklibdir; do + if [ -f "${chklibdir}/tclConfig.sh" ]; then + echo "${chklibdir}" + break + fi + done +) +if [ -z "${TCLCONFIGDIR}" ]; then + TCLCONFIGDIR="/usr/lib" +fi +export TCLCONFIGDIR # Build all appropriate directories faileddirs="" for dir in */; do export dir @@ -45,10 +63,15 @@ if [ "${failed}" = "1" ]; then rm -rf "${dir}/out" faileddirs="${faileddirs} ${dir}" fi done + +# Cleanup is done at this point +if [ "${CLEANONLY}" = "1" ]; then + exit 0 +fi # Let the user know what failed to build if [ -n "${faileddirs}" ]; then echo "The following failed to build:${failddirs}" fi