
This file describes how to build BLT under Windows 95/98/NT/2000/XP.

It's not necessary to compile BLT for Windows 95/98/NT/2000/XP.
Binary versions are available on ftp.tcltk.com/pub/blt.

 http://www.sourceforge.net/projects/blt/files/blt2.4z-for-8.0.exe
  		           -or-
 http://www.sourceforge.net/projects/blt/files/blt2.4z-for-8.1.exe
  		           -or-
 http://www.sourceforge.net/projects/blt/files/blt2.4z-for-8.2.exe
  		           -or-
 http://www.sourceforge.net/projects/blt/files/blt2.4z-for-8.3.exe

They will dynamically load into wish80.exe, wish81.exe, wish82.exe, or
wish83.exe by invoking

	package require BLT

from within your script.

If you really need to build BLT yourself, then hold onto your hat.
It's a lot more difficult to build BLT under Windows than under Unix.
Most Windows software is designed to be delivered as a self-installing
binary executable, therefore it's rare to find the installation tools
necessary to build and install BLT from the source code.  

1. What versions of Tcl/Tk can I use?

  Any stable release.  I've built and tested BLT with Tcl/Tk
  versions 8.0.5, 8.1.1, and 8.2.3, and 8.3.4.  Avoid the alpha and
  beta versions.

2. What compiler can I use?

  You can use one of the following compilers:

   1. Microsoft Visual C++ 5.0/6.0
   2. Cygwin's GNU CC 2.95.2 (with or without -mno-cygwin)
   3. Borland Free compiler 5.5.1

  I normally build with VC++ 6.0.  This is also what the binary Tcl/Tk
  distribution use.  

  Note: Unless it's your only option, I don't recommend using the
        Borland free compiler right now.

3. What "make" program do I need?

  I highly recommend installing the Cygwin tool suite.  You can pick
  this up from

    http://sourceware.cygnus.com/cygwin/setup.exe

  I normally use GNU make instead of Microsoft's nmake.  But you can
  also nmake.  If you have a choice, use the Cygnus tools.  For
  compiling with Borland's C compiler, you can use Borland's make.exe.

4. Do I need to compile the Tcl/Tk libraries?

  More than likely.  Unless you're compiling with Cygwin GCC and the
  cygwin-version of the Tcl/Tk libraries, you'll need to obtain the
  Tcl/Tk sources and compile them.

5. Is there anything else I need?

  By default, JPEG support is enabled.  It uses the jpeg-6b
  libraries from ftp.uu.net.  You can pick up the sources from

	ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz

  You can also use the Intel JPEG Libraries.  JPEG support is
  optional.  You can disable it.

6. Can I mix-and-match DLLs?

   You can't really mix the Borland and VC++ compiled DLLs.  BLT isn't
   stubbed and the symbol names are incompatible between versions.
   The various workarounds are difficult.

   I haven't tested this, but I believe you can load a GNU CC
   (-mno-cygwin) BLT24.dll into a VC++ compiled wish.  

   In general the best advice is to use the same compiler that
   that you compiled Tcl/Tk to compile BLT.  
   
7. What compiler should I use?

   Right now, probably Microsoft VC++.  This is what all Tcl/Tk
   releases 8.0 to present have been built with.  So you shouldn't
   have to work too hard to compile the Tcl and Tk libraries.
   
   Having said that, Cygwin's GNU CC works just fine.  You can
   obtain versions from Mumit Khan to build Tcl and Tk.  I recommend
   compiling the Tcl/Tk libraries yourself with the -mno-cygwin
   option.

   And if compiling Tcl and Tk is too much of a hassle, you can 
   always built BLT with the cygwin Tcl/Tk libraries (cygtcl80.dll
   and cygtk80.dll).  The downside is that the cygwin libraries are
   1) pretty old (version 8.0) and 2) there may be some
   incompatibilities between the native Win32 calls in BLT
   and the cygwin emulation layer.
  
   I have built BLT with the Borland free compiler.  It's not 
   100% yet.  The problems are 
      1) If you automatically load BLT from a script file, you
         will generate exception in the DLL.  Oddly enough, 
         you can source the script manually.
      2) Resampled images are blank (see the graph3.tcl and eps.tcl
         demos).  The same code works with both GCC and VC++.
      3) I can't even get wish83.exe to open a console window. 
         Weirdly, bltwish.exe does this properly.
      4) The turbo debugger is a pain.


Building BLT with Microsoft VC++, Cygwin Make, and VC++ compiled
Tcl/Tk libraries.
===================================================================

1. Install the Tcl/Tk sources.  They should reside in the
   same directory tree as the BLT sources.  

      	______________|______________
     	|          |       |        |
      blt2.4   tcl8.3.4  tk8.3.4   jpeg-6b

   
2. Build and install the Tcl and Tk libraries.

   cd tcl8.3.4/win
   nmake -f Makefile.vc 
   nmake -f Makefile.vc install
   cd ../../tk8.3.4/win
   nmake -f Makefile.vc
   nmake -f Makefile.vc install

