[PATCH] How to compile osmocom on NetBSD
khorben at defora.org
Wed Jan 26 15:34:10 UTC 2011
Hi baseband developers,
a couple days ago I managed to compile osmocom's binaries and firmware
files from a NetBSD host, using a cross-compilation toolchain generated
with the standard build script on this system. This was actually quite
straightforward, but required some patches and tricks, so I figured it'd
be worth posting it here.
I will write the procedure in more details on my blog , in my case it
was enough to do this:
$ CPATH="/usr/include" gmake \
The patch itself is certainly more interesting to discuss here. I do not
expect it to be fully merged, but I think it may raise interesting points:
linking with "-ldl" is hardcoded, but breaks the build on systems
where it is not required; this is a usual portability issue, already
solved about a thousand times, I'll try to come up with a cleaner
I think this one is quite elegant, allowing to build even without
support for backtraces; an additional #warning would help though/
here I had to bluntly emulate the functionality of the getline()
call, which seems to be specific to glibc; again, it'd certainly be
nicer if I added a test for HAVE_GETLINE or something along this line.
again, talloc seems to rely on strnlen() being part of the libc, which
is already known to not be the case on MacOS X; considering it also
absent of NetBSD fixes the build for me.
this one is definitely more ugly, since I tricked the cross-compiler
to believe /usr/include matches its specific needs I ended up with
some essential type definitions already; therefore, I am not sure if
this workaround would not be more harmful upstream than not.
Anyway, the actual patch is attached.
A few more things to NetBSD users:
- my previous patch about building without GNU make is also necessary;
- I haven't tested the resulting binaries on a NetBSD host;
- the firmware images seem to be only partly functional at the moment.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the baseband-devel