MinGW-w64 Build Instructions:

Here you will find instructions on how to build RRDtool using MinGW-w64.
Examples are given for building Windows binaries under Fedora, MSYS2 and MXE.

After a successful build, the RRDtool Windows binaries are found in the following folder:
src/.libs/
Compiled binaries: rrdtool.exe rrdupdate.exe rrdcgi.exe librrd-8.dll

1) Fedora
 - i686 (32-bit)
   Install the required dependencies:

   sudo dnf install mingw32-cairo mingw32-expat mingw32-fontconfig mingw32-freetype mingw32-gettext mingw32-glib2 mingw32-libpng mingw32-libxml2 mingw32-pango mingw32-pkg-config mingw32-windows-default-manifest mingw32-zlib perl-Pod-Html

   Run the following commands from the rrdtool-1.x directory:
   ./bootstrap
   ./configure --host=i686-w64-mingw32 --disable-static --disable-mmap --disable-tcl --disable-perl --disable-ruby --disable-python --disable-lua --disable-rrdcached PKGCONFIG=i686-w64-mingw32-pkg-config
   make LDFLAGS='-no-undefined' CFLAGS='-D__USE_MINGW_ANSI_STDIO=1'

- x86_64 (64-bit)
   Install the required dependencies:

   sudo dnf install mingw64-cairo mingw64-expat mingw64-fontconfig mingw64-freetype mingw64-gettext mingw64-glib2 mingw64-libpng mingw64-libxml2 mingw64-pango mingw64-pkg-config mingw64-windows-default-manifest mingw64-zlib perl-Pod-Html

   Run the following commands from the rrdtool-1.x directory:
   ./bootstrap
   ./configure --host=x86_64-w64-mingw32 --disable-static --disable-mmap --disable-tcl --disable-perl --disable-ruby --disable-python --disable-lua --disable-rrdcached PKGCONFIG=x86_64-w64-mingw32-pkg-config
   make LDFLAGS='-no-undefined' CFLAGS='-D__USE_MINGW_ANSI_STDIO=1'


2) MSYS2 (https://sourceforge.net/projects/msys2/)
 - i686 (32-bit)
   Install the required dependencies:

   pacman -Sy --needed base-devel mingw-w64-i686-gcc mingw-w64-i686-cairo mingw-w64-i686-expat mingw-w64-i686-freetype mingw-w64-i686-gettext mingw-w64-i686-glib2 mingw-w64-i686-libpng mingw-w64-i686-libxml2 mingw-w64-i686-pango mingw-w64-i686-zlib mingw-w64-i686-pkg-config

   Run the following commands from the rrdtool-1.x directory:
   ./bootstrap
   ./configure --host=i686-w64-mingw32 --disable-static --disable-mmap --disable-tcl --disable-perl --disable-ruby --disable-python --disable-lua --disable-rrdcached --without-libintl-prefix --without-libiconv-prefix
   make LDFLAGS='-no-undefined' CFLAGS='-D__USE_MINGW_ANSI_STDIO=1'

- x86_64 (64-bit)
   Install the required dependencies:

   pacman -Sy --needed base-devel mingw-w64-x86_64-gcc mingw-w64-x86_64-cairo mingw-w64-x86_64-expat mingw-w64-x86_64-freetype mingw-w64-x86_64-gettext mingw-w64-x86_64-glib2 mingw-w64-x86_64-libpng mingw-w64-x86_64-libxml2 mingw-w64-x86_64-pango mingw-w64-x86_64-zlib mingw-w64-x86_64-pkg-config

   Run the following commands from the rrdtool-1.x directory:
   ./bootstrap
   ./configure --host=x86_64-w64-mingw32 --disable-static --disable-mmap --disable-tcl --disable-perl --disable-ruby --disable-python --disable-lua --disable-rrdcached --without-libintl-prefix --without-libiconv-prefix
   make LDFLAGS='-no-undefined' CFLAGS='-D__USE_MINGW_ANSI_STDIO=1'

3) MXE (http://mxe.cc/ https://github.com/mxe/mxe)
 - i686 (32-bit)
   Build the required dependencies:

   make MXE_TARGETS='i686-w64-mingw32.shared' cairo expat fontconfig freetype gettext glib libpng libxml2 pango pkgconf zlib -j4

   Run the following commands from the rrdtool-1.x directory:
   ./bootstrap
   ./configure --host=i686-w64-mingw32.shared --disable-static --disable-mmap --disable-tcl --disable-perl --disable-ruby --disable-python --disable-lua --disable-rrdcached PKGCONFIG=i686-w64-mingw32.shared-pkg-config
   make LDFLAGS='-no-undefined' CFLAGS='-D__USE_MINGW_ANSI_STDIO=1'

- x86_64 (64-bit)
   Build the required dependencies:

   make MXE_TARGETS='x86_64-w64-mingw32.shared' cairo expat fontconfig freetype gettext glib libpng libxml2 pango pkgconf zlib -j4

   Run the following commands from the rrdtool-1.x directory:
   ./bootstrap
   ./configure --host=x86_64-w64-mingw32.shared --disable-static --disable-mmap --disable-tcl --disable-perl --disable-ruby --disable-python --disable-lua --disable-rrdcached PKGCONFIG=x86_64-w64-mingw32.shared-pkg-config
   make LDFLAGS='-no-undefined' CFLAGS='-D__USE_MINGW_ANSI_STDIO=1'
