1
Building Clutter with mingw
2
===========================
4
The mingw-cross-compile.sh script in this directory automates
5
compilation of Clutter using the MinGW compiler. You can run it from
6
Linux to cross compile or you can use MSYS and MinGW to compile it
9
If you were looking to build Clutter with Visual Studio instead there
10
is an external project which is maintaining build files for Clutter
11
(and other glib-based projects) here:
13
https://launchpad.net/oah
15
For cross compiling you need to have the compiler installed. The
16
script should automatically download all other dependencies. Under
17
Ubuntu (and probably other Debian-based distros) you can install the
18
compiler with this command:
20
sudo apt-get install mingw32{,-binutils,-runtime}
26
./mingw-cross-compile.sh
28
and follow the prompts.
33
Building directly under Windows requires some extra work to get some
34
basic utilities installed. Here are step-by-step instructions to build
35
from a clean installation of Windows:
37
First you need to install the MinGW and MSYS packages from [1].
39
Select the top package called 'Automated MinGW Intaller' and download
40
the exe of the latest version. Run the executable and install to the
41
default location. Make sure you DON'T install 'MinGW make' to make
44
Next download the 'MSYS Base System'. Use the .exe installer from
45
'Current release' (not the technology preview). Run the executable and
46
install to the default location. Answer yes to whether you want to
47
continue with the post install and tell it the location where you
48
installed MinGW (which should be c:/MinGW).
50
Next install the 'MSYS supplementary tools'. Again select .exe from
51
the current release and install it to the default location.
53
To get the dependencies we want to run the mingw-cross-compile.sh
54
script. However to do this we first need some extra utilities.
56
Make a directory called c:/msys/1.0/clutter-work and another directory
57
called downloads under that. Go back to the SourceForge page for MinGW
58
and select the 'User Contributed: mingwPORT' section. Download the
59
wget tarball to the newly created downloads folder.
61
Start MSYS and type the following to install wget.
63
cd /clutter-work/downloads
64
tar -jvxf wget-1.9.1-mingwPORT.tar.bz2
65
cd wget-1.9.1/mingwPORT
67
PATH="$PATH":"$PWD" ./mingwPORT.sh
69
Press enter at each question to just use the default
71
Next we need to install unzip.exe which we can get from the GNUWin32
72
ports. Visit here [2] and download the 'complete package, except
73
sources'. Install it to the default location.
75
Now we can type the following to download and install the clutter
76
dependencies using the helper script:
79
wget -O downloads/mingw-cross-compile.sh \
80
http://folks.o-hand.com/neil/mingw-cross-compile.sh
81
PATH="$PATH:/c/Program Files/GnuWin32/bin" \
82
sh ./downloads/mingw-cross-compile.sh
84
Press enter to all of the questions to get the default except the 'Do
85
you want to download and install Clutter' question because that will
86
try to use Git which we don't have installed.
88
Next we need to install pkg-config to get Clutter's configure script
89
to work. Type the following:
91
cd /clutter-work/downloads
92
wget 'http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz'
93
tar -zvxf pkg-config-0.23.tar.gz
95
prefix=/clutter-work/clutter-cross
96
libdir="${prefix}/lib"
97
includedir="${prefix}/include"
98
CFLAGS="-g -O2 -Wall -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include" \
99
LDFLAGS="-L${libdir} -lglib-2.0 -lintl -liconv" \
103
Now we should finally be ready to compile Clutter:
105
cd /clutter-work/downloads
106
wget http://www.clutter-project.org/sources/clutter/1.0/clutter-1.0.0.tar.bz2
108
tar -jvxf downloads/clutter-1.0.0.tar.bz2
110
PKG_CONFIG_PATH=/clutter-work/clutter-cross/lib/pkgconfig \
111
PATH="$PATH:/clutter-work/clutter-cross/bin" \
112
CFLAGS="-mms-bitfields -I/clutter-work/clutter-cross/include -g -O2 -Wall" \
113
./configure --prefix=/clutter-work/clutter-cross --with-flavour=win32
116
Now to prove that it worked we can run test-actors. Windows needs the
117
Clutter DLL to be in the system path for this to work so type the
120
export PATH="$PATH:/clutter-work/clutter-cross/bin"
121
cd /clutter-work/clutter-1.0.0/tests
124
If you want to compile a simple app without using autotools, it's
125
easiest to use the libtool generated in the Clutter source so that it
126
can work some voodoo with the included libraries. This assumes you've
127
still got your path set up from the previous test:
129
libtool --mode=link gcc -Wall -g -o simple-app simple-app.c \
130
-I/clutter-work/clutter-cross/include \
131
`PKG_CONFIG_PATH=/clutter-work/clutter-cross/lib/pkgconfig
132
pkg-config clutter-0.8 --cflags --libs`
136
[1] http://sourceforge.net/project/showfiles.php?group_id=2435
137
[2] http://gnuwin32.sourceforge.net/packages/unzip.htm