Building wrdk from scratch
Building wrdk 0.1 is a bit messy. This document outlines how to build
it from scratch.
Initial setup
- Make sure that /bin/sh links to bash. If not, try dpkg-reconfigure dash.
- Clone the wrdk git repository at http://github.com/nzmichaelh/wrdk.
- 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.
- Edit samo-lib/include/config.h and uncomment BOARD_SAMO_V1.
- 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.
- Change to samo-lib/grifo and run make.
Building for Linux
The final binary version ends up in wrdk/build/linux/wrdk.
- Change to the wrdk subdirectory.
- Put $PWD/bin and PWD/build/linux/wrdk/bin into your path.
- Put $PWD/python into your PYTHONPATH.
- Test the installation by running wrdk-config --version. You should
see the wrdk version number.
- Run make binutils to build another copy of binutils.
- Test that you can access the new build of binutils by running
c33-epson-elf-as --version.
- Run make gcc to build another copy of gcc.
- Run make package to pull in the examples, documentation, and other
libraries into the build directory.
- 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
- Build wrdk for Linux using the instructions above
- Check your path by running c33-epson-elf-gcc and wrdk-config.
The native build is used to build libgcc and the examples.
- 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:
- Change to the wrdk/wrdk directory.
- Put $PWD/python into the PYTHONPATH.
- Change to the bin directory.
- Test by running python wrdk-config.
- 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.
- Run make package.
- Run make installer.