Building Fuse on Windows with Cygwin

Sergio Baldoví

1. Introduction

This page describes how to build Fuse on Windows using Cygwin (http://www.cygwin.com), a collection of tools which provide a Linux look and feel environment for Windows. We will use Mingw-w64 cross compiler to produce native Windows libraries and applications. These instructions are correct as of November 2016.

Caution, line endings should be Unix style (LF), so use a text editor that can handle them (e.g., Notepad++).

2. Setting up the environment

Cygwin installation

Download the installer of Cygwin and run the setup program.

You should select the following packages (some others will automatically be selected as well):

Devel
  autoconf
  automake 
  bison
  flex
  gcc-core
  gcc-g++
  gettext-devel
  libtool
  make
  mingw64-i686-bzip2
  mingw64-i686-gcc-core
  mingw64-i686-gcc-g++
  mingw64-i686-libgcrypt
  mingw64-i686-libgpg-error
  mingw64-i686-libpng
  mingw64-i686-win-iconv
  mingw64-i686-winpthread
  mingw64-i686-zlib
  pkg-config

Perl
  perl

Then execute the shortcut created by the setup.

Environment variables

Custom build libraries will be installed into the prefix /usr/local/i686-w64-mingw32:

$ mkdir -p /usr/local/i686-w64-mingw32

In order to locate custom build libraries at build time and don't use the native Cygwin libraries, 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/i686-w64-mingw32/include
$ export LDFLAGS=-L/usr/local/i686-w64-mingw32/lib
$ export PKG_CONFIG_LIBDIR=/usr/local/i686-w64-mingw32/lib/pkgconfig:/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig

If you are not interested in compiling binaries for the Cygwin environment and want to make this setting permanent, you could add these lines into $HOME/.bash_profile and execute:

$ source $HOME/.bash_profile

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

$ echo $CPPFLAGS
$ echo $LDFLAGS
$ echo $PKG_CONFIG_LIBDIR

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. Usually, 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 last build the library:

$ cd audiofile-0.3.6/
$ ./configure --build=i686-pc-cygwin --host=i686-w64-mingw32 --prefix=/usr/local/i686-w64-mingw32 --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 --build=i686-pc-cygwin --host=i686-w64-mingw32 --prefix=/usr/local/i686-w64-mingw32 --disable-static --without-python --without-lzma --with-minimum --with-tree --with-writer
$ make
$ make install-strip
$ cd ..

libspectrum

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

$ cd libspectrum-1.3.1/
$ ./configure --build=i686-pc-cygwin --host=i686-w64-mingw32 --prefix=/usr/local/i686-w64-mingw32 --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.3.1.

$ cd fuse-1.3.1/
$ ./configure --build=i686-pc-cygwin --host=i686-w64-mingw32 --prefix=/usr/local/i686-w64-mingw32 --with-xml-prefix=/usr/local/i686-w64-mingw32 --with-win32
$ make
$ make dist-win32-dir

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

The application will need some custom build libraries from /usr/local/i686-w64-mingw32/bin:

libaudiofile-1.dll
libspectrum-8.dll
libxml2-2.dll

and some precompiled libraries from /usr/i686-w64-mingw32/sys-root/mingw/bin:

libbz2-1.dll
libgcc_s_sjlj-1.dll
libgcrypt-20.dll
libgpg-error-0.dll
libpng16-16.dll
libstdc++-6.dll
libwinpthread-1.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:

JavaScript is required for this form.





No, thanks