Version 1 of Critcl 2

Updated 2005-09-02 09:43:22

Critcl is in the process of being updated, with new features and a revised build mechanism

Amongst the changes

  • Critcl now builds using a more traditional "gcc -c" step for each source file, followed by a "gcc -shared" step for linking a shared library
  • the critcl::cflags procedure can be used to specify compiler flags
  • the critcl::ldflags procedure can be used to specify linker flags
  • the critcl::framework" procedure for specifying frameworks to use under MacOS X
  • the critcl::clean_cache procedure and "critcl -clean" command are used to clean (i.e. empty) the Critcl cache
  • the critcl::debug command can be used to specify that debugging is enabled - either "memory" and/or "symbols"
  • the "bytearray" or "rawchar" types can be used as arguments and return values to critcl::cproc
  • the "int*", "float*" and "double*" types can be used as arguments and return values to critcl::cproc
  • improved cross-compiler support when using mingwin
  • all extensions are now built "thread enabled"

In addition, the compiler and platform specific commands are now stored in a configuration file. This will make it easier to support new platforms and toolchains. For example,

   #   Configuration file for the compiler toolchain

   # some defaults - you can override these in the platform specific section
   # but shouldn't need to for gcc or typical *nix toolchains

   compile         gcc -c
   link            gcc -shared
   preproc         gcc -dM -E
   tclstubs        -DUSE_TCL_STUBS
   tkstubs         -DUSE_TK_STUBS
   debug_memory    -DTCL_MEM_DEBUG
   debug_symbols   -g
   output          -o
   object          .o
   strip           -Wl,-s
   optimize        -O2
   noassert        -DNDEBUG
   threadflags     -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1    \
                   -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1   \
                   -DTCL_THREADS=1

   # OSX
   Darwin-ppc  compile   gcc -c
   Darwin-ppc  link      gcc -bundle
   Darwin-ppc  strip     

   # Windows
   Windows-x86 compile   gcc -c -nostdlib
   Windows-x86 link      gcc -shared

   # Linux - default to current platform
   Linux-*     compile   gcc -c -fPIC
   Linux-*     link      gcc -shared -s

   # for cross-compiling using mingw - this will be automatically selected
   # if mingw is recognised

   mingw       compile gcc -c -nostdlib
   mingw       link    gcc -shared

   # the following will only be selected on the command line

   # Linux - force 32 bit compile
   Linux-32    compile   gcc -c -fPIC -m32
   Linux-32    link      gcc -shared -s

   # Linux - force 64 bit compile
   Linux-64  compile   gcc -c -fPIC -m32
   Linux-64  link      gcc -shared -s

Until the changes are merged into the main Critcl source you can download the Critcl Starkit from http://www.digitalsmarties.com/pub/critcl-new.kit . It should be considered as work in progress - there are more changes being implemented, including recognising and handling several 64 bit environments.

The new Critcl was used in the development of Muzic. The changes were implemented by Steve Landers and sponsored by Eolas Technologies Inc. Thanks are due to Arjen Markus for his suggestions and assistance.