Download Latest Version compileTCL_v1.1.zip (13.5 kB)
Home / 1.x
Name Modified Size InfoDownloads / Week
Parent folder
compileTCL_v1.1.zip 2026-11-18 13.5 kB
Totals: 1 Item   13.5 kB 0
compileTCL

version 1.0

Purpose:
xor encode your script into encrypted bytecode, then compile the bytecode using
gcc into an executable binary.


** Before anything else **
Linux: These template files assume that you have tcl, tcl-dev, tk, tk-dev,
build essentials, and gcc installed on your system from your package manager.
If your system is different, edit the files appropriately.

Windows: These template files assume that you have Magicsplat TCL version 9.xx
installed on your system, and that it's installed in ~/AppData/Local/apps. It
also assumes that you have Mingw64 gcc installed on your system via Msys32.
If your system is different, edit the files appropriately.


Files:
There are Linux and Windows directories for the OS specific files. Within each
dirctory are subdirectories named "TCL" and "TK"; if your script is a non-
graphical script, i.e., called with tclsh, use the files in the "TCL"
directory, graphical scripts, use the files in the "TK" directory.

In each of these sub-directories, you'll find four template files

encrypt.py - does the xor encoding of your TCL script
main.c - compiles the bytecode
doc.bat - convenience batch file
domap.tcl -convenience TCL script

User to-do
First, your TCL or TK script needs to have the extension ".tcl". If it doesn't,
make a copy and change it to "<name_of_your_script>.tcl".

Second, move the appropriate template files to the directory containing your
TCL script.

In the "doc(.bat)" file, line #1 refers to a python call. In the Windows
script, I call it "python", and in the Linux script, I call it "python3". Just
link whatever it's called on your system if those calls don't work.

Note: Below, "base script name" refers to the name of the script minus the .tcl
extention, i.e., the base script name of "somescript.tcl" is "somescript".



** Method #1, manually edit the template file **
encrypt.py
Line #3: Replace <filename> with the base name of the base script name.
Line #9: Replace <filename> with the base name of the base script name.

main.c
Line #5: Replace <filename> with the name of the base script name.
file from the encrypt.py result

doc.bat
Line #2 Replace <filename> with the name of the base script name.

Now, run doc.bat from the command line


** Method #2, run the provided TCL script **
After you've moved the three template files and the "domap.tcl" file to the
directory that contains your TCL script, run "domap.tcl <script_base_name>"
from the command line. Assume that the name of your script is "yourscript.tcl".
The command would be:

tclsh domap.tcl yourscript

This puts the name of your script in the template files and calls on gcc to
build your app.


Hope this comes in handy for someone.

- Dana Booth
danabooth@mail.com
Source: readme.txt, updated 2026-11-18