If you don't have MinGW setup yet do so now. Download the Automated MinGW Installer and MSYS Base System packages.

This is probably a good time to download all the dependancies too:

These notes assume all packages are in a directory called src in your home directory. Now fire up the MSYS terminal (bash shell).

SDL

~/src$ tar -xzf SDL-1.2.12.tar.gz
~/src$ cd SDL-1.2.12
~/src/SDL-1.2.12$ ./configure --prefix=/mingw
~/src/SDL-1.2.12$ make && make install

SDL_image

SDL_image will perform dynamic loading of the various image processing libraries so they are all technically optional. Lemon Launcher requires at least support for .png. If you want to load .jpg files for example you will need to install libjpeg.

~/src$ tar -xzf zlib-1.2.3.tar.gz
~/src$ cd zlib-1.2.3
~/src/zlib-1.2.3$ ./configure --prefix=/mingw
~/src/zlib-1.2.3$ make && make install

~/src$ tar -xzf libpng-1.2.23.tar.gz
~/src$ cd libpng-1.2.23
~/src/libpng-1.2.23$ ./configure --prefix=/mingw
~/src/libpng-1.2.23$ make && make install

~/src$ tar -xzf SDL_image-1.2.6.tar.gz
~/src$ cd SDL_image-1.2.6
~/src/SDL_image-1.2.6$ ./configure --prefix=/mingw
~/src/SDL_image-1.2.6$ make && make install

When running the configure script for SDL_image, watch for the libpng check. If there is a message that says libpng not found, retrace your steps and make sure libpng was installed correctly.

SDL_ttf

~/src$ tar -xzf freetype-2.3.5.tar.gz
~/src$ cd freetype-2.3.5
~/src/freetype-2.3.5$ ./configure --prefix=/mingw
~/src/freetype-2.3.5$ make && make install

~/src$ tar -xzf SDL_ttf-2.0.9.tar.gz
~/src$ cd SDL_ttf-2.0.9
~/src/SDL_ttf-2.0.9$ ./configure --prefix=/mingw
~/src/SDL_ttf-2.0.9$ make && make install

SDL_gfx

SDL_gfx needs some care when building in mingw. Open Makefile.mingw in your favourite text editor and set the prefix variable to /mingw. Save and close the file.

~/src$ tar -xzf SDL_gfx-2.0.16.tar.gz
~/src$ cd SDL_gfx-2.0.16
# edit SDL_gfx-2.0.16/Makefile.mingw
~/src/SDL_gfx-2.0.16$ make -f Makefile.mingw install
# install script puts the dll in the wrong spot
~/src/SDL_gfx-2.0.16$ mv /mingw/lib/SDL_gfx.dll /mingw/bin

libConfuse

libConfuse needs some coaxing to build in mingw. These instructions are for version 2.5 of the library, so your millage may vary on newer versions.

First extract the source code:

~/src$ tar -xzf confuse-2.5.tar.gz
~/src$ cd confuse-2.5

Now create a patch file ~/src/confuse-2.5/confuse.h.patch with the following contents:

60a61
> #ifndef __GNUC__ /* Not MINGW */
65a67,69
> #else /* MINGW */
> # define DLLIMPORT
> #endif /* MINGW */

Now patch the header and run configure and make:

~/src/confuse-2.5$ patch src/confuse.h confuse.h.patch
~/src/confuse-2.5$ ./configure --prefix=/mingw
~/src/confuse-2.5$ make

You will likely get an error in reread.c complaining that SIGHUP was undeclared. That's ok, it's just the tests failing. Since the build didn't actually finish, we can't use make install so just manually copy the files into mingw.

~/src/confuse-2.5$ cp src/.libs/libconfuse.a src/.libs/libconfuse.la /mingw/lib
~/src/confuse-2.5$ cp src/confuse.h /mingw/include

SQLite

SQLite is only required for version 0.0.7 and up of lemon launcher. If you get the sqlite-amalgamation-x.x.x package, installation is a cinch.

~/src$ tar -xzf sqlite-amalgamation-3.5.6.tar.gz
~/src$ cd sqlite-3.5.6
~/src/sqlite-3.5.6$ ./configure --prefix=/mingw
~/src/sqlite-3.5.6$ make && make install