From Glom
Revision as of 15:32, 23 November 2010 by Isijujemiru (Talk | contribs)

Jump to: navigation, search

Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly


Compiling Glom on Windows

MingW setup

I compiled Glom in a newly installed Windows XP Professional (which was shipped with my laptop) within a virtual machine. First, I installed firefox and 7-zip. Then, let us install the mingw compiler:

Load msysCORE-1.0.11-2007.01.19.tar.bz2 from, unpack into C:\msys, then install:

  • mingw-runtime-3.13.tar.gz from
  • w32api-3.10.tar.gz from
  • binutils-2.17.50-20060824-1-.tar.gz from
  • gcc-core-3.4.5-20060117-1.tar.gz from
  • gcc-g++-3.4.5-20060117-1.tar.gz from

Extract all into C:\mingw. Note: You need all of those, newer versions are probably OK. Run C:\msys\postinstall\pi.bat, answer yes when it asks whether mingw is already installed and point it to C:/mingw. Launching C:\msys\msys.bat now provides us with a minimal unix-like shell You might also have a look at the mingw installer which automates at least some of the steps explained above.

Hint: You get a terminal with working home and end keys if you rename C:/msys/bin/rxvt.exe into something else in which case sh.exe will be used instead. However, it has several other drawbacks. You can't copy & paste from/to there, and you cannot just scroll with Shift+PgUp/PgDown.

Install ActivePerl from to C:\Perl. For most things we will use the perl package provided by mingw, but for a few things we need some perl packages that are shipped with ActivePerl, so this is easiest.

Autotools setup (to generate build files)

We will have to build a few packages directly from SVN instead of tarballs, and for this we need autotools to work. For this, get some recent autoconf (such as 2.61) from the mingw site (at the time of this writing there were two different autoconf packages available, I used the one from here). Then, download a recent enough m4 from, unpack somewhere in your msys home directory, and run

 ./configure --prefix=/usr && make && make install

Then, load automake 1.10 from, run

 ./configure --prefix=/usr && make && make install

