| 1 |
This file describes how to compile and install the BLT library for UNIX. |
| 2 |
[See the file ./win/README for details on how to build under Win32.] |
| 3 |
|
| 4 |
1. Uncompress and untar the distribution file. |
| 5 |
|
| 6 |
zcat BLT2.4.tar.gz | tar -xvf - |
| 7 |
|
| 8 |
This will create a directory "blt2.4" with the following subdirectories: |
| 9 |
|
| 10 |
blt2.4 |
| 11 |
______________|_____________________________ |
| 12 |
| | | | | | | |
| 13 |
demos examples html library man src win |
| 14 |
| | | |
| 15 |
scripts shared X11 |
| 16 |
|
| 17 |
2. Run ./configure |
| 18 |
|
| 19 |
Go into the "blt2.4" directory |
| 20 |
|
| 21 |
cd blt2.4 |
| 22 |
|
| 23 |
and run the auto-configuration script "./configure". Tell where to find |
| 24 |
the Tcl and Tk header files and libraries with the "--with-tcl" switch. |
| 25 |
|
| 26 |
./configure --with-tcl=/util/lang/tcl |
| 27 |
|
| 28 |
Switches: |
| 29 |
|
| 30 |
--prefix=path Specifies the path where "bltwish", the BLT |
| 31 |
header files, libraries, scripts, and manual |
| 32 |
pages are installed. The default is |
| 33 |
"/usr/local/blt". |
| 34 |
|
| 35 |
This switch also indicates where to find the |
| 36 |
Tcl/Tk header files and libraries. You can use |
| 37 |
the --with-tcl and --with-tk switches to override |
| 38 |
this value if the location of the Tcl/Tk files |
| 39 |
is different. |
| 40 |
|
| 41 |
--with-tcl=dir Directory where Tcl and/or Tk is installed. |
| 42 |
|
| 43 |
--with-tk=dir Directory where Tk is installed if different |
| 44 |
from "--with-tcl". |
| 45 |
|
| 46 |
--with-cc=program Lets you specify the C compiler, such as |
| 47 |
"acc" or "gcc". |
| 48 |
|
| 49 |
The configure script creates a header file "src/bltConfig.h". It will also |
| 50 |
generate new Makefiles from their respective templates (Makefile.in). |
| 51 |
|
| 52 |
Makefile.in ==> Makefile |
| 53 |
src/Makefile.in ==> src/Makefile |
| 54 |
src/shared/Makefile.in ==> src/shared/Makefile |
| 55 |
man/Makefile.in ==> man/Makefile |
| 56 |
library/Makefile.in ==> library/Makefile |
| 57 |
|
| 58 |
3. Compile the libraries and build the demonstration program "bltwish". |
| 59 |
|
| 60 |
make |
| 61 |
|
| 62 |
The program "bltwish" will be created in the ./src directory. |
| 63 |
|
| 64 |
4. Test by running the demos. |
| 65 |
|
| 66 |
Go into the demos directory |
| 67 |
|
| 68 |
cd demos |
| 69 |
|
| 70 |
and run the test scripts. |
| 71 |
|
| 72 |
./graph1.tcl |
| 73 |
|
| 74 |
If your system doesn't support "#!" in shell scripts, then it's |
| 75 |
|
| 76 |
../src/bltwish ./graph1.tcl |
| 77 |
|
| 78 |
|
| 79 |
5. Installing BLT |
| 80 |
|
| 81 |
make install |
| 82 |
|
| 83 |
The following directories will be created when BLT is installed. |
| 84 |
By default, the top directory is /usr/local/blt. |
| 85 |
|
| 86 |
___________|__________ |
| 87 |
| | | | |
| 88 |
bin include lib man |
| 89 |
| |
| 90 |
blt2.4 |
| 91 |
____|____ |
| 92 |
| | |
| 93 |
demos dd_protocols |
| 94 |
|
| 95 |
You can change the top directory by supplying the "--prefix=dir" switch |
| 96 |
to ./configure. |
| 97 |
|
| 98 |
*6. (Optional) Compiling BLT into your own custom "wish". |
| 99 |
|
| 100 |
[If your version of "wish" supports dynamic loading of packages |
| 101 |
you can simply add |
| 102 |
|
| 103 |
package require BLT |
| 104 |
|
| 105 |
to the start of your script.] |
| 106 |
|
| 107 |
Add the following lines to your program's Tcl_AppInit routine in |
| 108 |
tkAppInit.c |
| 109 |
|
| 110 |
if (Blt_Init(interp) != TCL_OK) { |
| 111 |
return TCL_ERROR; |
| 112 |
} |
| 113 |
|
| 114 |
then link with libBLT.a. And that's all there's to it. |
| 115 |
|