From 3534b428629be185e096be99e3bd5fdfe32d5544 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 18 Sep 2014 18:55:44 +0000 Subject: initial commit with rc for skalibs-2.0.0.0 --- doc/crosscompile.html | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 doc/crosscompile.html (limited to 'doc/crosscompile.html') diff --git a/doc/crosscompile.html b/doc/crosscompile.html new file mode 100644 index 0000000..ba22b31 --- /dev/null +++ b/doc/crosscompile.html @@ -0,0 +1,93 @@ + + + + + How to cross-compile skalibs + + + + + + +

+skalibs
+Software
+skarnet.org +

+ +

How to cross-compile skalibs

+ +

+ There are three issues in the world of cross-compilation: +

+ + + +

Support for parallel builds

+ +

+ skalibs does not support out-of-tree builds at the moment, +but since the source code tree is small, it's not costly to duplicate it +to perform parallel builds. If the source code trees grows significantly +larger, out-of-tree build support will be considered. +

+ +

Support for build-time options

+ +

+ skalibs now uses a standard ./configure && make && make install +process, and cross-compiling build-time options can be given on the +./configure command line. +

+ +

Bypassing the build-time tests

+ +

+ This is the hardest part of cross-compilation, and very few build systems +get it right. (GNU autotools does not, which is one of the reasons why +skarnet.org packages do not use autotools.) +

+ +

+ Native build procedures usually perform build-time tests: they compile +executables and run them (on the build platform, which is the same as +the target platform) to check for features and system quirks. skalibs +does exactly that: the ./configure step performs tests on the +build platform and stores the system-dependent results in a directory +that it calls the sysdeps for this platform. +

+ +

+But in a +cross-compilation environment, build-time tests are invalid, since the build +platform and the target platform differ. + There is only one way to cross-compile portable code without resorting +to build-time autodetection: +you must provide by hand the sysdeps for your target +architecture, via the --with-sysdeps option to configure. +

+ +

+ The easiest way to get the correct sysdeps for a target achitecture is +to natively compile skalibs on that target, and steal the produced sysdeps +files. It can be easily done with a virtual machine, qemu for instance. +You could also (politely) ask for precompiled sysdeps on the +skaware mailing-list, if you cannot find them anywhere on the Internet. +

+ +

Credits

+ +

+Dan Kegel brought up the need for a +clean cross-compilation system. +

+ + + -- cgit v1.2.3