Compiling the TKS scriptengine

  1. make sure you have gcc,g++ and gmake (or a compatible make) installed
  2. make sure you have zlib-devel and zlib installed; if you don't want zlib support you can disable it in "tks-config.h" (disable DX_Z define)
  3. make sure you have the "unzip" command installed (or a similar tool to depack the source code archive)
  4. get tks-source.zip or tks-0.5.2.2-src.tar.gz, e.g.
    [root@wizball root]# mkdir tkscript; cd tkscript && wget http://tkscript.de/files/tks-source.zip && 
    wget http://tkscript.de/files/yac.zip && wget http://tkscript.de/plugins/tksdl.zip &&
    wget http://tkscript.de/plugins/tkopengl.zip [root@wizball tkscript]# unzip tks-source.zip Archive: tks-source.zip creating: tks-source/ . .
    [root@wizball tkscript]# unzip yac.zip creating: yac/ inflating: yac/yac.h inflating: yac/yac_host.h inflating: yac/tks-opengl.h inflating: yac/yac_createcommandlist2.h inflating: yac/file_id.diz inflating: yac/yac_createcommandlist1.h inflating: yac/tks-list.h inflating: yac/YAC-License.txt inflating: yac/yac_createcommands.h inflating: yac/yac_createcommands1.h inflating: yac/yac_createcommands2.h
    [root@wizball tkscript]# unzip tksdl.zip Archive: tksdl.zip creating: tksdl/ inflating: tksdl/COPYING . . .
  5. change to the new tks-source directory
    [root@wizball tkscript]# cd tks-source
    [root@wizball tks-source]# 
  6. type
    [root@wizball tks-source]# make -f makefile.linux shared
  7. if everything has compiled successfully you now have a "tks" executable in the tks-source directory
  8. you may want to test whether tks works by executing
    [root@wizball tks-source]# ./tks sieve.tkp
    or
    [root@wizball tks-source]# ./tks sieve.tkx
    if you compiled with zlib support
  9. finally you may want to install it, e.g.
    [root@wizball tks-source]# cp tks /usr/bin/tks

    Compiling the TKSDL plugin

    1. make sure you have the libGL, libGL-devel OpenGL libraries and includes installed (usually /usr/include/GL/)
    2. ..if you can't find the headerfiles..try this
    3. make sure you have libGLU, libGLU-devel installed
    4. make sure you have libpng, libpng-devel installed
    5. make sure you have zlib, zlib-devel installed
    6. make sure you have SDL, SDL-devel installed
    7. make sure you have SDL_net installed
    8. get yac.zip and tksdl.zip
    9. unzip yac.zip and tksdl.zip so the directory structure looks like this:
      [root@wizball tkscript]# ls
      tksdl/  tks-source/  yac/
      [root@wizball tkscript]#
      
    10. now change to the tksdl directory
      [root@wizball tkscript]# cd tksdl
      [root@wizball tksdl]#
    11. type
      [root@wizball tksdl]# make -f makefile.linux plugin
      to compile the tksdl.so library
    12. create a plugin directory on your system, e.g.
      [root@wizball tksdl]# mkdir /usr/local/tks/plugins
    13. create a module directory on your system, e.g.
      [root@wizball tksdl]# mkdir /usr/local/tks/modules
    14. type
      [root@wizball tksdl]# cp tksdl.so /usr/local/tks/plugins/
      to install the tksdl plugin
    15. now you have to set an environment variable so that the tks plugin loader will be able to locate a requested plugin:
      [root@wizball tksdl]# export TKS_PLUGIN_PATH=/usr/local/tks/plugins/
      (don't forget the last slash!)
    16. in order to include (reusable) script modules when creating new tks applications you'll need to set another env. var.:
      [root@wizball tksdl]# export TKS_MODULE_PATH=/usr/local/tks/modules/
    17. download an example tkx file, e.g.
      [root@wizball tksdl]# curl http://tkscript.de/tkx/bobfield.tkx >bobfield.tkx
    18. start the example file by typing
      [root@wizball tksdl]# tks bobfield
    19. if something goes wrong you may want to turn on some debug messages
      [root@wizball tksdl]# tks -d 85 bobfield
    20. .
    21. .
    22. caveat: on some linux systems the plugin loader is unable to locate the plugin regardless whether the tksdl.so is located in the same directory as the tks.exe or not; in this case you may also want to try
      [root@wizball tks-source]# ./tks -pp ./ bobfield
      (assuming that you have put the tksdl.so file in the tks-source directory along with the bobfield.tkx file)
       
    23. in case you don't want to install or copy anything at all just try:
      [root@wizball tks-source]# ./tks -pp ../tksdl/ bobfield