VICE on Windows - The Next G(TK)eneration
=========================================

These are some instructions about getting VICE with the GTK3 GUI
compiled on Windows under MinGW.

1. Get MSys2 (includes mingw):
 http://www.msys2.org/
Install as per that webpage; but, don't bother with step 7 (GIT),
unless you actually want GIT.


2. Install the stuff that you actually need to build VICE:
Launch either the MSYS2 MinGW 64-bit shell or the MSYS2 MinGW 32-bit shell
(use the one that matches the version of MSys2 that you installed).
Run the following command line to install your prerequisites:

$ pacboy sync base-devel: pkg-config gcc ntldd zip: subversion: gtk3 glew giflib

(Note: type the colons that you see in that command; they are important.
 Hit enter for the default on all the prompts, then wait for the 306 MiB
 of stuff to download and install.)


3. Then you need the xa 6502 cross-assembler, which is used to assemble the
"driver" program for vsid (the SID player that comes with VICE). It can be found
here: http://www.floodgap.com/retrotech/xa/

Don't log out of the shell.  After you download xa, go back to the shell.

Alternatively use wget to download it:

$ cd /c/Users/<login-name>/Downloads/
$ wget http://www.floodgap.com/retrotech/xa/dists/xa-2.3.9.tar.gz

Make the directory "/usr/local/src/".
Use tar to unpack xa (use the MSys2 path to where you downloaded it):

$ cd /usr/local
$ mkdir -p src
$ cd src
$ tar -xzf /c/Users/<login-name>/Downloads/xa-2.3.9.tar.gz

Then, build and install it:

$ cd xa-2.3.9
$ make mingw install
$ mv ../../bin/xa.exe ../../bin/xa65.exe


4. Get MiKTeX to build the PDF documentation (optional).

Download and install: https://miktex.org/howto/install-miktex

Set $PATH so configure will find the required binaries:

(my MiKTeX path is C:\miktex, I'll use that. Assumes msys 64-bit)
$ export PATH="$PATH:/c/miktex/miktex/bin/x64"

Remember to either do this last step every time you open the msys64 terminal
or edit your ~/.bashrc


5. Get VICE's source code.
To checkout the source with Subversion (to "~/vice/", for example),
you could type:

$ cd ~
$ svn checkout http://svn.code.sf.net/p/vice-emu/code/trunk/vice vice

Now, you can try to build VICE:

$ cd ~/vice
$ ./autogen.sh
$ ./configure -C --enable-native-tools --enable-native-gtk3ui
$ make
$ make bindist

NOTE: if you want to help us out, with bug reports, please instead configure
with:

$ ./configure -C --enable-native-tools --enable-native-gtk3ui --enable-debug-gtk3ui --enable-debug


5. If it got through all those steps, you should have some executables to play
with in "GTK3VICE-3.?-win??-*/" (the "win??" part of that name tells you which
type [32-bit or 64-bit] you built).

6. You can build the 32-bit version of VICE and/or the 64-bit version.  You
make the choice by choosing to run a particular one of the MSYS2 MinGW shells
(its environment variables control VICE's configuration).

If you build one version, then want to build the other version, you must clean
away some object files first.  Then, you must configure VICE again.

$ make clean
$ rm config.cache
$ ./configure -C --enable-native-tools --enable-native-gtk3ui
$ make
$ make bindist


7. If you want the distribution in a ZIP archive instead of a subdirectory,
then use the command

$ make bindistzip

instead of

$ make bindist

Enjoy!
