Cross compiling KDE / Nokia N900

Pino Toscano toscano.pino at tiscali.it
Wed Dec 23 14:47:42 CET 2009


Hi,

Alle mercoledì 23 dicembre 2009, Alexander Neundorf ha scritto:
> Yes, it's also on my todo, but it would be really nice if somebody else
>  could actually do the work and I would just "guide" throught the necessary
>  steps.
> 
> There are mainly three things which lead to problems when cross compiling:
> 1) try to build and run executable during the configure check
> [...]
> 
> 1) is the hardest one. If somebody does a try_run (check_c_source_runs())
>  in a cross compile, it will build the executable, but it will not try to
>  run it (since it can't, in general). Instead cmake will provide a template
>  cmake script file prepared so that the expected values from the try_run()
>  can be entered there manually. Also the compiled executable is made
>  available, so that the developer can take it, run it on the target and in
>  this way figure out the result which have to go into the prepared cmake
>  script file. This file than has to be preloaded into cmake using -C on the
>  next cmake run. Doing this for all try_run()s is actual work.

I think this point could be solved if cmake would have the distinction between 
"host" (the platform it is building for) and "build" (the platform it is 
building on) compilers (of course, in case of no crosscompilation, host and 
build stuff would be the same).
For example, take the check_c_source_runs() example, and assume I'm 
crosscompiling on i386 (build gcc: cc) for arm (host cc: arm-linux-cc): 
check_c_source_runs() would be compiled using the build compiler (cc), so it 
can be run later.
This would have the advantage I could force the use of the build compiler for 
intermediate build steps, for example a custom target which has to compile 
some executable and run it to get the input files for other targets.
This proposal would also avoid the "template cmake script with the expected 
values" and using CMAKE_CROSSCOMPILING in such situations.

Would it feasible to do?

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20091223/f25c8ee7/attachment.sig 


More information about the Kde-buildsystem mailing list