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 !
- 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)
- 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
- Make include file (compiler configuration etc)
- Toplevel makefile
- YAC plugin header files
- Core script engine source codes
- Example/test plugin optional
- Bindings for SDL/SDL_net optional
- Bindings for OpenGL optional
- Bindings for Freetype2 optional
- GUI library written in TkScript optional
- Bindings for GLUT optional
- A vector/matrix/complex math library optional
- The old math vector/matrix math library optional
- Bindings for the Chipmunk 2D physics library optional
- 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,
, 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:
# make -f makefile.linux tks_install
: Since the JIT compiler only works on X86/32 at the moment, it is disabled by default. To enable it, edit
variable. If your version of GCC does not support thread local storage, simply remove the
preprocessor define from
) target writes a shell-wrapper script "
. The wrapper script is used to set up the plugin/library/app/module environment path variables before actually executing the script engine (
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
packages contains a couple of simple script examples/tests (look into the
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
8. MIME integration
In order to be able to run a TKS application by simply clicking on a
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"?>
<comment>TKS application pak file</comment>
<match value="TPAK" type="string" offset="0"/>
will probably do the trick. You should then assign
to handle this MIME type.
auto-generated by "DOG", the TkScript document generator. Mon, 28/Dec/2015 14:27:05