|
|
[ Toolchains ] [ Root filesystem ] [ Mixing Emdebian and Debian ] Emdebian Howto (continued)Cross-building Debian packagesBuilding your own packagesemdebuild - building the Emdebian wayOmit this section if you just want to use the existing Emdebian packages for ARM. To add new packages, use Emdebian for other architectures or build against uClibc, you will need to build your own packages using the existing patches and emsource. To extend Emdebian to other package sets, including Qt, you will need to build new packages from scratch - including fixing all the crossbuilding bugs that are likely in the packages in Debian. It is recommended to build packages individually initially, rather than setting up an autobuilder. This acts as an introduction to how the builds work and how the process may differ from other Debian builds. Once a small set of packages has built successfully using emsource and emdebuild, problems that may arise in the autobuilder will be easier to fix. Cross-building Debian packages can be a complicated process and can require a detailed knowledge of a variety of Debian packaging methods and tools. Fixing cross-builds can absorb significant amounts of time. If you want to use the Emdebian binaries for your chosen architecture to prepare a rootfs, you can skip this section. Getting the sourceEmdebian uses Debian packages as the original source rather than going to the actual upstream. This provides some insurance and assistance because the package is known to compile natively on the host architecture and build logs for that version are available from the debian website. The Debian packaging methods and tools are increasingly supportive of cross-building and provide a flexible platform for implementing general fixes. Emdebian supports two methods of building packages:
emsource uses subversion to retrieve any existing Emdebian patches and also runs the em_make and emlocale scripts from emdebian-tools to prepare a package suitable for Emdebian. Most Debian packages will not currently cross-build without such patches so emsource is strongly recommended. Checking for common problemsAs Emdebian develops, a set of common problems is appearing. In general, these can be fixed within Debian without affecting native builds and work is ongoing to implement these solutions. In the meantime, emdebian-tools implements fixes for some common issues (removal of manpages and documentation etc.) and the Emdebian wiki contains other hints for common package problems. In time, bugs filed in Debian should improve the situation. e.g. The patches used by Emdebian are not suitable for direct implementation in Debian because the patch will remove commands like dh_installman in order to remove the manpages. Changes in dpkg to support filtering packages during the build will allow Emdebian to retain the Debian commands but simply filter out their effects. emdebuild - building the Emdebian wayemdebuild is a wrapper around dpkg-buildpackage -a that handles the Emdebian patch sets, locally and in SVN. using apt-cross for cross dependenciesapt-cross can download, build and install foreign versions of shared libraries and development packages to support cross-building by making the necessary host architecture library binaries available to the cross-compiler. If the build fails during ./configure or later with a "Missing file" error, use dpkg -S foo.h to identify the package and apt-cross -a $ARCH -v -i libfoo-dev to install the library binary for the host architecture on the build machine. There is outline support for a debian/xcontrol file that can be used to specify these packages as Build-Cross-Depends. The normal way to use emdebuild is (for package foo, version 1.2.3-1 and an Emdebian working directory of /opt/emdebian): $ emsource foo $ cd /opt/emdebian/f/foo/trunk/foo-1.2.3/ $ emdebuild --build-dep $ emdebuild Alternatively, to build immediately after applying the patches: $ emsource -b --build-dep foo Supporting CC_FOR_BUILDSome packages use 'gcc' to compile and run internal tools during the package build to ease the Debian build process. When cross-building, it is common for these tools to successfully compile using the cross-compiler but then fail to execute on the build machine. Errors from internal tools commonly end with "unable to execute file foo". emdebian-tools and supporting Debian packages are implementing fixes for these problems and if the package fails to build, check for CC_FOR_BUILD support in the upstream Makefile. Adding support for CC_FOR_BUILD in ./configure and specifying CC=@CC_FOR_BUILD@ in the Makefile rule that builds the tool (or the directory containing the tool if no other source files are compiled in that directory) will allow the cross-build to compile just that tool with 'gcc' while compiling the rest of the package with, e.g. 'arm-linux-gnu-gcc'. Once built, emdebuild shows details of the packages built. If you have Emdebian SVN commit access, you can update the Emdebian SVN patches for that package. [ Installing toolchains ] [ Root filesystem ] |
Last Modified: Wed, Sep 10 02:31:14 UTC 2008
Copyright © 2000-2008
The Embedded Debian Project;
Emdebian is an offical subproject of Debian.