3. In the BLT directory, edit ./win/makedefs. Set the following
   macros.


     v1	= 8.3			Tcl/Tk version.
     v2	= 83			Version number without dots.
     v3	= 8.3.4			Suffix of Tcl/Tk directories 

     prefix = C:/Program\ Files/Tcl
				Location of installed Tcl/Tk files.
     TOOLS32 = C:/Program\ Files/Microsoft\ Visual\ Studio/VC90
				Location of MS C compiler and tools.
     HAVE_JPEG = 0		

4. Compile and install.
   
   make -f Makefile.vc
   make -f Makefile.vc install
   
5. Add the location of BLT24.dll to your PATH variable and test
   BLT
	
   cd demos
   export PATH=/cygdrive/c/Program\ Files/Tcl/bin:$PATH

   bltwish.exe graph1.tcl
   
Building BLT with Microsoft VC++, nmake, and VC++ compiled Tcl/Tk
libraries.
====================================================================

1. Install the Tcl/Tk sources.  They should reside in the
   same directory tree as the BLT sources.  

      	______________|______________
     	|          |       |        |
      blt2.4   tcl8.3.4  tk8.3.4   jpeg-6b

   
2. Build and install the Tcl and Tk libraries.

   cd tcl8.3.4\win
   nmake -f Makefile.vc 
   nmake -f Makefile.vc install
   cd ..\..\tk8.3.4\win
   nmake -f Makefile.vc
   nmake -f Makefile.vc install

3. In the BLT directory, edit .\win\makedefs. Set the following
   macros.


     v1	= 8.3			Tcl/Tk version.
     v2	= 83			Version number without dots.
     v3	= 8.3.4			Suffix of Tcl/Tk directories 

     prefix = C:/Program\ Files/Tcl
				Location of installed Tcl/Tk files.
     TOOLS32 = C:/Program\ Files/Microsoft\ Visual\ Studio/VC90
				Location of MS C compiler and tools.
     HAVE_JPEG = 0		

4. Compile BLT.
   
   make -f blt.mak
   
5. Install BLT

   Since Windows doesn't provide tools to install software, we'll
   use Tcl/Tk to do it.  There's an install script in ./win/install.tcl.
   Add the location of wish83.exe to your PATH and run wish83.exe.

	wish83.exe ./win/install.tcl

6. Test BLT
	
   cd demos
   bltwish.exe graph1.tcl

Building BLT with Cygwin GCC and mingw (-mno-cygwin) Tcl/Tk libraries.
======================================================================

1. Install the Tcl/Tk sources.  They should reside in the
   same directory tree as the BLT sources.  

      	______________|______________
     	|          |       |        |
      blt2.4   tcl8.3.4  tk8.3.4   jpeg-6b

   
2. Install the cygwin tool suite.

3. Build and install the Tcl and Tk libraries.

   cd tcl8.3.4/win
   ./configure --prefix=/usr/local/tcl8.3.4
   make 
   make install
   cd ../../tk8.3.4/win
   ./configure  --prefix=/usr/local/tcl8.3.4
   make 
   make install

3. Compile and install BLT.
   
   ./configure --disable-cygwin --prefix=/usr/local/tcl8.3.4
   make 
   make install

4. Test BLT
	
   Add the location of wish83.exe to your PATH and run bltwish.exe.

   cd demos
   bltwish.exe graph1.tcl

Building BLT with Cygwin GCC and the cygwin distribution Tcl/Tk
libraries.
=============================================================

1. Install the cygwin tool suite.

2. Compile and install BLT.
   
   ./configure --disable-cygwin --with-scriptdir=/usr/share --prefix=/usr
   make 
   make install

3. Test BLT
	
   Add the location of wish83.exe to your PATH and run bltwish.exe.

   cd demos
   bltwish.exe graph1.tcl

Building BLT with Borland bcc55 and Borland compiled Tcl/Tk libraries.
======================================================================

1. Install the Tcl/Tk sources.  They should reside in the
   same directory tree as the BLT sources.  

      	______________|______________
     	|          |       |        |
      blt2.4   tcl8.3.4  tk8.3.4   jpeg-6b

   
2. Build and install the Tcl and Tk libraries.

   cd tcl8.3.4\win
   make -f Makefile.bc 
   make -f Makefile.bc install
   cd ..\..\tk8.3.4\win
   make -f Makefile.bc
   make -f Makefile.bc install

3. In the BLT directory, edit .\win\makedefs. Set the following
   macros.

     v1	= 8.3			Tcl/Tk version.
     v2	= 83			Version number without dots.
     v3	= 8.3.4			Suffix of Tcl/Tk directories 

4. Edit .\src\Makefile.bc

     prefix = C:\Program Files\Tcl
				Location of installed Tcl/Tk files.
     TOOLS32 = C:\Borland\BCC55\
				Location of Borland C compiler and tools.
     HAVE_JPEG = 0		

4. Compile BLT.
   
   cd src
   make -f Makefile.bc
   
5. Install BLT

   Since Windows doesn't provide tools to install software, we'll
   use Tcl/Tk to do it.  There's an install script in ./win/install.tcl.
   Add the location of wish83.exe to your PATH and run wish83.exe.

	wish83.exe ./win/install.tcl

6. Test BLT
	
   cd demos
   bltwish.exe graph1.tcl

