Diff

Differences From Artifact [15de613872]:

To Artifact [9916a29d8c]:


     1      1   #! /bin/bash
     2      2   
     3      3   TCLVERS="8.4.19"
     4         -if echo "$1" | grep '^[0-9][0-9]*\.' >/dev/null || echo "$1" | grep '^cvs_' >/dev/null; then
            4  +if echo "$1" | grep '^[0-9][0-9]*\.' >/dev/null || echo "$1" | egrep '^(cvs|fossil)_' >/dev/null; then
     5      5   	TCLVERS="$1"
     6      6   
     7      7   	shift
     8      8   fi
     9      9   export TCLVERS
    10     10   
    11     11   # Determine appropriate mode
................................................................................
    18     18   if [ "$1" = "distclean" ]; then
    19     19   	shift
    20     20   
    21     21   	mode="distclean"
    22     22   fi
    23     23   
    24     24   # Define the list of all packages, for cleaning purposes
    25         -KITCREATOR_ALLPKGS="kitsh tcl tclvfs zlib tk itcl mk4tcl thread kitdll"
           25  +KITCREATOR_ALLPKGS="kitsh tcl tclvfs zlib tk itcl mk4tcl thread"
    26     26   for pkg in ${KITCREATOR_ALLPKGS}; do
    27     27   	rm -f "${pkg}/build.log"
    28     28   	rm -rf "${pkg}/out" "${pkg}/inst" "${pkg}/build"
           29  +
           30  +	rm -rf "${pkg}/src"/tmp-*
    29     31   
    30     32   	if [ "${mode}" = "distclean" ]; then
    31     33   		rm -rf "${pkg}/src"
    32     34   	fi
    33     35   done
    34     36   
    35     37   # We're all done if we're in clean or distclean mode
................................................................................
    58     60   
    59     61   # Fix up package list
    60     62   ## If building KitDLL, define it as our target
    61     63   if echo " ${KITCREATOR_PKGS} " | grep ' kitdll ' >/dev/null 2>/dev/null; then
    62     64   	KITCREATOR_PKGS="$(echo " ${KITCREATOR_PKGS} " | sed 's@ kitdll @ @g;s@^  *@@;s@  *$@@;s@   *@ @g')"
    63     65   	KITTARGET="kitdll"
    64     66   fi
           67  +
           68  +# If the user manually requested "--enable-kitdll", make it so
           69  +if echo "x $@ " | grep ' [-][-]enable-kitdll ' >/dev/null 2>/dev/null; then
           70  +	KITTARGET="kitdll"
           71  +fi
    65     72   
    66     73   ## If building KitDLL and Tk, must do Tk statically
    67     74   ### (Well, we don't HAVE to, but it would defeat much of the purpose)
    68     75   if [ "${KITTARGET}" = "kitdll" ]; then
    69     76   	if echo " ${KITCREATOR_PKGS} " | grep ' tk ' >/dev/null 2>/dev/null; then
    70     77   		if [ "${STATICTK}" != "1" -a "${STATICTK}" != "-1" ]; then
    71     78   			echo 'Warning: Linking Tk statically because you are building KitDLL' 2>&1
................................................................................
    81     88   
    82     89   			STATICMK4="0"
    83     90   			export STATICMK4
    84     91   		fi
    85     92   	fi
    86     93   fi
    87     94   
           95  +# Find Windows resource-related files
           96  +if [ -f "kit.ico" ]; then
           97  +	KITCREATOR_ICON="$(pwd)/kit.ico"
           98  +else
           99  +	KITCREATOR_ICON="$(echo "$(pwd)/kitsh/buildsrc"/kitsh-*/kit.ico)"
          100  +fi
          101  +if [ -f "kit.rc" ]; then
          102  +	KITCREATOR_RC="$(pwd)/kit.rc"
          103  +else
          104  +	KITCREATOR_RC="$(echo "$(pwd)/kitsh/buildsrc"/kitsh-*/kit.rc)"
          105  +fi
          106  +export KITCREATOR_ICON KITCREATOR_RC
          107  +
          108  +# Determine how we invoke a Tcl interpreter
          109  +if [ -z "${TCLSH_NATIVE}" ]; then
          110  +	TCLSH_NATIVE="false"
          111  +fi
          112  +for testsh in "${TCLSH_NATIVE}" tclsh tclsh8.4 tclsh8.5 tclsh8.6 "${TCLKIT:-tclkit}"; do
          113  +	if echo 'exit 0' | "${testsh}" >/dev/null 2>/dev/null; then
          114  +		TCLSH_NATIVE="${testsh}"
          115  +
          116  +		break
          117  +	fi
          118  +done
          119  +export TCLSH_NATIVE
          120  +
          121  +# Do build
    88    122   failedpkgs=""
    89    123   buildfailed="0"
    90         -for pkg in tcl tclvfs zlib ${KITCREATOR_PKGS} "${KITTARGET}"; do
          124  +for pkg in tcl tclvfs zlib ${KITCREATOR_PKGS} kitsh; do
    91    125   	echo -n "Building ${pkg} ..."
    92    126   
    93    127   	failed="0"
    94    128   	(
    95    129   		cd "${pkg}" >/dev/null 2>/dev/null || exit 1
    96    130   
    97    131   		./build.sh > build.log 2>&1 || exit 1
................................................................................
   120    154   	echo "Failed to build:${failedpkgs}"
   121    155   fi
   122    156   
   123    157   if [ "${buildfailed}" != "0" ]; then
   124    158   	echo 'WARNING: Build is likely incomplete or failed.' >&2
   125    159   fi
   126    160   
   127         -cp 'kitdll/build'/kitdll-*/libtclkit* . >/dev/null 2>/dev/null
          161  +cp 'kitsh/build'/kitsh-*/libtclkit* . >/dev/null 2>/dev/null
   128    162   cp 'kitsh/build'/kitsh-*/kit "tclkit-${TCLVERS}" >/dev/null 2>/dev/null
   129    163   
   130    164   exit "${buildfailed}"