GLib is a core framework to build multi-platform application.
This is how to build its 2.38.2 version for Windows XP.
Prerequisites
- Windows XP OS. For testing purposes, you can consider VM from IEVMS.
- MSYS2 Base for i686 arch. By time this is written, I use msys2-base-i686-20140507.tar.xz.
- GCC & make. If not installed in MSYS2, it can be done using pacman:
pacman -S gcc make
(I have built poppler using GCC 4.5.2 for compat). - Python 2.5+. Under MSYS2 it can be installed with
pacman -S python
(with that, I currently have Python 3). - ZLib, FFI & gettext (
pacman -S zlib-devel libffi-devel gettext-devel
).
In MSYS2 launched using its mingw32_shell; Let's build it.
- Download sources for GLib 2.38.2:
cd tmp && wget http://sources/url
. I can't build more recent version on winxp. - Extract thoses sources:
xz -dv glib-2.38.2.tar.xz && tar -xvf glib-2.38.2.tar
. - In sources directory, configure it:
cd glib-2.38.2 && CPPFLAGS="-march=i686 -D_WIN32_WINNT=0x0501" ./configure --prefix=/usr --with-python=$(which python)
.CPPFLAGS="-march=i686 -D_WIN32_WINNT=0x0501"
is required to ensure OS is properly detected while building GLib.
- Then finally make it:
make install
(or justmake
if you don't want to install it).
Hi,
I'm one of the MSYS2 developers and spotted this gist. Thanks for using our software!
I'd be careful about the difference between MSYS2 binaries and MinGW-w64 binaries here.
The zlib-devel libffi-devel and gettext-devel packages you install are MSYS2, but I assume the main goal here is to build glib for MinGW-w64 32bit?
If you do
you will see that there are many gettext packages:
The ones from the msys repository are probably not the ones that you want.
The same is true for the GCC you are installing, instead of the msys gcc package, you probably want to install the MinGW-w64 (32bit) package group mingw-w64-i686-toolchain.