<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:html="http://www.w3.org/1999/html" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Ross Burton</title><link>http://www.burtonini.com/blog</link><description>A potted account of Ross' life</description><language>en</language><ttl>60</ttl><dc:creator>Ross Burton</dc:creator><admin:generatorAgent rdf:resource="http://pyblosxom.sourceforge.net/"/><admin:errorReportsTo rdf:resource="mailto:ross+web@burtonini.com"/><item><title>Anjuta+Poky Integration</title><guid isPermaLink="false">computers/anjuta-2008-05-20-17-40</guid><link>http://www.burtonini.com/blog/computers/anjuta-2008-05-20-17-40</link><description>Yesterday I tested and rolled a new release of the Poky integration plugin for Anjuta , created by our fearless ...</description><content:encoded><![CDATA[<p>
  Yesterday I tested and rolled a new release of
  the <a href="http://labs.o-hand.com/anjuta-poky-sdk-plugin/">Poky
    integration plugin for Anjuta</a>, created by our
  fearless <a href="http://www.robster.org.uk/">Sir Bradford</a>.  This is a
  very special piece of magic which lets you use a Poky SDK in Anjuta to
  cross-compile binaries without any pain, and will even deploy, execute and
  debug the binaries in a QEMU for testing. As part of the release process I
  had to test it, so I'll step through what I did as a brief tutorial on how
  to use Anjuta with Poky.
</p>
<p>
  The prerequisites are Anjuta, the Anjuta Poky SDK plugin, and QEMU.  These are
  all available for installation from
  our <a href="http://debian.o-hand.com">Debian repository</a> for Debian/Ubuntu
  users, everyone else will have to build from source, sorry!  You'll also need
  a Poky ARM SDK and QEMU ARM images from
  the <a href="http://pokylinux.org">Poky</a> web site.  The SDK is a tarball
  which contains a cross compiler with base libraries (glibc, GTK+, and so on)
  and should be extracted onto your machine (it extracts the SDK
  into <tt>/usr/local/poky</tt>).  The QEMU image consists of a kernel and
  a <tt>ext3</tt> file system which will boot Poky inside QEMU.
</p>
<p>
  To start I fetched a checkout
  of <a href="http://pimlico-project.org/tasks.html">Tasks</a> and loaded up
  Anjuta.  I don't have an existing Anjuta project for Tasks, so I used
  <cite>File &rarr; New &rarr; Project From Existing Sources</cite> to create a project using
  the checkout.  At this point I could do native development using
  <cite>Build &rarr; Run Configure</cite> and <cite>Build &rarr; Build
    Project</cite> to configure and compile the source, but we want to
  cross-compile.
</p>
<p>
  To activate cross compiling go to <cite>Edit &rarr; Preferences &rarr; General
    &rarr; Installed Plugins</cite> and enable the <cite>Poky SDK</cite> plugin.
  This will add a new page <cite>Poky SDK</cite> to the preferences dialog.
  We're using an external toolchain so set the SDK root
  to <tt>/usr/local/poky/eabi-glibc/arm</tt> and the toolchain triplet
  to <tt>arm-poky-linux-gnueabi</tt>.  We're also using QEMU instead of a real
  device so set the paths to the kernel and root filesystem (remembering to
  uncompress the filesystem).  We're now done configuring, so the preferences
  dialog can be closed.  However notice that if you switch from using a SDK to
  building with a full Poky tree you can use the cross-compiler it produces
  directly, and you can also use an external device instead of QEMU: the only
  requirement is that you can SSH into it.
</p>
<p>
  Now to do the build.  Use <cite>Build &rarr; Run Configure</cite> to configure
  Tasks, passing any extra options you want.  Note that if you want to debug
  your build in the future you'll need to enter <tt>CFLAGS=-g</tt> here to
  disable optimisation (autoconf sets <tt>-O2 -g</tt> by default, which isn't
  useful for debugging).  The configure script is then ran with the right
  environment and options for cross compiling, and with any luck will
  successfully configure.  Then hit <cite>Build &rarr; Build Project</cite> and
  watch the cross-compiler do its thing.  When that has worked, you can prove to
  yourself that the right thing has happened.
</p>
<pre>$ file tasks
  tasks: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), not stripped</pre>
<p>
  We have an ARM binary, ready for deployment.  Start the virtual machine
  with <cite>Tools &rarr; Start QEMU</cite> (this may ask for your root password
  to configure networking) and once it has booted you can install the project
  into the VM with <cite>Tools &rarr; Deploy</cite>.  This will run <tt>make
  install</tt> to a temporary directory and then rsync it to the VM.  Now you
  can either interact with the VM directly (if the application installed a new
  desktop file, then it should appear on the desktop), or use <cite>Tools &rarr;
  Run Remote</cite> to execute a binary directly: entering <tt>tasks</tt> will
  execute the freshly installed Tasks.  Neat, huh?
</p>
<p>
  For the final trick there is even GDB integration.  <cite>Tools &rarr; Debug
  Remote</cite> will let you specify a local binary (to extract debug symbols
  from, say <tt>src/gtk/tasks</tt>) and a remote binary to run, and then start a
  GDB on the VM and connect to it.  The binary will be initially running but
  paused at the entrypoint, so you can add breakpoints and
  then <tt>continue</tt> execution.
</p>
<p>
  Hopefully this post has been a good overview of the integration available
  between Poky and Anjuta.  In the future I hope to see Nemiver integrated into
  Anjuta, and gdbserver support in Nemiver, which would be a killer combination
  for Poky integration.
</p>
<p>
  <small>NP: <cite>One On Twoism</cite>, Various</small>
</p>
]]></content:encoded><dc:date>2008-05-20T16:40:00Z</dc:date></item></channel></rss>