Projects/Mobile/MADDE: Difference between revisions
No edit summary |
No edit summary |
||
Line 52: | Line 52: | ||
make -C kdecore/kconfig_compiler | make -C kdecore/kconfig_compiler | ||
make -C kjs icemaker | make -C kjs icemaker | ||
make -C kdoctools meinproc4 | |||
</code> | </code> | ||
This builds the | This builds the host tools for x86. | ||
Now, we can do an ARM build: | Now, we can do an ARM build: |
Revision as of 15:39, 20 February 2010
Building KDE for the N900 with the MADDE toolchain
Get MADDE: http://wiki.maemo.org/MADDE
If you MADDE doesn't have Qt 4.6 support, get it from http://chaos.troll.no/~harald/MADDE
CMake
CMake got cross-compiling support in version 2.6. Note that CMake currently can't build ARM and x86 binaries at the same time, so anything that needs a bootstrapped tool needs to be compiled twice, once for x86 and once for ARM.
To ease cross-compiling setup, CMake features toolchain files. Here's an example CMake toolchain file that invokes MADDE's gcc directly:
include (CMakeForceCompiler)
set(CMAKE_SYSTEM_NAME Linux)
CMAKE_FORCE_C_COMPILER($ENV{HOME}/.madde/0.6.14/targets/fremantle-qt-0951/bin/gcc GNU)
CMAKE_FORCE_CXX_COMPILER($ENV{HOME}/.madde/0.6.14/targets/fremantle-qt-0951/bin/g++ GNU)
set(CMAKE_FIND_ROOT_PATH ~/.madde/0.6.14/sysroots/fremantle-arm-sysroot-2.2009-51-1-qt453)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Save this file somewhere, e.g. to toolchain-madde.cmake and pass -DCMAKE_TOOLCHAIN_FILE=$HOME/toolchain-madde.cmake parameter.
Unfortunately, current CMake 2.6 likes to use absolute paths. This won't work well with MADDE, which evaluates absolute paths relative to its sysroot directory. The -DCMAKE_USE_RELATIVE_PATHS=ON CMake flag could help, but seems to have some issues. In the meantime, we use a small hack, by symlinking our home directory into MADDEs sysroot, so all pathes within the MADDE environment will match the ones on our home system:
cd ~/.madde/0.6.14/sysroots/fremantle-arm-sysroot-2.2009-51-1-qt453
mkdir home
cd home
ln -s $HOME .
It is assumed that you checked out the kde sources in your $HOME directory, otherwise, adjust the symlink accordingly.
KDElibs
KDElibs has several bootstrapped tools, which need to be compiled for x86. Unfortunately, current CMake doesn't support building them in one go, so we have to do the following:
cd /path/to/kdelibs/sources
mkdir build-x86
cd build-x86
cmake ..
make -C kdecore/kconfig_compiler
make -C kjs icemaker
make -C kdoctools meinproc4
This builds the host tools for x86.
Now, we can do an ARM build:
cd /path/to/kdelibs/sources
mkdir build-arm
cd build-arm
cmake -DCMAKE_TOOLCHAIN_FILE=$HOME/toolchain-madde.cmake -DKDE_HOST_TOOLS_PATH=/path/to/kdelibs/sources/bld-x86 ..
adapt the pathes above accordingly.