Building gretl on MS Windows with MSYS2/MinGW-w64
-------------------------------------------------

Allin Cottrell
August 29, 2017

It is possible to build current gretl on MS Windows (in our case,
Windows 10) using free, open-source tools; we've just done it, using
the gretl source-code from git.

You will need an MSYS2 environment with MinGW-w64 build-tools
(or at least, that's the only set-up that we have verified as
capable and can recommend with confidence).

MSYS2 can be found at http://www.msys2.org/ Download and installation
are pretty straightforward, but we strongly recommend reading the
long-form installation guide at

  https://github.com/msys2/msys2/wiki/MSYS2-installation

You will have to choose between 32-bit and 64-bit versions of the
system; we chose the 64-bit version. Our understanding is that you
really have a choice only if you're working on 64-bit Windows: in that
case you install the 64-bit version if you want to target 64-bit
Windows or the 32-bit version if you want to target 32-bit Windows (or
both, in parallel, if you want to target both platforms).  If you're
on 32-bit Windows yourself, just install the 32-bit version.

NOTE: MSYS2 uses the "pacman" package manager (ported from Arch
Linux). One important point to note is that many of the available
packages come in three forms, from three different repositories,
as follows:

  repository	package-name-prefix
  ----------	-------------------
  msys2		none
  mingw64	mingw-w64-x86_64
  mingw32	mingw-w64-i686

If you want to build software that's intended to run on 64-bit Windows
"natively" (without the benefit of an MSYS2 installation), give
preference to packages with the "mingw-w64-x86_64" prefix wherever
possible. If your target is "native" 32-bit Windows, give preference
to the "mingw-w64-i686" packages.

[INSERT, or give reference to, a suitable LISTING of PACKAGES]

Gretl source-code: You have to decide whether to use the sources from
a gretl release, or a gretl "snapshot", or git. If you want to err on
the side of conservatism, go for a release; if you want the "latest
and greatest" you need to choose between the current snapshot or
current git. There are pros and cons:

* If you use a snapshot you get the gretl documentation pre-built, but
  to update your sources you have to download the whole package again.

* If you use git updating is very easy -- just "git pull" -- but you
  either have to build the documentation yourself (relatively onerous)
  or download it separately.

If you decide in favor of a snapshot: go to

  https://sourceforge.net/projects/gretl/files/snapshots/

and download the current gretl-source.tar.xz.

If you decide in favor of git: visit

  http://gretl.sourceforge.net/gretl-git-basics.html

for instructions. But for a read-only copy of the gretl git source
it's just a matter of

  git clone git://git.code.sf.net/p/gretl/git gretl-git

in an MSYS2 terminal window -- assuming you've installed git, via

  pacman -S git
















