How to compile ScummVM with latest MinGW32CE and SDL

So, obviously you came here to give your CPU(s) and HDD(s) something to do for the next few hours (and don’t forget all the gigabytes for all the sources) 🙂

Prerequisites

In the following I assume you have created a directory in your homedir where all of the sources will be located. If not, do the following:

mkdir ~/wmports && cd ~/wmports

Additionally, you should download some scripts and put them into your path to make “configure” and “make” easier with the MinGW32CE toolchain.

mkdir scripts && cd scripts
wget http://pocketinsanity.org/patches/scripts/cross-configure-mingw32ce.sh
wget http://pocketinsanity.org/patches/scripts/cross-make-mingw32ce.sh
chmod +x *.sh && export PATH=$PATH:~/wmports/scripts
cd..

The parts with light-blue background have to be executed as your normal user, where the parts with light-red background have to be executed as root (invoked with “su”, NOT “su -“ to prevent switching to the root homedir and environment)

Please note:

  • For compiling under Cygwin, you NEED to omit all lines with “su” or “exit”
  • This may have to be “sudo bash” in some OSes or distros which do not allow root login by default (Mac OSX or Ubuntu for example).

Compile MinGW32CE

Checkout CeGCC from SVN, change into checkout dir and compile:

svn co https://cegcc.svn.sourceforge.net/svnroot/cegcc/trunk/cegcc cegcc && cd cegcc
mkdir src/build-mingw32ce && cd src/build-mingw32ce
su

export gcc_src=gcc
../scripts/build-mingw32ce.sh
cd .. && scripts/build-mingw32ce-dlls.sh
cd ../..
exit

MinGW32CE and its dlls will be compiled and installed in /opt/mingw32ce (hence the requirement for the root shell here).

Compile FLAC 1.2.1

Download FLAC 1.2.1, extract, download and apply patch and compile:

wget http://downloads.sourceforge.net/sourceforge/flac/flac-1.2.1.tar.gz
tar xfvz flac-1.2.1.tar.gz && cd flac-1.2.1
wget http://pocketinsanity.org/patches/flac-1.2.1.patch && patch -p0 < flac-1.2.1.patch
CFLAGS="-D_WIN32_WCE=300 -D_UNICODE" CPPFLAGS="-D_WIN32_WCE=300 -D_UNICODE" cross-configure-mingw32ce.sh --prefix=/opt/mingw32ce/arm-mingw32ce --disable-ogg --disable-xmms-plugin -without-libiconv
cross-make-mingw32ce.sh
su

cross-make-mingw32ce.sh install
cd ..
exit

Compile libMAD 0.15.1b

Download libMAD 0.15.1b, extract, download and apply patch and compile:

wget ftp://ftp.mars.org/pub/mpeg/libmad-0.15.1b.tar.gz
tar xfvz libmad-0.15.1b.tar.gz && cd libmad-0.15.1b
wget http://pocketinsanity.org/patches/libmad-0.15.1b.patch && patch -p0 < libmad-0.15.1b.patch
cross-configure-mingw32ce.sh --prefix=/opt/mingw32ce/arm-mingw32ce --disable-nls
cross-make-mingw32ce.sh
su

cross-make-mingw32ce.sh install
cd ..
exit

Compile libmpeg2 0.5.1

Download libmpeg2 0.5.1, extract, download and apply patch and compile:

wget http://libmpeg2.sourceforge.net/files/libmpeg2-0.5.1.tar.gz
tar xfvz libmpeg2-0.5.1.tar.gz && cd libmpeg2-0.5.1
wget http://pocketinsanity.org/patches/libmpeg2-0.5.1.patch && patch -p0 < libmpeg2-0.5.1.patch
CFLAGS="-march=armv5te" cross-configure-mingw32ce.sh --prefix=/opt/mingw32ce/arm-mingw32ce
cross-make-mingw32ce.sh
su

cross-make-mingw32ce.sh install
cd ..
exit

Compile Tremolo 0.07

Download Tremolo 0.07, extract, download and apply patch and compile:

