WinCECompile

From VideoLAN Wiki
Revision as of 10:37, 18 February 2009 by Geal (talk | contribs) (→‎Get the source)
Jump to navigation Jump to search

Introduction

This is a guide for cross-compiling VLC for Windows CE on Linux with a step-by-step instruction to download, install, configure and build your VLC.

Building VLC

Prepare your environment

VLC uses automake, autoconf and friends for compilation. Make sure they are up to date and usable for your system.

Get mingw32ce

To compile VLC, we use CeGCC, a cross-development environment for Windows CE. Get it on Sourceforge. There are two environments: CeGCC and Mingw32ce. We use Mingw32ce.

Go the the directory where you dowloaded CeGCC, and untar it:

% tar xzf mandriva-cegcc-mingw32ce-0.51.0.tar.gz -C /

You should now see the folder /opt/mingw32ce.


Get the source

Start by getting the source, using FTP for releases, or using Git for development. If your are using the release, download source code and extract the archive and go into your VLC directory.

% cd /path/to/your/vlc/folder/

If you are using the Git version, start by bootstrapping your VLC.

% cd /path/to/your/vlc/folder/
% ./bootstrap

Get the contribs

There is a package which contains some external libraries, and some hacks with header files. Get it and uncompress it in /usr/wince.

Configuration

You need to tweak your configure line.

./configure is used to check whether your system is able to compile VLC. Also you choose the functionalities of your build.

% ./configure --help

will show you the various options

Create a new file named conf-vlc.sh and add in it:

PATH=/opt/mingw32ce/bin:/opt/mingw32ce/arm-wince-mingw32ce/bin:$PATH \
CC="/opt/mingw32ce/bin/arm-wince-mingw32ce-gcc" \
CXX="/opt/mingw32ce/bin/arm-wince-mingw32ce-g++" \
CFLAGS="-I/usr/wince/include -I/opt/mingw32ce/arm-wince-mingw32ce/include  -mwin32 -D __COREDLL__ -D _WIN32_WCE=0x0500" \
CPPFLAGS="-I/usr/wince/include -I/opt/mingw32ce/arm-wince-mingw32ce/include  -mwin32 -D __COREDLL__ -D _WIN32_WCE=0x0500" \
LDFLAGS="-L/opt/mingw32ce/arm-wince-mingw32ce/lib -L/usr/wince/lib -lws2" \

./configure --host=arm-wince-mingw32ce \
            --disable-sdl --disable-gtk \
            --disable-dvdnav --disable-dvdread --disable-avformat \
            --disable-postproc --disable-hal --disable-nls    \
            --enable-sout --enable-vlm --disable-wxwindows \
            --disable-a52 --enable-libmpeg2 --disable-freetype \
            --disable-libgcrypt --disable-fribidi --disable-mad \
            --disable-optimize-memory --disable-audioscrobbler \
            --disable-tremor --disable-faad --enable-ffmpeg --enable-avcodec \
            --enable-vlc --disable-activex --disable-testsuite --disable-skins2 \
            --disable-qt4 --disable-notify --disable-httpd --disable-dbus-control \
            --disable-growl --disable-telepathy --disable-lua --disable-vlm \
            --disable-gnutls --disable-bonjour --disable-x11 --disable-glx \
            --disable-xvideo --disable-remoteosd --disable-schroedinger \
            --disable-dshow --enable-wingdi --disable-real --disable-realrtsp \
            --disable-optimizations --disable-optimize-memory --enable-debug \
            --enable-wince --enable-waveout --disable-directx --disable-x264 \
            --disable-live555 --disable-pulse --disable-swscale

Save it and make it executable:

% chmod u+x conf-vlc.sh

Compiling source code

Now run your configuration script and build VLC:

% ./conf-vlc.sh
% make

Creating self contained packages

Once the compilation is done, you can build self-contained VLC packages with the following "make" commands:

make package-win32-base

(This will create a subdirectory named vlc-x.x.x with all the binaries "stripped" without any debugging symbols).

make package-win32-zip

(Same as above but will package the directory in a zip file).

make package-win32-base-debug

(Creates the same subdirectory, but with debug symbols).

There is not (yet) an option to build a .cab file.

Using and Debugging VLC

Interacting with your device

Use SynCE to synchronize your device with Linux. Or find an Windows machine and download your fresh new VLC build.

Running VLC

Upload the VLC directory on your Windows CE device, and add in its root mingwm10.dll. This the mingw runtime for Windows CE, and VLC won't work without it. You can find it in /opt/mingw32ce/arm-wince-mingw32ce/bin.

Debugging VLC

CeGCC provides a stub for GDB to permit remote debugging on Windows CE. To use it, go in the vlc folder:

% cd vlc-1.0.0
% arm-wince-mingw32ce-gdb vlc.exe

Then, follow the demo of a debugging session for Windows CE.

Common errors

Well... I don't remember right now all the weird errors I encountered, but if you find one, I may have seen it before, so contact me, I'll help you and add it here. --Geal 10:37, 2 September 2008 (CEST)