1. Portability Note

You will find that the linux makefile works with no or only slight adjustments on other Un*x-like operating systems like QNX, BSD or MacOSX !
2. Prerequisites
  • ARM, PPC, X86/32 or X86/64 CPU (should also work on SPARC, MIPS, M68K, .. but I have not tried for myself, yet)
  • GCC/G++ (tested with 2.x up to 4.x)
  • GNU make (tested with 3.79 - 3.81)
  • zlib
  • libSDL, libSDL_net if you want the tksdl plugin
  • libpng and OpenGL/GLU if you want the tkopengl plugin
  • freetype2 if you want the tkfreetype2 plugin
  • GTK+ if you want the tkui plugin (resp. the native file dialog feature)
  • NVidia Cg SDK if you want the tkcg plugin
3. Required files

Download the following files and unzip/copy them to the same directory.
You do not need to download all plugins but I recommend to install at least the tksdl, tkopengl, tkfreetype2, tkui and tkmath plugins. Some old examples also require the tkoldmath plugin.
Note: If you have downloaded and unzip'd all of the files below, you can compile/install them all in one go using the toplevel makefile:
$ make -f makefile.linux install 

1) install_linux.mk - Make include file (compiler configuration etc)
2) makefile.linux - Toplevel makefile
3) files/yac.zip - YAC plugin header files
4) files/tks-source.zip - Core script engine source codes
5) files/yingtest.zip - Example/test plugin optional
6) files/tksdl.zip - Bindings for SDL/SDL_net optional
7) files/tkopengl.zip - Bindings for OpenGL optional
8) files/tkfreetype2.zip - Bindings for Freetype2 optional
9) files/tkui.zip - GUI library written in TkScript optional
10) files/tkfreeglut.zip - Bindings for GLUT optional
11) files/tkmath.zip - A vector/matrix/complex math library optional
12) files/tkoldmath.zip - The old math vector/matrix math library optional
13) files/tkchipmunk.zip - Bindings for the Chipmunk 2D physics library optional
14) files/eqxmms.zip - Bindings for the EQXMMS equalizer optional
(+ any other plugins you wish to use)
4. Cross compile note

The core runtime and the plugins can be cross-compiled. To do that, simply edit the install_linux.mk include file and change the CROSS variable to the prefix of your cross compiler.
5. Compiling and installing the core script engine

Once you have downloaded the source code packages and unzipped them to, say, ~/tks, do the following: (and read the note below if you want to enable the JIT)
$ make -f makefile.linux tks 

This should build the core scriptengine. If the build succeded, you can now install TKS:
$ su 
# make -f makefile.linux tks_install 
Note: Since the JIT compiler only works on X86/32 at the moment, it is disabled by default. To enable it, edit tks-source/makefile.linux and add -DTKS_JIT -DDX_X86 to the CPPFLAGS variable. If your version of GCC does not support thread local storage, simply remove the -DHAVE_TLS preprocessor define from CPPFLAGS.
The install (resp. tks_install) target writes a shell-wrapper script "tks" to $TKS_PREFIX/bin/tks. The wrapper script is used to set up the plugin/library/app/module environment path variables before actually executing the script engine (tks.bin).
6. Compiling and installing plugins

The installation of plugins works very similar to the core engine installation.
Please make sure to install any required dev-package dependencies first.
You should also install TKS first since some plugins call the interpreter during their build.
The toplevel makefile can currently be used to install the tksdl, tkopengl, tkfreetype2, tkui, tkfreeglut, tkmath, tkoldmath, eqxmms and tkchipmunk plugins.
This does not necessarily mean that other plugins won't work under Linux (e.g. the tkcg plugin has been tested successfully but it a) has some rather large dependencies (NVidia Cg SDK) and b) is WIP so I kept it out of the makefile for the time being).
Please notice that the toplevel makefile simply forwards make targets to the respective makefile in the plugin directory. This means that you can also compile/install a plugin by changing into its directory and typing:
# make -f makefile.linux install 
7. Examples

The files/tks-examples.zip packages contains a couple of simple script examples/tests (look into the tksdl/ folder for some SDL/OpenGL examples). Honestly, the examples package is quite a mess but should give you some pointers (beside the documentation).
Read the tkui source code for a more sophisticated "real-world" example.
You may also want to look at these screen Hacks.
8. MIME integration

In order to be able to run a TKS application by simply clicking on a .tkx or .tks file in a browser, you need to add MIME type handlers as described in TkScript reference guide / User Interface.
The procedure for this may actually depend on the browser or desktop environment used so I leave it up to you to read up on the details.
GNOME users may want to take a look here. I guess something along the lines of
<?xml version="1.0" encoding="UTF-8"?> 
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> 
   <mime-type type="application/x-tkx"> 
     <comment>TKS application pak file</comment> 
     <magic priority="50"> 
       <match value="TPAK" type="string" offset="0"/> 
     <glob pattern="*.tkx"/> 

will probably do the trick. You should then assign /usr/bin/tks to handle this MIME type.

auto-generated by "DOG", the TkScript document generator. Mon, 28/Dec/2015 14:27:05