Check-in [2dbaa7246a]
Overview
Comment:Added Tk support

Added wish test driver

Fixed issue with stripping KitDLL

Minor cleanup

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:2dbaa7246ac0efe038eb6283dd787b87f883eb32
User & Date: rkeene on 2010-09-30 09:25:08
Other Links: manifest | tags
References
2010-09-30
09:41 Ticket [faa590a5fa] Create KitDLL status still Verified with 1 other change artifact: 9f2565a9d0 user: rkeene
Context
2010-09-30
16:19
Fixed issue with globbing a single file or directory check-in: b358be54cd user: rkeene tags: trunk
09:25
Added Tk support

Added wish test driver

Fixed issue with stripping KitDLL

Minor cleanup check-in: 2dbaa7246a user: rkeene tags: trunk

08:26
Renamed KitDLL library from libtcl to libtclkit check-in: bec59f252e user: rkeene tags: trunk
Changes

Modified kitdll/build.sh from [1a4467c4d3] to [47f9c339e5].

    62     62   	rm -rf "starpack.vfs"
    63     63   
    64     64   	# Create VFS directory
    65     65   	mkdir "starpack.vfs"
    66     66   	mkdir "starpack.vfs/lib"
    67     67   
    68     68   	## Copy in required built directories
    69         -	cp -r "${OTHERPKGSDIR}"/tcl/out/* 'starpack.vfs/'
    70         -	cp -r "${OTHERPKGSDIR}"/tclvfs/out/* 'starpack.vfs/'
    71         -	cp -r "${OTHERPKGSDIR}"/thread/out/* 'starpack.vfs/'
           69  +	cp -r "${OTHERPKGSDIR}"/*/out/* 'starpack.vfs/'
    72     70   
    73     71   	## Rename the "vfs" package directory to what "boot.tcl" expects
    74     72   	mv 'starpack.vfs/lib'/vfs* 'starpack.vfs/lib/vfs'
    75     73   
    76     74   	## Install "boot.tcl"
    77     75   	cp 'boot.tcl' 'starpack.vfs/'
    78     76   
................................................................................
    80     78   	echo "Running: ./configure --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}"
    81     79   	./configure --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA}
    82     80   
    83     81   	echo "Running: ${MAKE:-make}"
    84     82   	${MAKE:-make} TCLSH_NATIVE="${TCLSH_NATIVE}" || exit 1
    85     83   
    86     84   	# Strip the KitDLL of debugging symbols, if possible
    87         -	"${STRIP:-strip}" -g libtcl.* >/dev/null 2>/dev/null
           85  +	"${STRIP:-strip}" -g libtclkit.* >/dev/null 2>/dev/null
    88     86   
    89     87   	exit 0
    90     88   ) || exit 1
    91     89   
    92     90   exit 0

Modified kitdll/buildsrc/kitdll-0.0/Makefile.in from [4d217fe77e] to [6ce16de7bd].

     1      1   CC = @CC@
     2      2   CFLAGS = @CFLAGS@ @SHOBJFLAGS@ -Wall
     3      3   CPPFLAGS = @CPPFLAGS@ @DEFS@ -DKITDLL_MAKE_LOADABLE=1
            4  +WISH_CFLAGS = @WISH_CFLAGS@
     4      5   LDFLAGS = @LDFLAGS@
     5      6   SHOBJLDFLAGS = @SHOBJLDFLAGS@
     6      7   LIBS = @LIBS@
     7      8   STATICLIBS = @ARCHS@
     8      9   OBJS = vfs_kitdll_data_tcl.o kitInit.o rechan.o pwb.o
     9     10   TCLSH_NATIVE = tclsh
    10     11   
................................................................................
    31     32   	$(CC) $(CPPFLAGS) $(CFLAGS) -o libtclkit.@SHOBJEXT@ $(OBJS) $(LDFLAGS) $(SHOBJLDFLAGS) -Wl,--whole-archive $(STATICLIBS) -Wl,--no-whole-archive $(LIBS)
    32     33   
    33     34   # Test driver
    34     35   tclsh.o: tclsh.c
    35     36   tclsh: tclsh.o libtclkit.@SHOBJEXT@
    36     37   	$(CC) $(CPPFLAGS) $(CFLAGS) -o tclsh tclsh.o -L. -ltclkit -Wl,-R,`pwd`
    37     38   
           39  +wish.o: wish.c
           40  +wish: wish.o libtclkit.@SHOBJEXT@
           41  +	$(CC) $(CPPFLAGS) $(CFLAGS) $(WISH_CFLAGS) -o wish wish.o -L. -ltclkit -Wl,-R,`pwd`
           42  +
    38     43   # Cleanup routeines
    39     44   clean:
    40     45   	rm -f libtclkit.@SHOBJEXT@
    41     46   	rm -f $(OBJS)
    42     47   	rm -f vfs_kitdll_data_tcl.c
    43     48   	rm -f vfs_kitdll.tcl.h
    44     49   	rm -f tclsh.o tclsh

Modified kitdll/buildsrc/kitdll-0.0/aclocal.m4 from [e402deb226] to [8720922151].

   215    215   			;;
   216    216   	esac
   217    217   ])
   218    218   
   219    219   AC_DEFUN(DC_FIND_TCLKIT_LIBS, [
   220    220   	DC_SETUP_TCL_PLAT_DEFS
   221    221   
   222         -	for proj in tcl tclvfs; do
          222  +	WISH_CFLAGS=""
          223  +
          224  +	for proj in tcl tclvfs tk; do
   223    225   		AC_MSG_CHECKING([for libraries required for ${proj}])
   224    226   
   225    227   		libdir="../../../${proj}/inst"
   226    228   		libfiles="`find "${libdir}" -name '*.a' 2>/dev/null | tr "\n" ' '`"
   227    229   		libfilesnostub="`find "${libdir}" -name '*.a' 2>/dev/null | grep -v 'stub' | tr "\n" ' '`"
   228    230   
   229    231   		if test "$proj" = "tcl"; then
   230    232   			libfiles="${libfilesnostub}"
   231    233   		fi
          234  +
          235  +		if test "$proj" = "tk"; then
          236  +			libfiles="${libfilesnostub}"
          237  +			if test -n "$libfiles"; then
          238  +				DC_DO_TK
          239  +				AC_DEFINE(KIT_INCLUDES_TK, [1], [Specify this if we link statically to Tk])
          240  +
          241  +				if test -n "${TK_VERSION}"; then
          242  +					AC_DEFINE_UNQUOTED(KIT_TK_VERSION, "${TK_VERSION}${TK_PATCH_LEVEL}", [Specify the version of Tk])
          243  +				fi
          244  +
          245  +				if test "$host_os" = "mingw32msvc" -o "$host_os" = "mingw32"; then
          246  +					WISH_CFLAGS="-mwindows"
          247  +				fi
          248  +			fi
          249  +		fi
   232    250   
   233    251   		ARCHS="${ARCHS} ${libfiles}"
   234    252   
   235    253   		AC_MSG_RESULT([${libfiles}])
   236    254   	done
   237    255   
          256  +	AC_SUBST(WISH_CFLAGS)
   238    257   	AC_SUBST(ARCHS)
   239    258   ])

Modified kitdll/buildsrc/kitdll-0.0/kitInit.c from [891f640ccd] to [6d34381c61].

     1         -#include <tcl.h>
            1  +#ifdef KIT_INCLUDES_TK
            2  +#  include <tk.h>
            3  +#else
            4  +#  include <tcl.h>
            5  +#endif /* KIT_INCLUDES_TK */
            6  +
            7  +#ifdef _WIN32
            8  +#  define WIN32_LEAN_AND_MEAN
            9  +#  include <windows.h>
           10  +#  undef WIN32_LEAN_AND_MEAN
           11  +#endif /* _WIN32 */
           12  +
     2     13   #include "tclInt.h"
     3     14   
     4     15   #if defined(HAVE_TCL_GETENCODINGNAMEFROMENVIRONMENT) && defined(HAVE_TCL_SETSYSTEMENCODING)
     5     16   #  define TCLKIT_CAN_SET_ENCODING 1
     6     17   #endif
     7     18   #if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 85
     8     19   #  define KIT_INCLUDES_PWB 1
