Diff

Differences From Artifact [feba34159a]:

To Artifact [5e7c9aafc7]:


    32     32   	rm -rf tcl
    33     33   fi
    34     34   
    35     35   if [ "${CLEANONLY}" = "0" ]; then
    36     36   	PROJROOTDIR="$(pwd)"
    37     37   	export PROJROOTDIR
    38     38   
    39         -	for TCLVERS in 8.5.9 8.4.19; do
           39  +	for TCLVERS in 8.5.10 8.4.19; do
    40     40   		TCLSHORTVERS="$(echo "${TCLVERS}" | cut -f 1-2 -d '.')"
    41     41   		TCLPRIVATE="$(pwd)/tcl/build/tcl${TCLVERS}"
    42     42   		TCLINSTDIR="$(pwd)/tcl/inst-${TCLSHORTVERS}"
    43     43   		export TCLVERS TCLPRIVATE TCLINSTDIR
    44     44   
    45     45   		if [ -f "${TCLINSTDIR}/lib/tclConfig.sh" ]; then
    46     46   			echo "Skipping build of Tcl ${TCLVERS} (already found)"
    47     47   
    48     48   			continue
    49     49   		fi
    50     50   
    51     51   		mkdir tcl tcl/build >/dev/null 2>/dev/null
           52  +
           53  +		# Clean this up so that other platforms don't use it
           54  +		rm -f "${PROJROOTDIR}/platform.magic.dir"
    52     55   
    53     56   		if [ ! -f "tcl/src/tcl${TCLVERS}.tar.gz" ]; then
    54     57   			mkdir tcl/src >/dev/null 2>/dev/null
    55     58   			wget -o /dev/null -O "tcl/src/tcl${TCLVERS}.tar.gz" "http://prdownloads.sourceforge.net/tcl/tcl${TCLVERS}-src.tar.gz"
    56     59   		fi
    57     60   
    58     61   		echo "Building Tcl ${TCLVERS}"
    59     62   		(
    60     63   			mkdir tcl/build >/dev/null 2>/dev/null
    61     64   			cd tcl/build || exit 1
    62     65   			gzip -dc "../src/tcl${TCLVERS}.tar.gz" | tar -xf -
    63     66   
    64         -			# DDE and Reg can fail to compile, but we don't care
           67  +			# Source fix-ups
           68  +			## DDE and Reg can fail to compile, but we don't care
    65     69   			echo '' > "${TCLPRIVATE}/win/tclWinDde.c"
    66     70   			echo '' > "${TCLPRIVATE}/win/tclWinReg.c"
    67     71   
           72  +			## Long-standing bug in Tcl
           73  +			echo '#undef strtod' > "${TCLPRIVATE}/compat/strtod.c.new"
           74  +			cat "${TCLPRIVATE}/compat/strtod.c" >> "${TCLPRIVATE}/compat/strtod.c.new"
           75  +			cat "${TCLPRIVATE}/compat/strtod.c.new" > "${TCLPRIVATE}/compat/strtod.c"
           76  +			rm -f "${TCLPRIVATE}/compat/strtod.c.new"
           77  +
    68     78   			for dir in unix win macosx; do
    69     79   				cd "${TCLPRIVATE}/${dir}" || exit 1
    70     80   
    71     81   				echo " Executing: ./configure --enable-threads ${CONFIGUREEXTRA} --prefix=\"${TCLINSTDIR}\""
    72     82   				./configure --enable-threads ${CONFIGUREEXTRA} --prefix="${TCLINSTDIR}"
    73     83   
    74     84   				echo " Executing: ${MAKE:-make}"
    75         -				${MAKE:-make} || continue
           85  +				${MAKE:-make} || (
           86  +					rm -f tclConfig.sh
           87  +
           88  +					exit 1
           89  +				) || continue
           90  +
           91  +				## Kludge to make Tcl install when cross-compiling.
           92  +				sed 's@^${TCL_EXE}@blah@' Makefile > Makefile.new
           93  +				cat Makefile.new > Makefile
           94  +				rm -f Makefile.new
    76     95   
    77     96   				echo " Executing: ${MAKE:-make} install"
    78         -				${MAKE:-make} install || break
           97  +				${MAKE:-make} install TCL_EXE="../../../../../../../../../../../../../../../../../$(which "${TCLSH_NATIVE:-tclsh}")" || break
    79     98   
    80     99   				LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}"
    81    100   				LD_RUN_PATH=".:${LD_RUN_PATH}"
    82    101   				export LD_LIBRARY_PATH LD_RUN_PATH
    83    102   
    84    103   				file tclsh tclsh*.exe 2>/dev/null | grep -iv 'No such file' > "${PROJROOTDIR}/platform.magic.file"
    85    104   				if [ -f tclsh*.exe ]; then
................................................................................
    98    117   			echo "Failed to build Tcl.  See \"./tcl/build/build-${TCLVERS}.log\"" >&2
    99    118   			echo 'Aborting.' >&2
   100    119   
   101    120   			exit 1
   102    121   		) || exit 1
   103    122   
   104    123   		(
          124  +			rm -f "${PROJROOTDIR}/platform.magic.env-${TCLSHORTVERS}"
          125  +
   105    126   			TCLBUILDDIR="$(cat "${PROJROOTDIR}/platform.magic.dir")"
   106    127   			export TCLBUILDDIR
          128  +
          129  +			if [ -z "${TCLBUILDDIR}" ]; then
          130  +				TCLBUILDDIR="/dev/null"
          131  +			fi
   107    132   
   108    133   			if [ -d "${TCLINSTDIR}" -a -f "${TCLINSTDIR}/lib/tclConfig.sh" ]; then
   109    134   				TCLCONFIGDIR="${TCLINSTDIR}/lib"
   110    135   			elif [ -d "${TCLBUILDDIR}" -a -f "${TCLBUILDDIR}/tclConfig.sh" ]; then
   111    136   				TCLCONFIGDIR="${TCLBUILDDIR}"
   112    137   			else
   113    138   				echo 'Unable to find appropriate tclConfig.sh, aborting' >&2