Table Of Contents

Previous topic

wrdk - a WikiReader Development Kit

This Page

Building wrdk from scratch

Building wrdk 0.1 is a bit messy. This document outlines how to build it from scratch.

Initial setup

  1. Make sure that /bin/sh links to bash. If not, try dpkg-reconfigure dash.
  2. Clone the wrdk git repository at http://github.com/nzmichaelh/wrdk.
  3. Your new checkout will be called ‘wrdk’. Under this will be the Openmoko subdirectories such as host-tools and samo-lib and, to confuse things, the wrdk code itself.
  4. Edit samo-lib/include/config.h and uncomment BOARD_SAMO_V1.
  5. Build the main WikiReader source tree. This builds a copy of gcc, binutils, and the various target libraries such as mini-libc, grifo, and fatfs.
  6. Change to samo-lib/grifo and run make.

Building for Linux

The final binary version ends up in wrdk/build/linux/wrdk.

  1. Change to the wrdk subdirectory.
  2. Put $PWD/bin and PWD/build/linux/wrdk/bin into your path.
  3. Put $PWD/python into your PYTHONPATH.
  4. Test the installation by running wrdk-config --version. You should see the wrdk version number.
  5. Run make binutils to build another copy of binutils.
  6. Test that you can access the new build of binutils by running c33-epson-elf-as --version.
  7. Run make gcc to build another copy of gcc.
  8. Run make package to pull in the examples, documentation, and other libraries into the build directory.
  9. Run make archive to tar up the build into the release tarball.

Building for Windows

Building from Windows is a bit trickier. Most of the work is done on a cross-compiling Linux host, but you will need Windows to build the binary versions of the Python scripts.

You’ll need:

  • The win32 cross compiler mingw32
  • The NSIS installer builder nsis
  • The text file converter flip
  • A Windows host with Python 2.5, pywin32, py2exe, PIL, and pyserial
  1. Build wrdk for Linux using the instructions above
  2. Check your path by running c33-epson-elf-gcc and wrdk-config. The native build is used to build libgcc and the examples.
  3. By some means, share the wrdk directory from the Linux host. Running Windows under VirtualBox and sharing over NFS is a good way.

Change over to the Windows machine. On it:

  1. Change to the wrdk/wrdk directory.
  2. Put $PWD/python into the PYTHONPATH.
  3. Change to the bin directory.
  4. Test by running python wrdk-config.
  5. Run python ../python/win32pybin.py py2exe to build executable versions of the Python tools.

You should now have a dist directory that contains files such as wrdk-config.exe.

Change back to the Linux host. The just-built tools should be in wrdk/bin/dist.

  1. Run make package.
  2. Run make installer.