Difference between revisions of "Compiling ScummVM/Windows CE"

Jump to navigation Jump to search
no edit summary
m (fixing wikilink)
Line 20: Line 20:
=== Compilers ===
=== Compilers ===


Versions before 0.9.0 use the Embedded Visual C developement environment.
Versions before 0.9.0 use the Embedded Visual C development environment.
More specifically you can use either
More specifically you can use either
[http://www.microsoft.com/downloads/details.aspx?familyid=f663bf48-31ee-4cbe-aac5-0affd5fb27dd&displaylang=en evc3] or  
[http://www.microsoft.com/downloads/details.aspx?familyid=f663bf48-31ee-4cbe-aac5-0affd5fb27dd&displaylang=en evc3] or  
Line 30: Line 30:


* Using [http://msdn.microsoft.com/windowsmobile/downloads/tools/install/default.aspx Microsoft Visual Studio 2005], or
* Using [http://msdn.microsoft.com/windowsmobile/downloads/tools/install/default.aspx Microsoft Visual Studio 2005], or
* Using the [http://download.videolan.org/pub/testing/wince/ Windows CE GCC cross compiler] developed by the [http://www.videolan.org/vlc/ VLC] team.
* Using the [http://download.videolan.org/pub/testing/wince/ Windows CE GCC cross compiler] developed by the [http://www.videolan.org/vlc/ VLC] team ('''do not''' rush to download and install this compiler. It needs to be rebuilt first.).


The former is used for building the 0.9.0 branch.
The former is used for building the 0.9.0 branch.
Line 143: Line 143:
== Compiling using the GCC toolchain ==
== Compiling using the GCC toolchain ==


The VLC port of GCC requires some prep work before it's ready for action.
There are two major problems with it:
It does not honor the <tt>#pragma pack()</tt> directive and there is a store layout bug for packed structs.
Hence, it needs to be rebuilt.
As a welcome aside though, the procedure described in the following subsections can be applied to linux
or cygwin based environment.
This means that the cross compiler can be installed onto a Windows ([http://www.cygwin.org Cygwin])
machine as well.
=== Cross compiler ===
The build process is carried out in two steps, first the binutils and then the gcc cross compiler.
Begin by designating a directory where all source downloads and build will take place.
(''Note:'' the patches by the VLC guys target specific GCC/binutils versions.
We'll rebuild those exact versions as they are good enough for the time being.)
==== Binutils ====
Checkout the binutils source, as described in the [http://www.gnu.org/software/binutils/ GNU Binutils]
page but designating a revision date as well:
cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src login
{enter "anoncvs" as the password}
cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co -D 20050514 binutils
CD into the root of the source tree and patch with the three
[http://download.videolan.org/pub/testing/wince/patches/ VLC binutils patches] (may patch with a little fuzz).
Configure the build:
./configure --target=arm-wince-pe --prefix=PREFIX_TO_CROSS_COMPILER
(PREFIX_TO_CROSS_COMPILER is the path where the cross compiler will be installed.
In linux it is: <tt>/usr/local/wince/cross-tools</tt>)
Make and make install. You may need to manually run ranlib on some generated libs
during making.
==== GCC ====
Checkout the GCC source:
svn -q checkout -r {20050511} svn://gcc.gnu.org/svn/gcc/trunk gcc
(Note the date. It does not match the date in the VLC patches. Also, later revisions
contain severe bugs)
Now come the patches.
:* First aaply the VLC [http://download.videolan.org/pub/testing/wince/patches/ VLC patch] (maybe a little fuzz here as well).
:* Then, patch <tt>gcc/stor-layout.c</tt> with the patch described [http://gcc.gnu.org/ml/gcc-patches/2006-10/msg01115.html here].
:* Finally, in <tt>gcc/config/arm/arm.h</tt>, stick the following define somewhere (before the architecture define is OK):
#define HANDLE_PRAGMA_PACK_PUSH_POP
In the root of the GCC source tree, make a directory called <tt>wince</tt>.
CD into it and create a file called <tt>build.sh</tt> with the following stuff (substitute PREFIX_TO_CROSS_COMPILER), and run it:<br>
<tt>  export PATH=PREFIX_TO_CROSS_COMPILER/bin:$PATH</tt><br>
<tt>  ../configure --with-gcc --with-gnu-ld --with-gnu-as --target=arm-wince-pe --prefix=PREFIX_TO_CROSS_COMPILER --disable-threads --disable-nls --enable-languages=c++ --disable-win32-registry --disable-interwork --disable-multilib</tt><br>
<tt>  make install</tt>
==== Finish up ====
We need to copy over some stuff from the full GCC tarball.
Get [http://download.videolan.org/pub/testing/wince/wince-arm-gcc4.0.0-cvs-linux-crosscompiler-20050517.tar.bz2 the binary tarball] and unpack it somewhere.
:* Copy recursively all of <tt>usr/local/wince/cross-tools/include/</tt> into your <tt>PREFIX_TO_CROSS_COMPILER/include</tt>.
:* Copy all of the libs in <tt>usr/local/wince/cross-tools/lib</tt> into your <tt>PREFIX_TO_CROSS_COMPILER/lib</tt> (except libiberty.a).
:* CD into your <tt>PREFIX_TO_CROSS_COMPILER/arm-wince-pe/lib</tt> and make the following two symbolic links:
ln -s ../../lib/corelibc.lib crt0.o
ln -s ../../lib/coredll.lib c.lib
Done :-)
(''Note:'' In linux, it is much easier to get the binary tarball, extract it into the root of the filesystem, and then build
the binutils and GCC replacing essentially the offending files (C++ compiler etc). This final step in this case is not be required)
=== ScummVM ===
''Assuming you have installed the toolchain in its default place''
''Assuming you have installed the toolchain in its default place''
This is the procedure for building ScummVM, provided the compiler is patched as described above:


* Build libraries from source
* Build libraries from source
116

edits

Navigation menu