Forum OpenACS Q&A: Compile Tcl with --enable-threads

Collapse
Posted by Andrew Piskorski on
Well, did you try compiling it with threads enabled? I prefer to do it like so:
 
$ umask 002
$ cd /tmp/tcl/unix
$ ./configure --enable-threads --enable-symbols --enable-gcc --enable-shared
# Edit Makefile now - see below.
$ make
$ make test
$ sudo make install
$ sudo chmod 755 /usr/local/bin/tclsh8.4
$ sudo chmod 644 /usr/local/lib/libtclstub*.a
Edit the Makefile: Tcl's configure script is dumb and turns off all optimization when it turns on -g. To fix that, simply manually edit Makefile changing both plain "-g" and "-O" to "-g -O", like so:
 
CFLAGS_DEBUG    = -g -O 
CFLAGS_OPTIMIZE = -g -O 
On some systems the Tcl configure script picks -O, on others it picks -O2. I just use whatever level of optimization it decided on, but turn on both debugging and optimization in both flavors of CFLAGS.