Then apply this patch to /bin/aclocal (assuming you have installed msys in C:\msys, adjust the path if you haven't). It fixes some path issue in the aclocal script that prevents it from finding the installed .m4 files.

Next, load (or a more recent version) from, unpack the zip to somewhere and add it the path to the extracted binaries to your PATH, so you can use svn in msys. You can either do this by adding it to the system PATH (via Control Panel -> System -> Advanced -> Environment Variables) or by adding the line

 export PATH=$PATH:/c/Program Files/Subversion/bin

to the file ~/.profile (~ refering to your msys home directory). Note that you do need to relogin into msys for the change to take effect. You can create the ~/.profile file if it does not exist already.

To generate the build files for some gnome packages we also need gtk-doc. Therefore, load it from, unpack and run

 ./configure --prefix=/usr && make && make install

If all this went well, then the following two commands should run flawlessly without error:

 svn co gnome-comon
 ./ --prefix=/usr; make && make install

Some other packages need gnome-common to build.

Installing Glom dependencies

So far for the basics. Before building Glom, we need several dependencies, though, including GTK+, gtkmm, Python and Postgresql.

Download the GTK+ bundle from, unzip to C:\msys. This is a complete GTK+ setup, you should now be able to run GTK programs such as gtk-demo.exe in msys. To use the Windows theme, execute the following command:

 echo "gtk-theme-name = \"MS-Windows\"" > /etc/gtk-2.0/gtkrc

Then, add these lines to your ~/.profile file (creating it if it does not exist already):

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

The PKG_CONFIG_PATH is to make pkg-config find our self-built libraries which we are going to install to /local, to keep it separate from the precompiled ones. By default, the compiler does not seem to search in /include (which is equivalent to /usr/include on linux systems) for header files, so we also add these to ~/.profile.

Download a libsigc++ tarball from, unpack, and run

 ./configure && make && make install

Download a glibmm tarball from, unpack, and run

 ./configure && make && make install

Download a cairomm tarball from, unpack, and run

 ./configure && make && make install

Download a gtkmm tarball from, unpack, and run

 ./configure && make && make install

I hope there will be a bundle or installer for gtkmm windows binaries in the near future.

Download libxml2 and iconv binaries and development files (for iconv, both are already contained in from, unzip both into C:\msys

We also need libxslt for glom. This is a bit difficult, since the precompiled binaries I found in the internet did not include a libxslt.pc file for pkg-config, and building it against the precomiled libxml2 we installed above is difficult because it does not include a libxml2-config (which the libxslt configure script requires). Also, it does only create static libraries by default. I hacked a bit to produce a correct libxslt DLL, and made it available here. Extract it to C:\msys\local.

<!-- libglade is no longer required We need libglade from SVN since it contains a patch that has not yet been released yet. This should now be as simple as

 svn co libglade
 ./; make && make install

Otherwise, you can still do the checkout on a(nother) linux machine, run there and produce a tarball via make dist, and use that one instead.

Download a libglademm tarball from, unpack and run

 ./configure && make && make install

--><!-- I switched back to building postgresql myself, see also

Download the postgresql installer from Make sure you also install the header and library files. Add the directory to your ~/.profile, so the compiler will find the files, for example:

 export PATH=$PATH:/c/Program Files/Subversion/bin:/c/postgres/bin
 export CPPFLAGS="-I/include -I/c/postgres/include"
 export LDFLAGS="-L/lib -L/c/postgres/lib"

Make sure to install it into a path that has no spaces in it, especially do _NOT_ install it in C:\Program Files. This causes much trouble afterwards. I wasn't able to compile libgda with the postgres backend enabled this way.

Then, go to the directory where you installed postgres into, and descend into /lib. postgres only ships with a libpq.lib import library, which seems not to be compatible with mingw (I got undefined references when trying to use it). We can however create one for mingw using the following steps:

 echo EXPORTS > libpq.def
 nm libpq.lib | grep ' T _' | sed 's/.* T _//' >> libpq.def
 dlltool --def libpq.def --dllname ../bin/libpq.dll --output-lib libpq.a

Actually, we built an import library for the libpq.dll this way, and these normally end on .dll.a with mingw. However, libgda only checks for libpq.a when searching for postgresql, so we call it libpq.a here. It is still an import library and not a static archive. -->

We could use prebuilt postgresql binaries, but there are some problems with these, the major one being that those are built with MSVC 2005, and requires the VC runtime (version 8.0 SP 1) to be installed on the target computer. I did not succeed in shipping those with glom (without installing them globally on the system). They also need another libintl and libiconv DLL as GTK+, glib, etc., so we would need to ship the same library two times. Therefore, I recommend building postgresql yourself:

Download a current tarball from, unpack it, and run

 ./configure --with-libraries="/lib" --prefix=/c/postgres && make && make install

You could also install it to the default path (/usr/local/pgsql), but the installer script currently searches for the postgres binaries in /c/postgres, so you will have to adjust it. Then, add the directories to your ~/.profile:

 export PATH=$PATH:/c/Program Files/Subversion/bin:/c/postgres/bin
 export CPPFLAGS="-I/include -I/c/postgres/include"
 export LDFLAGS="-L/lib -L/c/postgres/lib"

Download the gettext-tools from, unpack to C:\msys

Again, we need an import library for libgettextpo:

 echo EXPORTS > libgettextpo.def
 nm /bin/libgettextpo-0.dll | grep ' T _' | sed 's/.* T _//' | grep po_ >> libgettextpo.def
 dlltool --def libgettextpo.def --dllname /bin/libgettextpo.dll --output-lib /lib/libgettextpo.dll.a

Download binaries for libgda (4.x) from, unpack to C:\msys. Alternatively, you can install it into a different prefix, such as C:\msys\libgda, and add the paths to PATH, PKG_CONFIG_PATH, CPPFLAGS and LIBS environment variables in your ~/.profile file. Don't forget to re-login or "exec bash -l" before the changes to ~/.profile take effect.

Download libgdamm (version 4.x) from, unpack, and run

 ./configure && make && make install.

Download libxml++ (at least version 2.23.x) from, unpack, and run

 ./configure && make && make install

<!-- gconf is no longer required:

Download ORBit2 binaries and development files from, unpack to C:\msys. Again, another prefix can be chosen if the environment variables in ~/.profile are adapted.

Download gconf binaries and development files from, unpack to C:\msys or another prefix.

Download a gconfmm tarball from, unpack, and run

 ./configure && make && make install

--> Install Python via an installer from to e.g. C:\Python25. Again, make sure not to choose a path with spaces in it. Then, add the paths to the python files to your ~/.profile:

 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/local/lib/pkgconfig:/c/Python25/Lib/pkgconfig
 export PATH=$PATH:/c/Program Files/Subversion/bin:/c/postgres/bin:/c/Python25:/c/Python25/bin
 export CPPFLAGS="-I/include -I/c/postgres/include -I/c/Python25/include"
 export LDFLAGS="-L/lib -L/c/postgres/lib -L/c/Python25/lib"

Then, install pygobject, pycairo and pygtk from, or, respectively.

The installers detect the python installation and install correctly with the default settings.

Edit C:\Python25\bin\pygtk-codegen-2.0 and change the last line from "exec C:/Python25/[...]" to "exec /c/Python25/[...]", otherwise exec thinks it is a relative path and fails when building gnome-python-extras. This is perhaps a bug in msys.

Next, go to /c/Python25/share/pygtk/2.0/defs/gtk-types.defs and remove "gtk/" from the paths there (for example, make "gtk-base-types.defs" out of "gtk/gtk-base-types.defs"). This works around bug #371317. /c/Python25/share/pygtk/2.0/defs/gdk-types.defs is also affected.

Again, we need gnome-python-extras from SVN: (TODO: pygda is now in a separate pygda module.)

 svn co gnome-python-extras
 am_cv_python_pyexecdir=am_cv_python_pyexecdir=/c/Python25/Lib/site-packages ./ && make && make install

Make sure it builds pygda after the configure step. The am_cv_python_pyexecdir variable is needed because otherwise configure tries to find this out by itself and finds a path starting with C:\, which libtool complains about because of not being absolute. The /c/ version points to the same file within msys, and satisfies libtool.

<!-- Download bakery (at least version 2.6) from, unpack and run

 INTLTOOL_PERL=/perl/bin/perl ./configure && make && make install


Download gtksourceview and goocanvas binaries and development files from or, respectively, unpack to C:\msys.

Download gtksourceviewmm from, unpack and run

 ./configure --disable-docs && make && make install

Download goocanvasmm (at least 0.6.1) from, unpack and run

 ./configure && make && make install

Download intltool from, unpack and run

 PERL=/perl/bin/perl ./configure && make && make install

Since Glom 1.13 we also need boost::python. For that purpose, get the latest boost sourcecode from Unpack into an arbitrary directory and run bootstrap.bat by double-clicking it. Then open tools/build/v2/user-config.jam in the boost directory and add the following line there:

 using gcc : 3.4 : C:\\mingw\\bin\\g++.exe ;

of course replace the location of the compiler and the compiler version with yours. Then open a Windows command line (cmd.exe, not an MSYS one), navigate to the boost directory and do the following:

 bjam.exe --prefix=C:\msys\boost --toolset=gcc link=shared
 bjam.exe --prefix=C:\msys\boost --toolset=gcc link=shared install

As with make you can additionally pass -jN to increase compilation speed on multi-core machines (with N being the number of cores). Change the prefix to where you want to install the boost headers and libraries. The filename might by slightly different for you if you used another compiler version. Then add the boost include ($prefix/include/boost-1_42) and library ($prefix/lib) directories to CPPFLAGS and LDFLAGS respectively in your ~/.profile.

Compiling and Installing Glom

Finally, get a glom tarball from, unpack and run

 am_cv_python_pyexecdir=/c/Python25/Lib/site-packages INTLTOOL_PERL=/perl/bin/perl ./configure --disable-update-mime-database --with-boost-python=boost_python-mgw34-mt && make && make install

This should now produce a valid glom binary and install it in msys. Run


to try it out.

If you also want to build the installer that installs glom and all its dependencies on end-user systems, then you need InnoSetup. Add it to your PATH, such as

 export PATH=$PATH:/c/Program Files/Subversion/bin:/c/postgres/bin:/c/Python25:/c/Python25/bin:/c/Program Files/Inno Setup 5

and run the build-installer script from the win32/ subdirectory in glom after having performed a relogin into the msys shell for the PATH change to take effect.

Note that the build-installer script is very customized to my very build setup, and it might (will) fail if you did things slightly differently then described here. Feel free to adjust the script to fit your needs, or to make it more general and contribute it to glom (via a bug in bugzilla).

If you have things to add, then simply add them here (It's a wiki). If you run into problems, feel free to contact me (Armin Burgmeier, armin <!-- SPAM HILFE PANICK --> at arbur dot net).