See INSTALL for general notes, such as running 'make' and 'make check'

on Windows (using 32 bit MinGW64 via Msys2):

Here we give sources for the various packages needed. We give
directions to the download, rather than an exact URL, to make it easy
to check for new versions.

The versions given here may not be exactly the same versions as used to
build the current release of monontone.

These instructions work on a new computer, with only
32 bit Windows 7 installed.

Msys2 provides all of the tools required, and several of the packages.

Package       | Version  | location
--------------------------
msys2 32 bit  |          | http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/
              |          | Downloading | 32-bit | msys2-base-i686-20140216.tar.xz
botan         | 1.10.8   | http://botan.randombit.net/download.html
                         | "Source: >tar/bzip<" under "Current Stable Release"
                         | _not_ the "windows binary installer"
Depends.exe   |          | http://www.dependencywalker.com/ ; also comes with Visual Studio

The tools listed here are sufficient to build the monotone
executable and html and info documentation. However, the
'distcheck' target also builds the documentation in
postscript format, which requires tools not (yet) available
for MinGW. FIXME: verify

The commands below assume you download files to ~/Downloads.

FIXME: replace this file with an msys2 PKGBUILD

01. MSYS2
    following instructions at http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/

    more detailed instruction at http://sourceforge.net/p/msys2/tickets/32/?limit=10&page=1#216b

    for more help, consult the mailing list at https://lists.sourceforge.net/lists/listinfo/msys2-users

    Create directory c:/Msys2

    using 7-zip or Cygwin tar, unpack msys2-base-i686-20140216.tar.xz to c:/Msys2

    from cmd.exe (_not_ Windows Explorer), run c:\Msys2\msys32\msys2_shell.bat
        that starts an msys shell; exit it.

    start cmd.exe again, run c:\Msys2\msys32\msys2_shell.bat again

    in the msys32 shell, run 'pacman -Syu'. that gives errors about rebase. Exit the shell.

    in cmd.exe, run c:\Msys2\msys32\autorease.bat

    in cmd.exe, run c:\Msys2\msys32\msys2_shell.bat

    At this point, you can switch to another terminal emulator to run
    msys32 bash; I prefer emacs. Just be sure to invoke bash with '-i
    --login' to tell it to do the Msys2 path munging. Also 'export
    MSYSTEM=MSYS' to tell various tools to use Msys paths.

    in the msys shell:

    $ pacman -S mingw-w64-i686-toolchain
        # install all (just hit return)
        # IMPROVEME; don't need all of that
        # but 'pacman -Qo g++' gives 'error: No package owns /usr/mingw64/bin/g++'

    $ pacman -S autoconf automake
    $ pacman -S mingw32/mingw-w64-i686-sqlite3 mingw32/mingw-w64-i686-boost
    $ pacman -S mingw32/mingw-w64-i686-lua     mingw32/mingw-w64-i686-libidn
    $ pacman -S mingw32/mingw-w64-i686-pcre
    $ pacman -S msys/tar msys/make msys/python

02. botan
   $ mkdir /usr/src
   $ cd /usr/src
   $ export PATH=/mingw32/bin:$PATH
   $ tar xf ~/Downloads/Botan-1.10.8.tbz
   $ cd Botan-1.10.8
   $ ./configure.py --prefix=/mingw32 --cc=gcc --os=mingw --cpu=i686
   $ make install

03. Depends.exe
   If you have Visual Studio installed, you should be able to skip this.
   If you don't, then download the appropriate depends*.zip and
   unpack it someplace in your %PATH% (for example, C:\MinGW\bin\).
   This is only used by the testsuite, in particular the empty_environment test.
   If you just want to build monotone for your own use, you can skip this and
   just ignore that test failing.

04. build monotone
   $ export PATH=/mingw32/bin:$PATH
   $ cd /c/Projects/monotone
   $ autoreconf -i # not needed if you use the distributed tarball
   $ export botan_CFLAGS="-I/mingw32/include/botan-1.10"
   $ export botan_LIBS="-lbotan-1.10"
   $ ./configure
   $ make

See innosetup/README.txt for instructions on building the native Win32 installer.

(ediff "INSTALL_windows_msys2_32.txt" INSTALL_windows_msys2_64.txt")
