What | tclreadline |
Where | http://tclreadline.sourceforge.net/ |
Latest version | 2.1.0 |
Updated | 07/2001 |
Tcl bindings for GNU readline, by Johannes Zellner, used to enhance an interactive Tcl
Tested with Tcl 8.1 as well as itcl.
Mike 2007-11-15:
Getting tclreadline (2.1.0) running on Mac OSX is a hassle. After running "./configure --enable-tclshrl" followed by "make", i got errors about "Undefined symbols ...". To fix it you need to do the following:
If you enable tclreadline in your tclsh and get an "alloc: invalid block: ..." error, then you will have to do the following:
PYL 2007-12-24:
Will 2008-03-16:
I just managed to build tcllibreadline on Mac OS 10.4. I first did everything Mike did (note that you will need to have the proper libreadline - I had 5.2 under /usr/local/lib already but I don't think that came with the OS - and check the /usr/lib/libreadline.dylib symlink isn't incorrect). In addition I had to:
Chap 2010-01-20 23:03:18:
Things I did to install libtclreadline-2.1.0 and readline-6.1 on Mac OS X 10.6.2 with TCL 8.5 that came with OSX.
From etresoft on Apple Discussions forum:
... the tclreadline library uses old versions of autoconf. Before calling "./configure" on this project, run "autoreconf -fvi". That will enable shared libraries.
Quite correct - and there's one more thing to do before building.
If you enable tclreadline in your tclsh and get an "alloc: invalid block: ..." error, then you will have to do the following: Edit tclreadline.c file and rename all MALLOC to malloc and FREE to free (and remove the macros MALLOC and FREE)
Having done that, I then ran './configure', 'make', and 'sudo make install'
-- From tclreadline.sourceforge.net:
If you want to use tclreadline as a line interface for developing tcl scripts, you probably don't have to read much of the following section. Just install the package and put the following lines to your $HOME/.tclshrc:
if {$tcl_interactive} { package require tclreadline ::tclreadline::Loop }
My goal was simply to be able to run 'tclsh -i' and have a modern command line for learning and experimenting with TCL. So I did exactly what's described above.
-- It worked. I hope this helps somebody.
bovine 2010-05-03 16:56:50:
These steps are a modified version of Chap's instructions so that you do not have to replace the system libreadline. Tested on MacOS X 10.6.3
Download these two tarballs:
Run these commands:
cd ~/ tar xvzf ~/Downloads/readline-6.1.tar.gz tar xvzf ~/Downloads/tclreadline-2.1.0.tar.gz cd ~/readline-6.1/ ./configure --disable-shared --prefix=/tmp/readline-install/ make make install cd ~/tclreadline-2.1.0/ autoreconf -fvi ./configure --with-readline-includes=/tmp/readline-install/include/readline --with-readline-library=/tmp/readline-install/lib/libreadline.a egrep -v '#define (FREE|MALLOC)' tclreadline.c | sed 's/MALLOC/malloc/; s/FREE/free/' > tclreadline.c.new mv -f tclreadline.c.new tclreadline.c make sudo make install rm -rf /tmp/readline-install
hv: Thank you. I followed bovine's instruction and finally got tclreadline to build, installed, and was able to use it. Great instruction.
Debian/Ubuntu offer tclreadline as standard packages, installable via the package manager. After installing tclreadline, a new file .tclshrc must be created in the home directory with following content (same as above):
if {$tcl_interactive} { package require tclreadline ::tclreadline::Loop }
sathwikm91 - 2017-02-10 02:21:55
sath: I tried the above procedure by bovine on my mac OS Sierra Version 10.12.2: I am getting this error when I run 'make install' clang: error: invalid argument '-compatibility_version 6' only allowed with '-dynamiclib' Nevertheless when I continue I am getting this error when I run 'autoreconf -fvi': -bash: autoreconf: command not found. Later when I run just 'make' and 'sudo make install' I am getting this error: libtool: link: cannot build libtool library `libtclreadline.la' from non-libtool objects: /tmp/readline-install/lib/libreadline.a make: *** libtclreadline.la Error 1
Please help. Newbie here.