wget http://wss.co.uk/pinknoise/tremolo/Tremolo007.zip
mkdir Tremolo && cd Tremolo && unzip ../Tremolo007.zip
wget http://pocketinsanity.org/patches/tremolo-0.07.patch && patch -p0 < tremolo-0.07.patch
cross-make-mingw32ce.sh -f Makefile.mingw32ce
su

cross-make-mingw32ce.sh -f Makefile.mingw32ce install
cd ..
exit

Compile zlib 1.2.3

Download zlib 1.2.3, extract, download and apply patch and compile:

wget http://zlib.net/zlib-1.2.3.tar.gz
tar xfvz zlib-1.2.3.tar.gz && cd zlib-1.2.3
wget http://pocketinsanity.org/patches/zlib-1.2.3.patch && patch -p0 < zlib-1.2.3.patch
./configure --prefix=/opt/mingw32ce/arm-mingw32ce
cross-make-mingw32ce.sh -f Makefile.mingw32ce
su

cross-make-mingw32ce.sh -f Makefile.mingw32ce install
cd ..
exit

Compile SDL 1.2.13 trunk (r4600+)

Checkout SDL 1.2.13 trunk, download and apply patch and compile:

svn co http://svn.libsdl.org/branches/SDL-1.2 SDL-1.2 && cd SDL-1.2
wget http://pocketinsanity.org/patches/libsdl-1.2.13-r4600.patch && patch -p0 < libsdl-1.2.13-r4600.patch
./autogen.sh
cross-configure-mingw32ce.sh --prefix=/opt/mingw32ce/arm-mingw32ce
cross-make-mingw32ce.sh
su

cross-make-mingw32ce.sh install
cd ..
exit

Compile ScummVM trunk (r42271+)

Checkout ScummVM trunk, download and apply patch and compile:

Change into backends/platform/wince

svn co https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk scummvm && cd scummvm
wget http://pocketinsanity.org/patches/scummvm-r42271.patch && patch -p0 < scummvm-r42271.patch
cd backends/platform/wince
cross-make-mingw32ce.sh -f Makefile.mingw32ce dist
mv scummvm.exe scummvm1.exe

Edit the file “Makefile.mingw32ce”, comment out the first engine block and remove comments for the second engine block (“cruise” does not compile ATM).

cross-make-mingw32ce.sh -f Makefile.mingw32ce clean && cross-make-mingw32ce.sh -f Makefile.mingw32ce dist
mv scummvm.exe scummvm2.exe

Copy files to device

  • Create a new folder (even if you already have one) for scummvm on your device or storage(card).
  • Copy “scummvm1.exe” & “scummvm2.exe” to this folder.
  • Copy the following files to the same directory:
    • “drascula.dat” from “scummvm/dists/engine-data”
    • “kyra.dat from” “scummvm/dists/engine-data”
    • “lure.dat from” “scummvm/dists/engine-data”
    • “queen.tbl from” “scummvm/dists/engine-data”
    • “sky.cpt” from “scummvm/dists/engine-data”
    • “pred.dic from” “scummvm/dists/”
    • “scummmodern.zip” from “scummvm/gui/themes” (use this one, the old one is incompatible)

DONE!!

🙂

[UPDATE:]
Updated ScummVM Patch to r42271.

3 thoughts on “How to compile ScummVM with latest MinGW32CE and SDL

  1. I’m having problems with libmpeg2-0.5.1. Seems it depends on SDL, but I don’t have it when installing it. Is it OK to use the “–disable-sdl” flag with the configure-script?

  2. According to the current ScummVM maintainers, libmpeg2 isn’t needed anymore; so you have two options:
    * Compile libmpeg2 with “–disable-sdl”
    or
    * Compile ScummVM without mpeg2 support, so that libmpeg2 isn’t needed at all.

    I hope I could help you.
    Regards,
    Cerial

  3. Hi cerial,

    it’s possible to get the lastest sourcecode of PocketUAE? Please answer.

    It would be awesome to update the project, I can do this, but I have only old (beta) sourcecode from sf.net.

    Thanks,
    Tuxie.

Leave a Reply

Your email address will not be published. Required fields are marked *