Installation instructions and notes
-----------------------------------

Basic installation procedure for Unix-like systems:

% tar -xzf d3demo-X.Y.tar.gz       (where X.Y is the version number)
% cd d3demo-X.Y
% make install

If just type "make", it will merely compile and link, not
install the files.

This installs into the default directory /usr/local. You can
specify a different base installation directory. Example:

% make DESTDIR=$HOME/d3demo install

If you want to also build and install the Lua module:

% make LUA=1 install

By default it will go into /usr/local/lib/lua/5.1. You can
specify a different path for the Lua module specifically by
setting the LUALIB_DIR variable. Example:

% make LUA=1 LUALIB_DIR=$HOME/lua-5.1/lib/lua/5.1 install

You may want to take a look at the Makefiles to see the
available options.

Installation procedure for Windows:

I'm not familiar with the compiling/linking/installation
process on Windows. It probably depends on your particular
setup.

If you have MinGW/MSYS then the procedure should be similar,
but you should check the Makefiles and change some options such
as the shared library name (which should end in .dll) and
directories.

If you're using a different compiler, you may have to change
some source code files too. Make sure your compiler packs
the structs marked with __pack__ in the d3demo_data.h header
file.

If you just have a very old version of GCC such as the one
used together with the Descent 3 SDK (egcs-1.1.2), you probably
don't have make, but you may be able to build a .dll like this:

gcc -O2 -mwindows -Iinclude -c -o reader.o reader.c
gcc -O2 -mwindows -Iinclude -c -o writer.o writer.c
gcc -O2 -mwindows -Iinclude -c -o d3demo_error.o d3demo_error.c
dllwrap -mwindows -o libd3demo.dll reader.o writer.o d3demo_error.o

If it complains about the use of fseeko() and ftello(), you can
change them to fseek() and ftell(), for example using some
#defines, and perhaps "typedef long off_t".
