[okl4-developer] Porting Linux Libraries to OKL4
Robert Wetzel
robert.wetzel at opensynergy.com
Fri Dec 5 19:42:02 EST 2008
Prince Riley wrote:
> Since there is no documented OK Linux binary spec, I'll infer from the
> wiki info that
> the GNU libraries are supported in some fashion since the wiki says that
> busybox runs with OK Linux. This fact alone is most encouraging since I
> can easily acquire the sources for other GNU/Linux libraries and I can
> use our estimable Scon build framework and try to compile them.
> Presuming that I don't trip up and break any of the traditional Linux
> ./configure and ./make install scripts I should be able to add them to
> Scon with very little trouble.
>
> Starting with busybox I'll try to build it and then use that process to
> build the other Linux libraries with the ultimate goal of building the
> libstd++ library to run in OK Linux.
>
> Everyone wish me luck.
I haven't tried it yet, but a good starting point is to use the libstdc++
coming with the cross-compiler (afterall the glibc it's bound to is used
in the OK-Linux as well). It's not a small library, however.
Another choice is to pick up something like the uClib++ and integrate it
into the OK-Linux tree (linux/apps/...), write a SConscript for it and
add it to the build command line (linux_apps=libX,libY,libZ,...).
As for the SConscript itself I suggest you have like 4 or 5 steps in it:
0) autogen.sh, if needed (which starts to the autotools stuff)
1) configure with proper arguments (ii.e. crosscompiling, sometimes
you have to take care of PKG_CONFIG paths and similar things)
2) make (aka build)
3) make install into a temporary installlocation
4) copy from temp install to install/. This indirection is used to
prevent spamming the install/ directory with header files, pkg-config
stuff and similar things you don't really need on the target.
Porting Linux libraries to OKL4 is another story, though, because you
lack all but the most basic library functions. This doesn't make it
impossible, but depending on what you port a time/resource consuming
task, aside of crippling or modifying the original library to fit
into your OKL4 software context. For example, you can implement a most
basic "libstdc++", containing the new operator and some other basic
items, but leave the STL as such out or convert only parts of it. That
allows you to write C++ programs on the level of OKL4, but without all
the functionality the STL offers to you.
Anyway, good luck with the OK-Linux porting,
Robert
More information about the Developer
mailing list