MacTcl is the name the community has used over time for a version of Tcl that runs on MacOS operating systems. ---- The focus of this page is to provide pointers and brief tips on '''building''' Tcl/Tk (and extensions for it) on MacOS 7, 8, 9, and X. For pointers on '''using''' Tcl on the Mac, including notes on installation of pre-built binaries, go to [Apple Macintosh and Tcl/Tk] instead. For a quick overview of all Mac related pages on this wiki, try http://mini.net/tcl/mac ---- '''Key MacTcl resources on the web''' * Mac OS X, by Daniel Steffen: http://www.maths.mq.edu.au/~steffen/tcltk/darwin.html (8.3.1 w/ gcc) * Mac OS 8/9, by Daniel Steffen: http://homepage.mac.com/tcltk/ (8.3.2p1 w/ CodeWarrior 6) * Mac OS 8/9, by Jim Ingham: on this wiki, [Compiling Tcl on a Mac] (8.3.1 w/ CodeWarrior 5) * Tcl-Mac mailing list archives: http://www.geocrawler.com/redir-sf.php3?list=tcl-mac (SourceForge/GeoCrawler) * Source snapshots: http://sourceforge.net/project/showfiles.php?group_id=10894 (SourceForge) * Jim Ingham's instructions to go with the above: http://prdownloads.sourceforge.net/tcl/README-MacOSX '''Building MacTcl on OS X 10.1.3 using ProjectBuilder 1.1.1''' ''(notes under construction, to be adjusted while I make progress -jcw)'' James Bonfield describes in this tcl-mac post [http://www.geocrawler.com/lists/3/SourceForge/7933/0/7978950/] what CVS branch to use to get started when building Tcl/Tk for OS X using Apple's ProjectBuilder (an IDE which uses gcc and make under the hood) Ok, here we go... Using ~/src for source code, and ~/pbout + ~/pbtmp for ProjectBuilder results and intermediates, respectively: cd ~ mkdir src pbout pbtmp Getting the latest source from SourceForge CVS (hit when asked for a password): cd src cvs -d:pserver:anonymous@cvs.tcl.sourceforge.net:/cvsroot/tcl -z3 login cvs -d:pserver:anonymous@cvs.tcl.sourceforge.net:/cvsroot/tcl -z3 co -r macosx-8-4-branch tcl cvs -d:pserver:anonymous@cvs.tktoolkit.sourceforge.net:/cvsroot/tktoolkit login cvs -d:pserver:anonymous@cvs.tktoolkit.sourceforge.net:/cvsroot/tktoolkit -z3 co -r macosx-8-4-branch tk Start ProjectBuilder, which lives in /Developer/Applications/. If this is the first time it was started, it'll ask for the setup of the two directories listed above (pbout and pbtmp), else go to the "Project Builder", "Preferences", "Building" menu/tab and enter the two (absolute) pathnames. As Jim Ingham notes, this is required so that the Tk project will find the binaries of the Tcl project. From PB, do "File", "Open" to open the src/tcl/macosx/Tcl.pbproj file. Click on the leftmost "hammer" to build the "Tcl From Scratch" target which should be showing in the top middle pop-up of the window. Time for coffee (if you have a PB/300 as I do)! When this completes, the bottom left status will say something like "Build succeeded, 9 errors" (yah, well... just warnings, it seems). Now, from PB, open the src/tk/macosx/Wish.pbproj file, select "Wish Shell" from the center pop-up menu, and again: hit that hammer and finish that coffee (FYI, this step takes a very long time). '''MacOS X specifics''' * terminology: Carbon(ized), Cocoa, packages, Quartz, .dmg files, frameworks [[explain, or better still: point to web pages]] * dynamic libraries [[explain Mach-O]], "two-level names", pre-binding * Project Builder (Interface Builder, AppleScript Studio) * where things live in the file system * X-windows, Oroboros (sp?), rootless X windows * running in the Classic environment within MacOS X '''The Mac Is Different''' * AppleScript * the lack of "exec" and pipes * socket differences * encoding * pathnames work differently (colons, but not in same place as slash)