Diff

Differences From Artifact [62bff14932]:

To Artifact [af64eaf700]:


    19     19   fi
    20     20   export CLEANONLY DISTCLEAN
    21     21   
    22     22   CONFIGUREEXTRA="$@"
    23     23   export CONFIGUREEXTRA
    24     24   
    25     25   # Determine path to "tclConfig.sh"
    26         -rm -rf tcl/build
           26  +rm -rf tcl/build tcl/inst
    27     27   rm -f platform.magic.*
    28     28   if [ "${DISTCLEAN}" = "1" ]; then
    29     29   	rm -rf tcl
    30     30   fi
    31     31   
    32     32   if [ "${CLEANONLY}" = "0" ]; then
    33     33   	TCLVERS="8.4.19"
    34     34   	TCLPRIVATE="$(pwd)/tcl/build/tcl${TCLVERS}"
    35     35   	PROJROOTDIR="$(pwd)"
    36         -	export TCLVERS TCLPRIVATE PROJROOTDIR
           36  +	TCLINSTDIR="$(pwd)/tcl/inst"
           37  +	export TCLVERS TCLPRIVATE PROJROOTDIR TCLINSTDIR
    37     38   
    38     39   	mkdir tcl tcl/build >/dev/null 2>/dev/null
    39     40   
    40     41   	if [ ! -f "tcl/src/tcl${TCLVERS}.tar.gz" ]; then
    41     42   		mkdir tcl/src >/dev/null 2>/dev/null
    42     43   		wget -o /dev/null -O "tcl/src/tcl${TCLVERS}.tar.gz" "http://prdownloads.sourceforge.net/tcl/tcl${TCLVERS}-src.tar.gz"
    43     44   	fi
................................................................................
    48     49   		cd tcl/build || exit 1
    49     50   		gzip -dc "../src/tcl${TCLVERS}.tar.gz" | tar -xf -
    50     51   
    51     52   		for dir in unix win macosx; do
    52     53   			cd "${TCLPRIVATE}/${dir}" || exit 1
    53     54   
    54     55   			echo " Executing: ./configure ${CONFIGUREEXTRA}"
    55         -			./configure --disable-threads ${CONFIGUREEXTRA}
           56  +			./configure --disable-threads ${CONFIGUREEXTRA} --prefix="${TCLINSTDIR}"
    56     57   
    57     58   			${MAKE:-make} || continue
           59  +			${MAKE:-make} install || break
    58     60   
    59     61   			LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}"
    60     62   			LD_RUN_PATH=".:${LD_RUN_PATH}"
    61     63   			export LD_LIBRARY_PATH LD_RUN_PATH
    62     64   
    63     65   			file tclsh tclsh*.exe 2>/dev/null | grep -iv 'No such file' > "${PROJROOTDIR}/platform.magic.file"
    64     66   			if [ -f tclsh*.exe ]; then
................................................................................
    75     77   		echo 'Failed to build Tcl.  See "./tcl/build/build.log"'
    76     78   		echo 'Proceeding with system Tcl.  Building might fail.'
    77     79   	)
    78     80   
    79     81   	TCLBUILDDIR="$(cat "${PROJROOTDIR}/platform.magic.dir")"
    80     82   	export TCLBUILDDIR
    81     83   
    82         -	if [ -d "${TCLBUILDDIR}" -a -f "${TCLBUILDDIR}/tclConfig.sh" ]; then
           84  +	if [ -d "${TCLINSTDIR}" -a -f "${TCLINSTDIR}/lib/tclConfig.sh" ]; then
           85  +		TCLCONFIGDIR="${TCLINSTDIR}/lib"
           86  +	elif [ -d "${TCLBUILDDIR}" -a -f "${TCLBUILDDIR}/tclConfig.sh" ]; then
    83     87   		TCLCONFIGDIR="${TCLBUILDDIR}"
    84     88   	else
    85     89   		unset TCLPRIVATE
    86     90   
    87     91   		TCLCONFIGDIR=$(
    88     92   			(
    89     93   				echo "${LD_LIBRARY_PATH}" | tr ':' "\n"
................................................................................
    99    103   		if [ -z "${TCLCONFIGDIR}" ]; then
   100    104   			TCLCONFIGDIR="/usr/lib"
   101    105   		fi
   102    106   
   103    107   		TCLPRIVATE="$(dirname "${TCLCONFIGDIR}")/include/tcl-private"
   104    108   	fi
   105    109   
   106         -	ADDFLAGS="-I${TCLPRIVATE} -I${TCLPRIVATE}/generic -I${TCLBUILDDIR}"
          110  +	ADDFLAGS=""
          111  +	if [ -n "${TCLPRIVATE}" ]; then
          112  +		ADDFLAGS="${ADDFLAGS} -I${TCLPRIVATE} -I${TCLPRIVATE}/generic"
          113  +	fi
          114  +	if [ -n "${TCLBUILDDIR}" ]; then
          115  +		ADDFLAGS="${ADDFLAGS} -I${TCLBUILDDIR}"
          116  +	fi
   107    117   	CFLAGS="${ADDFLAGS} ${CFLAGS}"
   108    118   	CPPFLAGS="${ADDFLAGS} ${CPPFLAGS}"
   109    119   
   110    120   	unset TCLVERS
   111    121   	unset ADDFLAGS
   112         -	unset TCLBUILDDIR
   113         -	export TCLCONFIGDIR TCLPRIVATE CFLAGS CPPFLAGS
          122  +	export TCLBUILDDIR TCLCONFIGDIR TCLPRIVATE CFLAGS CPPFLAGS
   114    123   fi
   115    124   
   116    125   # Determine platform
   117    126   if [ -z "${FORCE_PLATFORM}" ]; then
   118    127   	PLATFORM="$(./platform)"
   119    128   	export PLATFORM
   120    129   else