1Tk UNIX README 2-------------- 3 4This is the directory where you configure, compile, test, and install 5UNIX versions of Tk. This directory also contains source files for Tk 6that are specific to UNIX. 7 8The information in this file is maintained at: 9 http://www.tcl.tk/doc/howto/compile.html 10 11For information on platforms where Tcl/Tk is known to compile, along 12with any porting notes for getting it to work on those platforms, see: 13 http://www.tcl.tk/software/tcltk/platforms.html 14 15The rest of this file contains instructions on how to do this. The 16release should compile and run either "out of the box" or with trivial 17changes on any UNIX-like system that approximates POSIX, BSD, or System 18V. We know that it runs on workstations from Sun, H-P, DEC, IBM, and 19SGI, as well as PCs running Linux, BSDI, and SCO UNIX. To compile for 20a PC running Windows, see the README file in the directory ../win. To 21compile for Mac OS X, see the README file in the directory ../macosx. To 22compile for a classic Macintosh, see the README file in the directory ../mac. 23 24RCS: @(#) $Id: README,v 1.19.2.3 2007/05/25 16:03:37 dgp Exp $ 25 26How To Compile And Install Tk: 27------------------------------ 28 29(a) Make sure that the Tcl release is present in the directory 30 ../../tcl<version> (or else use the "--with-tcl" switch described 31 below). This release of Tk will only work with the equivalently 32 version Tcl release. Also, be sure that you have configured Tcl before 33 you configure Tk. 34 35(b) If you have already compiled Tk once in this directory and are now 36 preparing to compile again in the same directory but for a different 37 platform, type "make distclean" to discard all the configuration 38 information computed previously. 39 40(d) Type "./configure". This runs a configuration script created by GNU 41 autoconf, which configures Tk for your system and creates a 42 Makefile. The configure script allows you to customize the Tk 43 configuration for your site; for details on how you can do this, 44 type "./configure -help" or refer to the autoconf documentation (not 45 included here). Tk's "configure" script supports the following 46 special switches in addition to the standard ones: 47 --with-tcl=DIR Specifies the directory containing the Tcl 48 binaries and Tcl's platform-dependent 49 configuration information. By default 50 the Tcl directory is assumed to be in the 51 location given by (a) above. 52 --enable-threads If this switch is set, Tk will compile 53 itself with multithreading support. 54 --enable-shared If this switch is specified, Tk will compile 55 itself as a shared library if it can figure 56 out how to do that on this platform. This 57 is the default on platforms where we know 58 how to build shared libraries. 59 --disable-shared If this switch is specified, Tk will compile 60 itself as a static library. 61 --enable-symbols build with debugging symbols By default 62 standard debugging symbols are used. You 63 can specify the value "mem" to include 64 TCL_MEM_DEBUG memory debugging. 65 --disable-symbols build without debugging symbols 66 --enable-64bit enable 64bit support (where applicable) 67 --disable-64bit disable 64bit support (where applicable) 68 --enable-64bit-vis enable 64bit Sparc VIS support 69 --disable-64bit-vis disable 64bit Sparc VIS support 70 --enable-man-symlinks Use symlinks for linking the manpages that 71 should be reachable under several names. 72 --enable-man-compression=PROG 73 Compress the manpages using PROG. 74 Mac OS X only: 75 --enable-framework package Tk as a framework. 76 --disable-corefoundation disable use of CoreFoundation API. 77 --enable-aqua use Aqua windowingsystem rather than X11, 78 requires --enable-corefoundation with tcl & tk. 79 80 Note: by default gcc will be used if it can be located on the PATH. 81 if you want to use cc instead of gcc, set the CC environment variable 82 to "cc" before running configure. It is not safe to change the Makefile 83 to use gcc after configure is run. 84 85 Note: be sure to use only absolute path names (those starting with "/") 86 in the --prefix and --exec-prefix options. 87 88(e) Type "make". This will create a library archive called 89 "libtk<version>.a" or "libtk<version>.so" and an interpreter 90 application called "wish" that allows you to type Tcl commands 91 interactively or execute script files. 92 93(f) If the make fails then you'll have to personalize the Makefile 94 for your site or possibly modify the distribution in other ways. 95 First check the porting Web page above to see if there are hints 96 for compiling on your system. If you need to modify Makefile, 97 there are comments at the beginning of it that describe the things 98 you might want to change and how to change them. 99 100(g) Type "make install" to install Tk's binaries and script files in 101 standard places. You'll need write permission on the installation 102 directories to do this. The installation directories are 103 determined by the "configure" script and may be specified with 104 the --prefix and --exec-prefix options to "configure". See the 105 Makefile for information on what directories were chosen; you 106 can override these choices by modifying the "prefix" and 107 "exec_prefix" variables in the Makefile. 108 109(h) At this point you can play with Tk by invoking the "wish" 110 program and typing Tcl commands. However, if you haven't installed 111 Tk then you'll first need to set your TK_LIBRARY environment 112 variable to hold the full path name of the "library" subdirectory. 113 If you haven't installed Tcl either then you'll need to set your 114 TCL_LIBRARY environment variable as well (see the Tcl README file 115 for information on this). Note that installed versions of wish, 116 libtk.a, libtk.so, and the Tk library have a version number in their 117 names, such as "wish8.4" or "libtk8.4.so"; to use the installed 118 versions, either specify the version number or create a symbolic 119 link (e.g. from "wish" to "wish8.4"). 120 121If you have trouble compiling Tk, see the URL noted above about working 122platforms. It contains information that people have provided about changes 123they had to make to compile Tk in various environments. We're also 124interested in hearing how to change the configuration setup so that Tk 125compiles on additional platforms "out of the box". 126 127Test suite 128---------- 129 130Tk has a substantial self-test suite, consisting of a set of scripts in 131the subdirectory "tests". To run the test suite just type "make test" 132in this directory. You should then see a printout of the test files 133processed. If any errors occur, you'll see a much more substantial 134printout for each error. In order to avoid false error reports, be sure 135to run the tests with an empty resource database (e.g., remove your 136.Xdefaults file or delete any entries starting with *). Also, don't 137try to do anything else with your display or keyboard while the tests 138are running, or you may get false violations. See the README file in 139the "tests" directory for more information on the test suite. 140 141If the test suite generates errors, most likely they are due to non- 142portable tests that are interacting badly with your system configuration. 143We are gradually eliminating the non-portable tests, but this release 144includes many new tests so there will probably be some portability 145problems. As long as the test suite doesn't core dump, it's probably 146safe to conclude that any errors represent portability problems in the 147test suite and not fundamental flaws with Tk. 148 149There are also a number of visual tests for things such as screen layout, 150Postscript generation, etc. These tests all have to be run by manually 151enabling the "userInteraction" constraint when testing, and the results 152have to be verified visually.. This can be done with 153 make test TESTFLAGS="-constraints userInteraction" 154Some tests will present a main window with a bunch of menus, which you can 155use to select various tests. 156