From owner-freebsd-questions Mon Apr 15 16:39:12 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA17204 for questions-outgoing; Mon, 15 Apr 1996 16:39:12 -0700 (PDT) Received: from mistery.mcafee.com (jimd@mistery.mcafee.com [192.187.128.69]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id QAA17189 for ; Mon, 15 Apr 1996 16:39:07 -0700 (PDT) Received: (from jimd@localhost) by mistery.mcafee.com (8.6.11/8.6.9) id RAA15832 for questions@freebsd.org; Mon, 15 Apr 1996 17:59:37 -0700 From: Jim Dennis Message-Id: <199604160059.RAA15832@mistery.mcafee.com> Subject: TCL/TK and 'expect' under FreeBSD 2.1: Build Notes To: questions@freebsd.org Date: Mon, 15 Apr 1996 17:59:37 -0700 (PDT) X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Summary: How to upgrade your TCL/tk and add expect to your FreeBSD 2.1 1. extract all three .tar files under /usr/local/src 2. build tcl, then tk, then expect. 3. extract (edit) the freebsd patch out of porting.notes and apply it (patch -p < yourcopyofpatch ) before running ./configure on tcl. 4. don't run 'make clean' between the three builds -- clean up after all three are done. Details: I discovered a need to run 'expect' on one of my FreeBSD systems (well, I could have run a longer expect script from one of my Linux boxes, had it rlogin/telnet to the FreeBSD system and do it all via remote -- but ....) (For those unfamiliar with it 'expect' is a utility by Don Libes that is built around the TCL libraries and provides scripting for interactive programs. Basically I need to create and maintain a large number of "dummy" account and password combos -- and the perl crypt function can't generate FreeBSD md5 hash/encrypted passwords for me -- but 'expect' seems to have much broader utility for driving interactive programs through scripts (especially cronjobs)). As I grabbed the latest expect (ftp.cme.nist.gov) I noticed that the TCL/TK included in FreeBSD 2.1 is out of date -- so I tooled over to ftp.smli.com (it's been moved from ftp.cs.berkeley.edu where it used to reside) and grabbed tcl7.4, and the three patches (there are beta's for 7.5 if y'all are interested) and tk4.0 (there are beta's of 4.1) and those patches. After my initial configure and make I did a 'make test' (tcl) and found that it failed with a floating point exception. Grepping about reveals a short patch in 'porting.notes' -- so I extracted this (cp porting.notes freebsd.patch; vi freebsd.patch) and rebuilt it. 'make test' is happy. The make install from /usr/local/src/tcl7.4 doesn't overwrite /usr/local/bin/tclsh. This is documented. I mv'd tclsh to tclsh7.3 and made a symlink for tclsh to tcl7.4. On to tk (not necessary for this application but let's build it right -- expect wants to find tcl and will look for tk and build an 'expectk' if it find it). Be sure to untar all three of these packages from the same directory (such as /usr/local/src) since tk looks for ../tcl7.4 and expect looks for ../tcl* and ../tk* for .o and .a files. Also don't do your 'make clean' until you've built all three. I don't run X locally on that system. Exporting the DISPLAY to my local workstation and running the tk test suite reports a number of non-critical failures (might be the X Server on my local workstation -- it's an *old* slackware -- I hardly ever use X -- that that only for Netscape and the occasional xterm). That done I moved on to expect itself. This is version 5.19. ./configure and make seemed to go fine. The test suite (which Don says is not complete in the README/INSTALL) ran without complaint (on the first try no less). The only other odd note: On my Linux boxes the sizes of each of the binaries for tclsh, wish, and expect are all less than 10K. The corresponding binaries on the FreeBSD box are all over a hundred K (expect is over 200K) after stripping. 'file' reports these as demand paged dynamically linked. I suspect that some other optimization or compiler switches are needed to bring this down. Conclusion: These three related utilities compiled with relatively little trouble under FreeBSD. The one 'gotchya' is the need to patch tcl for the floating point error and the (as yet) unexplained test suite failures from tk. If I knew how to properly make a port -- I would. If someone wants to enlighten me on this process I'll be happy to learn. (If someone just wants to do it, and investigate the tk errors and look at the floating point errors to see if any changes to the FreeBSD source tree are indicated -- that would also be cool). If someone who's better gcc and optimization in particular wants to tweak the makefiles for performance and size -- even better. I would recommend to the core team that they update the tcl/tk in the main distribution -- and that they consider adding expect to the toolkit. In fact -- they may want to add DejaGNU (the FSF regression automation tool which I've heard is built around 'expect'). (Note: if this should have been posted to a different list -- please let me know. It is my intent to post some rough notes, in this fashion, for each tool that I add to my FreeBSD distribution. If I just grab a port and it builds cleanly -- there won't be anything to say). Jim Dennis, System Administrator, McAfee Associates