WebOS Internals PDK on Mandriva
WebOS Internals recommends using Ubuntu 9.10 32bit x86 server for the PDK.
If you are willing to support yourself and not ask WebOS Internals any questions, you may find the following instructions for Mandriva useful.
Installation on Mandriva Linux for WebOS PDK cross compiling
Note : All this installation was tested with Mandriva Linux 2010.0 and the root account.
Toolchain
Prequisites
Your Mandriva installation will need the following installed. If you do not have them, run the command after the package name. You can test if they are found by just typing the command name. If it says command not found, you need to install it.
With the root account :
git | urpmi git-core | urpmi git-prompt | |
gcc | urpmi gcc | ||
curl | urpmi curl | ||
unzip | urpmi unzip | ||
autoconf | urpmi autoconf | ||
subversion | urpmi subversion | ||
libtool | urpmi libtool | ||
wget | urpmi wget | ||
pkg-config | urpmi pkgconfig | ||
gettext | urpmi gettext | ||
fakeroot | urpmi fakeroot | ||
javac | urpmi java-1.6.0-sun | urpmi java-1.6.0-sun-devel | |
ant | urpmi ant | ||
xsltproc | urpmi xsltproc | ||
intltool | urpmi intltool |
Note: The make toolchain command and later steps will download approximately a half-gig of tools and sources from various locations. Do not start this if you do not have time for a large download. Additionally, if you already have downloaded a copy of the correct version of the WebOS doctor, you can reduce the download time by copying the doctor file into cross-compile/doctors/ with the correct name. This will cause the appropriate command to skip that download. Note that codesourcery rate limts downloads and at a minimum this process will take 10 to 15 minutes irrespective of your connection speed.
Start setup
Create a preware folder, copy the cross-compile tools into it (if you have not installed git, urpmi git-core), and use a make script to begin the set up of the compilation toolchain.
sudo mkdir -p /srv/preware cd /srv/preware sudo chmod 777 . git clone git://git.webos-internals.org/preware/cross-compile.git cd cross-compile make toolchain
Setup Scratchbox
Because we need the command line /usr/bin/qemu-arm for Scratchbox, install the Qemu packages :
urpmi qemu urpmi cyrus-sasl urpmi qemu-img
The scratchbox2 .deb package is available for Ubuntu but not for Mandriva, we need to compile it :
cd /srv/ mkdir sb2 cd sb2 wget http://cgit.freedesktop.org/sbox2/snapshot/sbox2-2.0.tar.gz tar xzvf sbox2-2.0.tar.gz cd sbox2-2.0
Because of the errors:
In file included from luaif/sb_log.c:49: /srv/webos-cross-compiling/sb2/sbox2-2.0/preload/exported.h:505: erreur: conflicting types for ‘scandir’ /usr/include/dirent.h:252: note: previous declaration of ‘scandir’ was here /srv/webos-cross-compiling/sb2/sbox2-2.0/preload/exported.h:521: erreur: conflicting types for ‘scandir64’ /usr/include/dirent.h:275: note: previous declaration of ‘scandir64’ was here make[1]: *** [luaif/sb_log.o] Erreur 1
There is a fix here
Edit the file preload/interface.master
Line 410, replace
SCANDIR_TYPE_ARG3, int(*compar)(const void *, const void *)) : \
by
SCANDIR_TYPE_ARG3, int(*compar)(const struct dirent **, const struct dirent **)) : \
Line 414, replace
WRAP: int scandir(const char *dirname, struct dirent ***namelist, int (*select)(struct dirent *), int (*compar)(const void *, const void *)): map(dirname)
by
WRAP: int scandir(const char *dirname, struct dirent ***namelist, int (*select)(struct dirent *), int (*compar)(const struct dirent **, const struct dirent **)): map(dirname)
Line 420, replace
int(*compar)(const void *, const void *)) : \
by
int(*compar)(const struct dirent64 **, const struct dirent64 **)) : \
Now compile Sb2 :
./autogen.sh make install prefix=/usr/local
After setup scratchbox, set it up for compiling for webOS.
cd /srv/preware/cross-compile/toolchain/arm-2007q3/arm-none-linux-gnueabi/libc export PATH=/srv/preware/cross-compile/toolchain/arm-2007q3/bin:/usr/local/bin:${PATH} sb2-init -c /usr/bin/qemu-arm armv7 arm-none-linux-gnueabi-gcc cd /srv/preware/cross-compile
Then:
make stage
Once this setup is complete, compiling sdl apps for webOS is very simple.