# WindowsBuildInstructions

Jump to: navigation, search

## 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 mingw.org, unpack into C:\msys, then install:

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

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 http://www.activestate.com 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 http://ftp.gnu.org/gnu/m4/, unpack somewhere in your msys home directory, and run

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


Then, load automake 1.10 from http://ftp.gnu.org/gnu/automake/, 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 svn-win32-1.4.5.zip (or a more recent version) from http://subversion.tigris.org, 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 ftp://ftp.gnome.org/pub/GNOME/sources/gtk-doc/, 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 http://svn.gnome.org/svn/gnome-common/trunk gnome-comon ./autogen.sh --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 ftp://ftp.gnome.org/pub/GNOME/binaries/win32/gtk+/, 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 http://ftp.gnome.org/pub/GNOME/sources/libsigc++/, unpack, and run

 ./configure && make && make install


Download a glibmm tarball from http://ftp.gnome.org/pub/GNOME/sources/glibmm/2.20, unpack, and run

 ./configure && make && make install


Download a cairomm tarball from http://cairographics.org/releases/, unpack, and run

 ./configure && make && make install


Download a gtkmm tarball from http://ftp.gnome.org/pub/GNOME/sources/gtkmm/2.16, 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 libiconv-1.9.1.bin.woe32.zip) from ftp://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/, 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.

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 http://www.postgresql.org, 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 ftp://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/, 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 ftp://ftp.gnome.org/pub/GNOME/binaries/win32/libgda/4.0, 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 ftp://ftp.gnome.org/pub/GNOME/sources/libgdamm/4.0, unpack, and run  ./configure && make && make install.  Download libxml++ (at least version 2.23.x) from ftp://ftp.gnome.org/pub/GNOME/sources/libxml++/, unpack, and run  ./configure && make && make install  Install Python via an installer from http://python.org 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 http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/, ftp://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/ or http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/, 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 http://svn.gnome.org/svn/gnome-python-extras/trunk gnome-python-extras am_cv_python_pyexecdir=am_cv_python_pyexecdir=/c/Python25/Lib/site-packages ./autogen.sh && 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 gtksourceview and goocanvas binaries and development files from http://ftp.gnome.org/pub/gnome/binaries/win32/gtksourceview/ or http://ftp.gnome.org/pub/gnome/binaries/win32/goocanvas/, respectively, unpack to C:\msys. Download gtksourceviewmm from ftp://ftp.gnome.org/pub/GNOME/sources/gtksourceviewmm/, unpack and run  ./configure --disable-docs && make && make install  Download goocanvasmm (at least 0.6.1) from ftp://ftp.gnome.org/pub/GNOME/sources/goocanvasmm/, unpack and run  ./configure && make && make install  Download intltool from http://ftp.gnome.org/pub/gnome/sources/intltool/0.37/, 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 http://boost.org. 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 ftp://ftp.gnome.org/pub/GNOME/sources/glom/, 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  glom  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 at arbur dot net).