Building PANO12.DLL for Windows

I'm no Windows expert, this tutorial is the first time I used these tools to
build software, so if I can do it, so can you compile the panotools.

The purpose of this exercise is to roll your own version of the pano12
Panorama Tools library. You might want to do this for fun, to play with
extending the code, fixing bugs or simply to remove the Field of View
restrictions on fisheye input images.

Set-up the build environment

To start you need a Free C compiler and associated tools, so
Download MinGW and MSYS. I grabbed the
"Windows Installer" versions: MinGW-4.1.1.exe and MSYS-1.0.10.exe.

The first one is the "Minimalist Gnu for Windows", it provides a win32 version
of the GNU compiler and related tools.

The second is a "Minimal SYStem", this provides a
POSIX environment. Answer yes to the
questions and enter the directory where you installed MinGW when asked:

C:\MinGW

Download the source-code

You also need the sourcecode for the various libraries required by pano12,
these are zlib,
libpng, libjpeg
and libtiff. There is no longer any need to
download the Java development kit as MinGW now includes a Free version.

I downloaded zlib123.zip, lpng128.zip, jpegsr6.zip and
tiff-v3.5.7.zip (I would normally download the .tar.gz versions, but
Windows seems to have some kind of .zip extractor built-in so I thought I'd
try that). Note that I had trouble with a later version of libtiff, tiff-v3.5.7
is the one that worked for me.

Extract the files into directories called libpano12, zlib, libpng,
libjpeg and libtiff.

If you want to create LZW compressed TIFF files with PTmender, then download
libtiff-lzw-compression-kit-1.5.tar.gz, extract the tif_lzw.c file and
overwrite the one supplied in this old version of libtiff.

The default MSYS home on this system is C:\msys\1.0\home\Bruno,
so I put these directories in there.

Build everything

Double-click MSYS and you should get a small window with a command-line,
this is a POSIX shell.

The following commands need to be typed into the shell. If you make a mistake,
just type cd to return to your home and try again.

Compilation results in lots of text scrolling very fast up the screen, ignore
any warnings, but error messages will give you a clue when things are not
working properly.