~oem-solutions-group/unity-2d/clutter-1.0

« back to all changes in this revision

Viewing changes to build/mingw/README

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2010-03-21 13:27:56 UTC
  • mto: (2.1.3 experimental)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20100321132756-nf8yd30yxo3zzwcm
Tags: upstream-1.2.2
ImportĀ upstreamĀ versionĀ 1.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Building Clutter with mingw
 
2
===========================
 
3
 
 
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
 
7
directly on Windows.
 
8
 
 
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:
 
12
 
 
13
  https://launchpad.net/oah
 
14
 
 
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:
 
19
 
 
20
  sudo apt-get install mingw32{,-binutils,-runtime}
 
21
 
 
22
To compile clutter,
 
23
 
 
24
  mkdir build_dir
 
25
  cd build_dir
 
26
  ./mingw-cross-compile.sh
 
27
 
 
28
and follow the prompts.
 
29
 
 
30
Building under MSYS
 
31
===================
 
32
 
 
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:
 
36
 
 
37
First you need to install the MinGW and MSYS packages from [1].
 
38
 
 
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
 
42
life easier.
 
43
 
 
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).
 
49
 
 
50
Next install the 'MSYS supplementary tools'. Again select .exe from
 
51
the current release and install it to the default location.
 
52
 
 
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.
 
55
 
 
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.
 
60
 
 
61
Start MSYS and type the following to install wget.
 
62
 
 
63
cd /clutter-work/downloads
 
64
tar -jvxf wget-1.9.1-mingwPORT.tar.bz2
 
65
cd wget-1.9.1/mingwPORT
 
66
mkdir /usr/src
 
67
PATH="$PATH":"$PWD" ./mingwPORT.sh 
 
68
 
 
69
Press enter at each question to just use the default
 
70
 
 
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.
 
74
 
 
75
Now we can type the following to download and install the clutter
 
76
dependencies using the helper script:
 
77
 
 
78
cd /clutter-work
 
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
 
83
 
 
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.
 
87
 
 
88
Next we need to install pkg-config to get Clutter's configure script
 
89
to work. Type the following:
 
90
 
 
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
 
94
cd pkg-config-0.23
 
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" \
 
100
./configure
 
101
make all install
 
102
 
 
103
Now we should finally be ready to compile Clutter:
 
104
 
 
105
cd /clutter-work/downloads
 
106
wget http://www.clutter-project.org/sources/clutter/1.0/clutter-1.0.0.tar.bz2
 
107
cd ..
 
108
tar -jvxf downloads/clutter-1.0.0.tar.bz2
 
109
cd clutter-1.0.0
 
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
 
114
make all install
 
115
 
 
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
 
118
following:
 
119
 
 
120
export PATH="$PATH:/clutter-work/clutter-cross/bin"
 
121
cd /clutter-work/clutter-1.0.0/tests
 
122
.libs/test-actors
 
123
 
 
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:
 
128
 
 
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`
 
133
 
 
134
Enjoy! 
 
135
 
 
136
[1] http://sourceforge.net/project/showfiles.php?group_id=2435
 
137
[2] http://gnuwin32.sourceforge.net/packages/unzip.htm