Loudmouth on Windows

Loudmouth 1.0.3 or earlier is not available on Windows. To build or use Loudmouth on Windows, you need at least version 1.1.1.

This page describes how to get Loudmouth compiling on Windows under the MinGW/MSYS environment with the GCC compiler, since that is what we are supporting at this point.

MSYS & MinGW

MSYS is a Minimal SYStem to provide POSIX/Bourne configure scripts the ability to execute and create a Makefile used by make. This is basically our shell to run commands from.

MinGW is a collection of freely available and freely distributable Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs.

You can get both of these from here: http://www.mingw.org/

MinGW

The download used to build Loudmouth is found here

Once downloaded, run the MinGW-5.0.2.exe installation:

  • Then select a mirror and the option to download as needed and install and then click Next.
  • Then select the current MinGW package to install and click Next.
  • Then select the minimal type of install and click Next to begin.

This can take some time downloading and installing the packages.

MSYS

The download used to build Loudmouth is found here.

Once downloaded, run the MSYS-1.0.10.exe installation:

  • Accept all the default options when installing until you are met with a terminal or DOS window.
  • In the terminal window:
    • Enter y to continue with the post install.
    • Enter y to acknowledge that you have a MinGW installation.
    • Enter c:/MinGW as the path to your MinGW installation (unless you changed it).
MSYS DTK

The download used to build Loudmouth is found here.

This is needed for some of the developer tools like Perl which is needed to build autoconf.

Once downloaded, run the msysDTK-1.0.1.exe and accept all the default settings.

That should be it.

Environment

To set the build environment up, a file with the following contents is used (~/env)

export PREFIX=/c/msys/1.0/home/martyn/build
 
export PATH=$PREFIX/bin:$PATH
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
 
export ACLOCAL_FLAGS="-I $PREFIX/share/aclocal"
 
export CFLAGS="-I$PREFIX/include"
export LDFLAGS="-L$PREFIX/bin"

When building software, the above file is sourced to set up the environment. However, if you do this, SSL CVS doesn't work (but anonymous CVS does).

The directory $home/build (which is $PREFIX) is created and all source packages which are unpacked and built are in $home/source.

Tool Chain

The versions packaged with MSYS of libtool, autoconf and automake are not sufficient to build some of the libraries we need to get Loudmouth building. You will need these libraries:

libtool-1.5.22 http://www.gnu.org/software/libtool/
autoconf-2.59 http://ftp.gnu.org/gnu/autoconf/
automake-1.96 http://ftp.gnu.org/gnu/automake/

Untar the downloads into the source directory and build them in the order above using:

  • ./configure --prefix=$PREFIX
  • make
  • make install

Running libtool is very slow on Windows. It really can make a grown man cry. Substantial speedup can be achieved by using libtool-cache by Robert Ă–gren. Install it and run libtoolcacheize each time after running autogen.sh (or configure).

You can avoiding relinking in libtool, this is optional, but Tor Lillqvist edits the line in ltmain.sh that says:

need_relink=yes

to

need_relink=no

This speeds up the "install" phase as no relinking needs to be done.

If you decide to try to avoid relinking, too, you need to edit the ltmain.sh in its installed location ($prefix/share/libtool/ltmain.sh) in the case of building modules from CVS.

In the case of building something from a tarball, edit the ltmain.sh that came from the tarball, as that is what running the configure script will use.

CVS

You can download this from http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/. Once downloaded, unzip the contents (which should just be the cvs.exe file) into $PREFIX/bin.

Next set up your CVSROOT environment variable in:

  • Start->Settings->Control Panel->System.
  • Select the Advanced tab and the Environment Variables button.
  • For users with an account:
    • Create a new user variable for CVSROOT and set it to ''':ext:@cvs.gnome.org:/cvs/gnome.
    • Create a new user variable for CVS_RSH and set it to ssh.
    • Copy your ssh keys into your $home/.ssh directory.
  • For users without an account:
    • Create a new user variable for CVSROOT and set it to :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome.
    • You will need to login first, you may find that this is not possible in MSYS even though cvs asks for a password, nothing happens when you enter it. If this is the case, you will need to do the cvs login from a DOS window. When doing this, make sure you:
      set HOMEPATH=\msys\1.0\home\

You will need to restart the MSYS environment once these variables have been created for them to be picked up by CVS.

When running CVS from MSYS, do NOT source the environment file created earlier, if you do, it just stalls and nothing happens.

Gtk-doc

To do this we fake its existence, first, fetch the gtk-doc sources, then:

$ cp gtkdocize.in gtkdocize

Edit the new file and change:

@PACKGAGE@ = gtk-doc
@VERSION@ = 1.0
@PREFIX@ = /home/martyn/build
@datadir@ = /home/martyn/build/share

Then install a few files into place

$ cp gtk-doc.m4 $PREFIX/share/aclocal
$ cp gtkdocize $PREFIX/bin
$ mkdir -p $PREFIX/share/gtk-doc/data/ 
$ cp gtk-doc.make $PREFIX/share/gtk-doc/data

Glib

At the time of writing this glib 2.10.1 was the most up to date version available on Tor Lillqvist's site (http://www.gimp.org/~tml/gimp/win32/downloads.html). You will need to download:

  • GNU libiconv for Windows.
  • gettext-.zip
  • gettext-dev-.zip
  • glib-.zip
  • glib-dev-.zip

Once downloaded, extract them all into $PREFIX.

Issues

Some of the GIOChannel issues that used to exist with file descriptor watches have been fixed. However, there are still one or two issues which were found while porting:

  • #331214 - g_io_channel_async socket io stalls.

Pkg-config

You can find pkg-config for Windows on the download page at the GIMP website http://www.gimp.org/~tml/gimp/win32/downloads.html.

Extract all the file into $PREFIX.

OpenSSL

This is COMPLETELY optional. If you don't want OpenSSL or GNU TLS support you can use the --with-ssl=no command line option when running ./autogen.sh for Loudmouth.

We tried to use the openssl package available from the gnuwin32 sourceforge project (http://gnuwin32.sourceforge.net/packages.html) but libcrypto.dll is not provided, so we built OpenSSL from source.

We used version 0.9.8a from http://www.openssl.org/source/.

After unpackaging the tarball into your source directory, go into that directory and run:

$ ./Configure no-hw mingw --prefix=$PREFIX

When complete, run:

$ make links depend all

Then when everything has compiled successfully, you need to create the DLLs. This can be done with the following commands:

$ echo EXPORTS > libcrypto.def
$ nm libcrypto.a | grep ' T _' | sed 's,^.* T _,,' >> libcrypto.def
$ dllwrap -o libcrypto.dll --def libcrypto.def libcrypto.a -lws2_32 -lgdi32
$ echo EXPORTS > libssl.def
$ nm libssl.a | grep 'T _' | sed 's,^.* T _,,' >> libssl.def
$ dllwrap -o libssl.dll --def libssl.def libssl.a libcrypto.dll

Now you should have two new DLLs to use. Unfortunately, make install does not work properly here. It will ignore your $PREFIX argument and install everything into /usr/local/ssl.

You need to copy those directories into $PREFIX. You will also have to put the DLLs you just created into $PREFIX/bin.

Loudmouth

If you want to build with SSL support use:

./autogen.sh --prefix=$PREFIX --with-ssl=openssl

Other wise, use:

./autogen.sh --prefix=$PREFIX --with-ssl=no

Unfortunately, GNU TLS is a lot harder to get going on Windows and has not been documented here, but if you have it working for you, then by all means use it. It is the default SSL option, so no --with-ssl argument is required in this case.