sl@0: Tcl Mac OS X README sl@0: ------------------- sl@0: sl@0: RCS: @(#) $Id: README,v 1.1.2.9 2007/04/29 02:21:33 das Exp $ sl@0: sl@0: This is the README file for the Mac OS X/Darwin version of Tcl. sl@0: sl@0: sl@0: 1. Where to go for support sl@0: -------------------------- sl@0: sl@0: - The tcl-mac mailing list on sourceforge is the best place to ask questions sl@0: specific to Tcl & Tk on Mac OS X: sl@0: http://lists.sourceforge.net/lists/listinfo/tcl-mac sl@0: (this page also has a link to searchable archives of the list, please check them sl@0: before asking on the list, many questions have already been answered). sl@0: sl@0: - For general Tcl/Tk questions, the newsgroup comp.lang.tcl is your best bet: sl@0: http://groups.google.com/group/comp.lang.tcl/ sl@0: sl@0: - The Tcl'ers Wiki also has many pages dealing with Tcl & Tk on Mac OS X, see sl@0: http://wiki.tcl.tk/references/3753! sl@0: http://wiki.tcl.tk/references/8361! sl@0: sl@0: - Please report bugs with Tcl or Tk on Mac OS X to the sourceforge bug trackers: sl@0: Tcl: http://sf.net/tracker/?func=add&group_id=10894&atid=110894 sl@0: Tk: http://sf.net/tracker/?func=add&group_id=12997&atid=112997 sl@0: please make sure that your report Tk specific bugs to the tktoolkit project bug sl@0: tracker rather than the tcl project bug tracker. sl@0: Mac OS X specific bugs should usually be assigned to 'das' or 'wolfsuit'. sl@0: sl@0: sl@0: 2. Using Tcl on Mac OS X sl@0: ------------------------ sl@0: sl@0: - At a minimum, Mac OS X 10.1 is required to run Tcl, but OS X 10.3 or higher is sl@0: recommended (certain [file] operations behave incorrectly on earlier releases). sl@0: sl@0: - Unless weak-linking is used, Tcl built on Mac OS X 10.x will not run on 10.y sl@0: with y < x; on the other hand Tcl built on 10.y will always run on 10.x with sl@0: y <= x (but without any of the fixes and optimizations that would be available sl@0: in a binary built on 10.x). sl@0: Weak-linking is available on OS X 10.2 or later, it additionally allows Tcl sl@0: built on 10.x to run on any 10.y with x > y >= z (for a chosen z >= 2). sl@0: sl@0: - Tcl extensions can be installed in any of: sl@0: $HOME/Library/Tcl /Library/Tcl /Network/Library/Tcl /System/Library/Tcl sl@0: $HOME/Library/Frameworks /Library/Frameworks /Network/Library/Frameworks sl@0: /System/Library/Frameworks (searched in that order). sl@0: Given a potential package directory $pkg, Tcl on OSX checks for the file sl@0: $pkg/Resources/Scripts/pkgIndex.tcl as well as the usual $pkg/pkgIndex.tcl. sl@0: This allows building extensions as frameworks with all script files contained in sl@0: the Resources/Scripts directory of the framework. sl@0: sl@0: - [load]able binary extensions can linked as either ordinary shared libraries sl@0: (.dylib) or as MachO bundles (since 8.4.10/8.5a3); only bundles can be unloaded, sl@0: and bundles are also loaded more efficiently from VFS (no temporary copy to the sl@0: native filesystem required). sl@0: sl@0: - The 'deploy' target of macosx/Makefile installs the html manpages into the sl@0: standard documentation location in the Tcl framework: sl@0: Tcl.framework/Resources/Documentation/Reference/Tcl sl@0: No nroff manpages are installed by default by the Makefile. sl@0: sl@0: - The Tcl framework can be installed in any of the system's standard sl@0: framework directories: sl@0: $HOME/Library/Frameworks /Library/Frameworks sl@0: /Network/Library/Frameworks /System/Library/Frameworks sl@0: sl@0: sl@0: 3. Building Tcl on Mac OS X sl@0: --------------------------- sl@0: sl@0: - At least Mac OS X 10.1 is required to build Tcl, and Apple's Developer Tools sl@0: need to be installed (only the most recent version matching your OS release is sl@0: supported). The Developer Tools installer is available on Mac OS X retail disks sl@0: or is present in /Applications/Installers on Macs that came with OS X sl@0: preinstalled. The most recent version can be downloaded from the ADC website sl@0: http://connect.apple.com (after you register for free ADC membership). sl@0: sl@0: - Tcl is most easily built as a Mac OS X framework via Makefile in tcl/macosx sl@0: (see below for details), but can also be built with the standard unix configure sl@0: and make buildsystem in tcl/unix as on any other unix platform (indeed, the sl@0: Makefile is just a wrapper around the unix buildsystem). sl@0: The Mac OS X specific configure flags are --enable-framework and sl@0: --disable-corefoundation (which disables CF and notably reverts to the standard sl@0: select based notifier). sl@0: sl@0: - It is also possible to build with Apple's IDE via the tcl/macosx/Tcl.pbproj sl@0: project, this simply calls through to the tcl/macosx/Makefile. sl@0: sl@0: - To build universal binaries, set CFLAGS as follows: sl@0: export CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 \ sl@0: -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" sl@0: This requires Mac OS X 10.4 and Xcode 2.4 (or Xcode 2.2 if -arch x86_64 is sl@0: omitted, but _not_ Xcode 2.1) and will work on any of the architectures (the sl@0: -isysroot flag is only required on PowerPC Tiger). sl@0: Note that configure requires CFLAGS to contain a least one architecture that can sl@0: be run on the build machine (i.e. ppc on G3/G4, ppc or ppc64 on G5, ppc or i386 sl@0: on Core and ppc, i386 or x86_64 on Core2/Xeon). sl@0: Universal builds of Tcl TEA extensions are also possible with CFLAGS set as sl@0: above, they will be [load]able by universal as well as thin binaries of Tcl. sl@0: sl@0: - To enable weak-linking, set the MACOSX_DEPLOYMENT_TARGET environment variable sl@0: to the minimal OS version (>= 10.2) the binaries should be able to run on, e.g: sl@0: export MACOSX_DEPLOYMENT_TARGET=10.2 sl@0: This requires Mac OS X 10.2 and gcc 3.1; if you have gcc 4 or later you can set sl@0: CFLAGS instead: sl@0: export CFLAGS="-mmacosx-version-min=10.2" sl@0: Support for weak-linking was added to the code for 8.4.14/8.5a5. sl@0: sl@0: Detailed Instructions for building with macosx/Makefile sl@0: ------------------------------------------------------- sl@0: sl@0: - Unpack the tcl source release archive. sl@0: sl@0: - The following instructions assume the tcl source tree is named "tcl${ver}", sl@0: where ${ver} is a shell variable containing the tcl version number (for example sl@0: '8.4.12'). sl@0: Setup the shell variable as follows: sl@0: set ver="8.4.12" ;: if your shell is csh sl@0: ver="8.4.12" ;: if your shell is sh sl@0: The source tree will be named this way only if you are building from a release sl@0: archive, if you are building from CVS, the version numbers will be missing; so sl@0: set ${ver} to the empty string instead: sl@0: set ver="" ;: if your shell is csh sl@0: ver="" ;: if your shell is sh sl@0: sl@0: - The following steps will build Tcl from the Terminal, assuming you are located sl@0: in the directory containing the tcl source tree: sl@0: make -C tcl${ver}/macosx sl@0: and the following will then install Tcl onto the root volume (admin password sl@0: required): sl@0: sudo make -C tcl${ver}/macosx install sl@0: if you don't have the admin password, you can install into your home directory, sl@0: instead by passing an INSTALL_ROOT argument to make: sl@0: make -C tcl${ver}/macosx install INSTALL_ROOT="${HOME}/" sl@0: sl@0: - The default Makefile targets will build _both_ debug and optimized versions of sl@0: the Tcl framework with the standard convention of naming the debug library sl@0: Tcl.framework/Tcl_debug. sl@0: This allows switching to the debug libraries at runtime by setting sl@0: export DYLD_IMAGE_SUFFIX=_debug sl@0: (c.f. man dyld for more details) sl@0: sl@0: If you only want to build and install the debug or optimized build, use the sl@0: 'develop' or 'deploy' target variants of the Makefiles, respectively. sl@0: For example, to build and install only the optimized versions: sl@0: make -C tcl${ver}/macosx deploy sl@0: sudo make -C tcl${ver}/macosx install-deploy