[Libwebsockets] Fix compilation for uClibc

David cymerio at gmail.com
Sat Jan 12 12:42:38 CET 2013


Hello.
I sent a message to Andy Green some months ago but went unreplied.
Basically I found out how to compile libwebsockets for the Optware
distribution, which uses uClibc. This distribution is meant for
embedded devices like home routers.
With these patches I could successfully run libwebsockets in a
Cisco-Linksys E4200 router using the Tomato firmware + Optware (ddwrt
branch).


These patches were meant to be applied to the master branch at the
state it was 4 months ago.
I don't have the time to check if they apply cleanly now, or if they
are needed anymore.

The first patch fixes the build process adding some macros to
"configure.ac" that were required in my system. Also I didn't see a
reason to require autoconf 2.66 (it wasn't available on my system, and
after my changes compiled fine). I tested the changes in Ubuntu and it
compiles fine too.

The second patch adds the implementation of "getifaddrs" which is
unavailable in uClibc.
I just copied the implementation from a source I found on the net. The
license it's BSD AFAIK (it's part of OpenBSD according to a notice on
the top of the file) .

With these two patches the program compiles.
I did find some bugs however. Some options in the ping test didn't
work, and some crashed the test server (I don't remember which ones
now), but I don't know if that was caused by these patches or the bugs
were already in the code.
More testing is needed. Unfortunately I don't have the time at the moment.
I leave the patches here just in case someone finds them useful.

--
Saludos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_warnings_with_autoreconf.patch
Type: application/octet-stream
Size: 3787 bytes
Desc: not available
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20130112/f2830384/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_ifaddr.patch
Type: application/octet-stream
Size: 10881 bytes
Desc: not available
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20130112/f2830384/attachment-0001.obj>


More information about the Libwebsockets mailing list