General information about development tools and environments
How to debug in the emulated machine
Currently when you start an application from the main menu on the emulator, if you meet some problems, no info printed on the console. We can choose to start an application on the console and then you will see there info printed by the application. however, you need to set environments DISPLAY and DBUS_SESSION_BUS_ADDRESS.
The following illustrates the steps by an example: how to start application audioplayer from console:
modify file /etc/X11/Xsession, add the following statement
echo $DBUS_SESSION_BUS_ADDRESS > /tmp/dbusaddress
to the line before the last statement (fi, to be exact) in section testing for an existing daemon, just to be safe. Latest session files contina that change already and do not need to be changed.
export DBUS_SESSION_BUS_ADDRESS=`cat /tmp/dbusaddress`
export DISPLAY=:1
audioplayer &
Building development toolchains
Its a good idea to make use of OpenEmbedded to build our cross development toolchains because we need quite a lot lf libraries by now. We have some options:
- "classical" crosstoolchains
- native toolcahins
- Scratchbox toolchains
All of these have some problems, but we are investigating into a useful solution.
- Is usually covered by the meta-sdk target, unluckily the current SDK compilers are broken in OE.
- Might be a good option for the VMWare images, but its not that useful for real target devices.
The process is documented and it would be quite convenient for development. Check the Scratchbox Wiki for details.
Using Scratchbox for the VMware images
We have a Scratchbox based SDK for the VMWare demo images that can be used to compile binaries with the same compiler and libraries used to build the images. The description assumes you are running Debian, Ubuntu or some similar distribution and have Scratchbox installed to /scratchbox/... .
The SDK consists of four parts:
- The compiler package
- A rootstrap package containing all necessary libraries and tools
- One target setup script
- A SDK setup script
Installing
- Install an up to date Scratchbox. For Debian and Ubuntu you can add this to your sources.list:
deb http://scratchbox.org/debian/ ./ You need the following modules:
- scratchbox-core
- scratchbox-devkit-doctools
- scratchbox-devkit-perl
- scratchbox-libs
- scratchbox-devkit-cputransp
Download the compiler package from here. Become root and unpack it to /. You should have a /scratchbox/compilers/oe-x86 directory now.
Download the rootstrap package, the target setup script and the SDK setup script and place them in /tmp which scratchbox shares with your host PC.
- Start scratchbox You need to make sure that the Scratchbox shell you are using for installing is the only one used on your system.
Run /tmp/target-setup.sh It will set up a new Scratchbox target names vm-sdk for you. It configures it to use no CPU transparency, the debian and perl devkits, to use the oe-x86 compiler you installed in 2. and installs the rootstrap package from /tmp and selects the new target.
Run /tmp/initial-setup.sh and ignore some error messages about commands not found.
- Now you are ready to compile (and start) application binaries. You should have a basic set of tools (including svn, wget, sed, awk, vi...) available so that you can e.g. download or check out sources you need to compile.
Reproducing the SDK
Both compiler and rootstrap are built using OpenEmbedded. The necessary target is meta-sdk-sbox-gpe. Configure OE to build for the "x86" machine and the "generic" distribution. Once you are finished the deploy/sdk directory contains the SDK rootstrap. The compiler needs to be imported from the cross directory. The updated manual for this can be found here. Of course you can do the same for target devices in the same way like for the VMware images.
Update of development environment setup
There is new version of scratchbox toolchain and SDK for development of GPE Phone Edition.
The OE toolchain could be found here. ( http://www.linuxtogo.org/~jiangdan/oe-x86-new2.tar.gz ). You should download it, unzip it to /scratchbox/compilers
The SDK could be found here. (http://www.linuxtogo.org/~jiangdan/sbox-gpesdk-generic-.dev-snapshot-20070201-i486.tar.gz )The SDK includes all the libraries of GPE Phone Edition.
The steps for you to use:
- enter scratchbox
- in scratchbox, type: sb-menu
in "Select action" window, choose: Setup Setup a target, press <OK>
in "Install into target" window, choose <NEW> Create a new target, press <OK>
in "Target name" window, Enter name for the new target. E.g., test, press <OK>
in "Select compiler" window, choose oe-x86-new2 cross, press <OK>
in "Select devkits" window, choose doctools, press <OK>, choose perl, press <OK>, choose DONE Done selecting, choose DONE Done selecting,
in "Select CPU-transparency method" window, choose none, press <OK>
in window of "Do you wish to extract a rootstrap on the target", choose <Yes>
in window of "Select action", choose File Select a local file, press <OK>
in window of "Use file as rootstrap", choose the SDK file, press <OK>
in window of "Do you wish to install files to the target", press <Yes>
in window of "Install files to target", choose /etc, Devkits, fakeroot, press <YES>
in window of "Do you wish to select the target", press <Yes>
- now the scratchbox has changed the target to test
- cd /scratchbox/package, try to compile hello-world, if it is OK, you could try to build your codes.
Then you want to run your codes on the vmware image, the steps are as following:
- in vmplayer, choose image
- in the console, copy the library/ binary which is built by scratchbox.
- run and test