Compiling VICE on Win32 with Mingw32
====================================

To build VICE on Windows95/98/NT with the free GNU compiler, you have to set up
your environment right.  To make use of the VICE configure script which
generates the required Makefiles, there are two options: install Cygwin32, which
can be obtained from the following URL: http://cygwin.com/, or install MinGW and Mingw
Minimal System (MSYS), which can be obtained from the following URL: http://mingw.org

In these distributions there are all the valuable tool which are needed to build
VICE.  The Cygwin32 package comes with two set of compilers, its own (package gcc) and Mingw's (package gcc-mingw).
I don't recommend to build VICE with Cygwin's native compilers, because the generated
executables are bound to the Cygwin1.dll, which tries to emulate a POSIX conform layer. Good if you
have to port some UNIX code to Windows, but not necessary to compile VICE -
VICE is already configured to build a native Win32 application when used with
Mingw32.

To make use of this feature, you need either to use Mingw compilers under Cygwin environment,
or to install Mingw compilers along with the Mingw Minimal System.

Also, make sure that your version of the GNU compiler (be it the Mingw one or the Cygwin one)
is at least 2.95, because VICE for Windows won't compile with older versions.

The last thing needed for a successful VICE compilation is DirectX for Mingw32.
Because VICE makes use of DirectX and Mingw32 doesn't come with DirectX
included, you have to download and install it yourself.  It can be found for
example at http://www.spacejack.org/games/mingw/mingw-dx.html : follow the link to
DirectX7 SDK, then download the file dx7libhdr.exe.

I recommend extracting only the required headerfiles out of the
self-extracting archive to prevent the replacement of already existing ones in Mingw32.
To do so start the compilation of VICE and add the required headerfile 
after the build process stopped.  An error message will be prompted
which complains about the missing file.
Typically, you will need to add the files ddraw.h, dsound.h, dinput.h
and d3dtypes.h to the 'include' directory of the GNU compiler.

If you use Mingw Minimal System, after running MSYS you can change-dir into the VICE directory.

If you have checked out the unstable svn version of VICE you need to generate
the configure script first by doing:

./autogen.sh

The stable tarball already has the configure script, so continue with:

./configure

After configure has finished, you can initiate the build process by simply typing 'make'.  
This should hopefully be enough to produce all of the VICE emulators on your Windows system.

If you use Cygwin, and want to use Cygwin's compilers, run
Cygwin Bash shell, change-dir into the VICE directory
and type './configure'.  After configure has finished, you can initiate the
build process by simply typing 'make'.

If you use Cygwin, and want to use Mingw's compilers, run
Cygwin Bash shell, change-dir into the VICE directory
and type 

CC='gcc -mno-cygwin' CXX='g++ -mno-cygwin' ./configure

.  After configure has finished, you can initiate the
build process by simply typing 'make'.

After the build process has finished you can make a binary  distribution
by typing 'make bindist'.

You can then run VICE from the newly created binary distribution directory.

Questions related to the described set-up of the Cygnus/Mingw32/DirectX
environment can be sent to 'gritsch@iue.tuwien.ac.at'

Have fun!
