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

4

3 回答 3

3

Activestate 提供了一个产品,“Tcl Dev Kit”(TDK),它可以用来生成字节编译的 blob,或者准备用 Tcl(也称为“starpacks”)编写的“编译”应用程序。

于 2012-03-27T10:07:46.577 回答
2

如果你运行的是 Linux,你可以使用 Freewrap 来编译 tcl。如果您的发行版的存储库中没有它,请从http://sourceforge.net/projects/freewrap/下载它,然后将 tcl 脚本的名称作为参数传递,如下所示:

freewrap <name>.tcl 

这应该会生成文件<name>,您可以将其作为任何可执行文件运行。有关其他选项,请参阅http://wiki.tcl.tk/855

要编译 shell 脚本,请使用shc. 该工具可以从http://linux.softpedia.com/get/System/Shells/shc-18503.shtml下载,然后使用命令编译 shell 脚本

shc -f <name>

这应该输出两个文件<name>.x<name>.x.c. 前者是您想要的可执行文件,另一个是从您的原始脚本编译的 C 代码文件,用于生成可执行文件。

于 2012-03-27T10:10:53.247 回答
0

经过近十年。

要编译.tcl脚本,您需要TclKitsdx. 您可以从TclKits 下载它们:下载Google 代码存档 | 下载。(我在 Ubuntu 上为 RHEL5 x86_64 使用了一个。)

使TclKit可执行后

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

, 命令

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

将编译一个脚本文件并生成*.kit文件。要运行它:

$ tclkit-8.*.*-*-* *.kit
于 2020-08-11T04:17:49.973 回答