Building Fuse on Windows with MinGW and MSYS

Sergio Baldoví

1. Introduction

This page describes how to build Fuse on Windows using the MinGW toolchain (http://www.mingw.org) and MSYS, an environment that includes a collection of Unix tools. These instructions are correct as of July 2016.

NOTE: MSYS provides a rather outdated environment. MSYS2 or Cygwin are better alternatives.

2. Setting up the environment

MinGW installation

Download the installer of MinGW and run the setup program.

You should select the following packages (other dependencies will be automatically selected as well):

Basic Setup
  mingw-developer-toolkit (bin)
  mingw32-base (bin)
  mingw32-gcc-g++ (bin)

All Packages
  mingw32-bzip2 (dev)
  mingw32-libz (dev)
  mingw32-pthreads-w32 (dev)
  msys-man (bin)
  msys-mintty (bin)

Then execute the post installation script located at

c:\MinGW\msys\1.0\postinstall\pi.bat

and answer the questions. That will make the gcc compiler visible in MSYS.

Finally, you can start a MSYS shell by:

c:\MinGW\msys\1.0\msys.bat

although there is a more usable shell (mintty) available by:

c:\MinGW\msys\1.0\msys.bat --mintty

pkg-config

pkg-config is not installed by MinGW setup program. Get pkg-config-lite-0.28-1_bin-win32.zip from <http://sourceforge.net/projects/pkgconfiglite/> and unpack into C:\MinGW.

Alternatively, you could get the official binary (http://www.gtk.org/download/win32.php), but that would need extra dependencies like glib.

DirectX headers

Fuse for Windows needs some headers to play sound smoothly (not choppy). Unpack the headers (http://www.libsdl.org/extras/win32/common/directx-devel.tar.gz) into C:\MinGW\include, but skip the libraries.

Environment variables

Custom build libraries will be installed into /usr/local/bin (or C:\MinGW\msys\1.0\local\bin). In order to locate custom build libraries at build time, you need to manually pass some variables to the configure scripts, but it is easier to export some variables, e.g.,

$ export CPPFLAGS=-I/usr/local/include
$ export LDFLAGS=-L/usr/local/lib
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

You should set these variables on every shell start.

You could automate this step by adding the former lines into $HOME/.bash_profile and executing:

$ source $HOME/.bash_profile

Anyway, check out the value of these variables before continuing:

$ echo $CPPFLAGS
$ echo $LDFLAGS
$ echo $PKG_CONFIG_PATH

3. Building dependencies

Let's start building some libraries needed by libspectrum and Fuse. Only libspectrum is a requirement for Fuse, the rest provide some features than could be disabled. Normally, you should use the latest version available.

audiofile

Get the source tarball from <http://audiofile.68k.org/>. The current version is 0.3.6.

First apply this patch:

Edit libaudiofile/CAF.cpp and replace:
    bzero(m_codecData->data(), m_codecData->size());
with:
    memset(m_codecData->data(), 0, m_codecData->size());

and then build the library:

$ cd audiofile-0.3.6/
$ ./configure --disable-static
$ make
$ make install-strip
$ cd ..

libpng

Get the source tarball from <http://www.libpng.org/pub/png/libpng.html>. The current version is 1.6.23.

$ cd libpng-1.6.23/
$ ./configure --disable-static
$ make
$ make install-strip
$ cd ..

libgpg-error

Get the source tarball from <ftp://ftp.gnupg.org/gcrypt/libgpg-error/>. The current version is 1.23.

First apply these patches:

Edit `potomo' file and replace `--silent' with `-s'

and

Edit `src/estream.c' file and insert a new line:
#define EWOULDBLOCK 11

and then build the library:

$ cd libgpg-error-1.23/
$ ./configure --disable-static --disable-nls
$ make
$ make install-strip
$ cd ..

libgcrypt

Get the source tarball from <ftp://ftp.gnupg.org/gcrypt/libgcrypt/>. The current version is 1.7.1.

$ cd libgcrypt-1.7.1/
$ ./configure --disable-static
$ make
$ make install-strip
$ cd ..

libxml2

Get the source tarball from <ftp://xmlsoft.org/libxml2/>. The current version is 2.9.4.

$ cd libxml2-2.9.4/
$ ./configure --disable-static --without-iconv --without-python --without-lzma
$ make
$ make install-strip
$ cd ..

libspectrum

Get the source tarball from <http://sourceforge.net/projects/fuse-emulator/files/libspectrum/>. The current version is 1.2.1.

$ cd libspectrum-1.2.1/
$ ./configure --disable-static --with-fake-glib
$ make
$ make install-strip
$ cd ..

4. Building Fuse

Get the source tarball from <http://sourceforge.net/projects/fuse-emulator/files/fuse/>. The current version is 1.2.1.

$ cd fuse-1.2.1/
$ ./configure --with-win32
$ make
$ make dist-win32-dir GROFF=""
$ cd ..

That should make the fuse-1.2.1-win32/ directory with almost all files.

The executable will need some custom build libraries from C:\MinGW\msys\1.0\local\bin (or /usr/local/bin):

libaudiofile-1.dll
libgcrypt-20.dll
libgpg-error-0.dll
libpng16-16.dll
libspectrum-8.dll
libxml2-2.dll

and some precompiled libraries from C:\MinGW\bin (or /mingw/bin):

libbz2-2.dll
libgcc_s_dw2-1.dll
libstdc++-6.dll
pthreadGC2.dll
zlib1.dll

Congratulations! You have now built Fuse for Windows from sources.


Related

Wiki: Home

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks