This information comes from the file make-dll.zip in your
package, Dom.  Where did this come from?
----------------------------------------------------------


      USING THE FREE BORLAND C++ COMPILER TO BUILD THE LPNG DLL
                        A note for C novices


As a keen Delphi person, I find C and C++ very arcane in the multiplicity
of commands and file types you need to work with.  I guess I have just 
grown up and been spolied by Delphi!  However, with the recent release 
of Borland's premier C++ compiler in command line form, and with a 
performance challenge to improve the speed of PNG files in my software,
there was a chance to see how the free tools could be used.


-------------------------------------------------
Getting the Compiler

First, you need the C++ compiler.  You can get this from the Borland 
Community Web site at community.borland.com.  After you have downloaded 
the file freecommandLinetools.exe, run it to install the tools.  Mine 
was installed to:  E:\Borland\BCC55.  You should then ensure that the 
Borland compiler and linker are on your path.  In my case I had to 
add: E:\Borland\BCC55\bin to the path.  Doing this means fewer edits 
to the MAKE files!


-------------------------------------------------
Preparing to download

You will need a new folder to contain the sources (and other files) that
you will get from downloading the component parts of LPNG, that is the 
PNG code and the ZLIB compression code.  Create a new folder, I used 
G:\Davids\C\lpng

Copy the files from make-dll.zip to this folder.

Next you can edit the file MAKEFILE.BOR to point the tools and the source
code paths appropriately.

Line 21: point to the folder you have created: G:\Davids\C\lpng
Line 22: point to the Borland include folder: E:\Borland\BCC55\include
Line 30: remove the path leaving: CC=bcc32
Line 36: replace -3 by -5 if you wish Pentium code
Lines 116 - end can be removed if you don't wish the test programs

Next, edit the file LINK.BAT

Assuming that you have the Borland compiler on your path, you can remove 
the absolute references, i.e. 

  replace  d:\bc5\bin\tlib  with  tlib

throughout the file.


-----------------------------------------
Downloading zlib

Visit the ZLIB site at: http://www.info-zip.org/pub/infozip/zlib/

About half way down the page, a link to "zlib source code, version 1.1.3, 
zipfile format".  Note that you can get TAR format (which has those UNIX-
style end of line characters, but you want the DOS/Windows style files
found in the Zip archive.  I used the version from US (California) 
which was:

  http://www.info-zip.org/pub/infozip/zlib/zlib.zip

Place the Zip file into the folder of you choice:

  G:\Davids\C\libpng

and expand it.  Using WinZip, the files end up in

  G:\Davids\C\libpng\zlib

and various sub-folders.  There's a lot of stuff you can read there if
you wish.


-----------------------------------------
Compiling zlib

Now you need to invoke the batch procedure that runs the commands to 
make the object files, so at a command prompt in 
G:\Davids\C\libpng\zlib enter:

  CMPZLIB  (runs CMPZLIB.bat)

Sample results from this operation are in CompileZlib.txt.

To create the library, run the LINK.BAT command

Sample results in LinkZlib.txt.

The key file which remains is zlib.lib, which contains all the code
from the .OBJ files that the C compiler produced.  It's like a 
combined DCU in Delphi.


-----------------------------------------
Getting libpng

Visit the libpng source site at: 
  http://sourceforge.net/project/showfiles.php?group_id=5624

Note that the current version is held elsewhere, but we need an older
version.  About 1/3 of the way down the page there is:

   lpng106.zip 461078 

which points to the file:

  http://download.sourceforge.net/libpng/lpng106.zip

Download this file in your folder, e.g. G:\Davids\C\libpng.  When you 
expand this archive, you will see that it puts an extra folder level, 
lpng106, into the tree.  We don't really need this, so rename the first 
level folder:

  G:\Davids\C\libpng\lpng106
to
  G:\Davids\C\libpng\lpng106xx

then move the folder:
  G:\Davids\C\libpng\lpng106xx\lpng106
to
  G:\Davids\C\libpng\lpng106

The now empty folder lpng106xx can now be deleted.

Move or copy the file PNGDLL.MAK from you zlib folder to your lpng106
folder and edit it thus:

Line 15: point to your zlib folder: G:\Davids\C\libpng\zlib
Line 18: point to your lpng106 folder: G:\Davids\C\libpng\lpng106
Line 19: point to the Borland include folder: E:\Borland\BCC55\include
Line 20: point to your zlib folder: G:\Davids\C\libpng\zlib
Lines 23: remove the absolute reference
Lines 25: remove the absolute reference AND replace tlink32 with ilink32
Lines 23, 25-27: remove the absolute references

With your command prompt, change directory into your lpng folder,
and enter the command MAKE -f PNGDLL.MAK

Sample run attached as BuildDll.txt


The result should be a file lpng.dll and a whole lot of other stuff!


---------------------------------------------------------------
Information supplied by: David J Taylor, Edinburgh
E-mail:   davidtaylor@writeme.com
Web site: www.satsignal.net
2000 Nov 22
