2

Please help with the step by step instructions on "How to compile tcl/ shell code" (Need to hide original source code)

Please come out with answers considering the following queries

  1. Tools need to accomplish that (Please suggest the best/simple one)
  2. How to compile
  3. How to run the compiled output file

Thanks

user1228191
  • 681
  • 3
  • 10
  • 19

3 Answers3

3

Activestate offers a product, the "Tcl Dev Kit" (TDK), which can be used to produce byte-compiled blobs and to otherwise prepare "compiled" applications written in Tcl (also known as "starpacks").

kostix
  • 51,517
  • 14
  • 93
  • 176
  • 3
    A lesser version of this is to just put everything in a starpack yourself (with [`sdx`](http://wiki.tcl.tk/3411)). Not as safe, but still enough to defeat random finger-pokers. – Donal Fellows Mar 27 '12 at 10:20
2

If you are running Linux you can use Freewrap to compile tcl. If your distribution doesn't have it in it's repository download it from http://sourceforge.net/projects/freewrap/ and just pass the name of your tcl script as the argument like this:

freewrap <name>.tcl 

This should generate the file <name>, which you can run as any executable. See http://wiki.tcl.tk/855 for other options.

To compile shell scripts use shc. The tool can be downloaded from http://linux.softpedia.com/get/System/Shells/shc-18503.shtml and you compile your shell script with the command

shc -f <name>

This should output two files <name>.x and <name>.x.c. The former is the executable you want and the other is a C code file compiled from your original script that is used to generate the executable.

nilewapp
  • 86
  • 3
0

After almost a decade.

To compile .tcl script, you need TclKit and sdx. You can download them from TclKits: Downloads and Google Code Archive | Downloads. (I used one for RHEL5 x86_64 on Ubuntu.)

After making TclKit executable by

$ chmod +x tclkit-8.*.*-*-*

, the command

$ tclkit-8.*.*-*-* sdx-*.kit qwrap *.tcl

will compile a script file and generate *.kit file. To run it:

$ tclkit-8.*.*-*-* *.kit
ghchoi
  • 4,812
  • 4
  • 30
  • 53