................................................................................
    31     42   	"vfs::kitdll::Mount tcl /.KITDLL_TCL\n"
    32     43   	"set f [open \"/.KITDLL_TCL/boot.tcl\"]\n"
    33     44   	"set s [read $f]\n"
    34     45   	"close $f\n"
    35     46   	"::tclkit::init::initInterp\n"
    36     47   	"rename ::tclkit::init::initInterp {}\n"
    37     48   	"uplevel #0 $s\n"
           49  +#if defined(KIT_INCLUDES_TK) && defined(KIT_TK_VERSION)
           50  +	"package ifneeded Tk " KIT_TK_VERSION " {\n"
           51  +		"load {} Tk\n"
           52  +	"}\n"
           53  +#endif
    38     54   #ifdef _WIN32
    39     55   	"catch {load {} dde}\n"
    40     56   	"catch {load {} registry}\n"
    41     57   #endif /* _WIN32 */
    42     58   "}\n"
    43     59   "tclKitInit";
    44     60   
................................................................................
    85    101   #ifdef TCL_THREADS
    86    102   	Tcl_StaticPackage(0, "Thread", Thread_Init, NULL);
    87    103   #endif
    88    104   #ifdef _WIN32
    89    105   	Tcl_StaticPackage(0, "dde", Dde_Init, NULL);
    90    106   	Tcl_StaticPackage(0, "registry", Registry_Init, NULL);
    91    107   #endif
          108  +#ifdef KIT_INCLUDES_TK
          109  +	Tcl_StaticPackage(0, "Tk", Tk_Init, Tk_SafeInit);
          110  +#endif  
    92    111   
    93    112   	TclSetPreInitScript(preInitCmd);
    94    113   
    95    114   	return;
    96    115   }

Modified kitdll/buildsrc/kitdll-0.0/tclsh.c from [0713d9aa46] to [5950dce536].

     1         -#ifdef HAVE_STDIO_H
     2         -#  include <stdio.h>
     3         -#endif
     4         -
     5      1   #include <tcl.h>
     6      2   
     7      3   int Tcl_AppInit(Tcl_Interp *interp) {
     8      4   	return(Tcl_Init(interp));
     9      5   }
    10      6   
    11      7   int main(int argc, char **argv) {
    12      8   	Tcl_Main(argc, argv, Tcl_AppInit);
    13      9   
    14     10   	return(1);
    15     11   }

Added kitdll/buildsrc/kitdll-0.0/wish.c version [59698e12d8].

            1  +#include <tk.h>
            2  +
            3  +int Tcl_AppInit(Tcl_Interp *interp) {
            4  +	int tcl_ret;
            5  +
            6  +	tcl_ret = Tcl_Init(interp);
            7  +	if (tcl_ret == TCL_ERROR) {
            8  +		return(tcl_ret);
            9  +	}
           10  +
           11  +	tcl_ret = Tk_Init(interp);
           12  +	if (tcl_ret == TCL_ERROR) {
           13  +		return(tcl_ret);
           14  +	}
           15  +
           16  +#ifdef _WIN32
           17  +	tcl_ret = Tk_CreateConsoleWindow(interp);
           18  +	if (tcl_ret == TCL_ERROR) {
           19  +		return(tcl_ret);
           20  +	}
           21  +#endif
           22  +
           23  +	return(TCL_OK);
           24  +}
           25  +
           26  +int main(int argc, char **argv) {
           27  +	Tk_Main(argc, argv, Tcl_AppInit);
           28  +
           29  +	return(1);
           30  +}