[Libwebsockets] Fix compilation for uClibc
"Andy Green (林安廸)"
andy at warmcat.com
Sat Jan 12 13:12:39 CET 2013
On 12/01/13 19:42, the mail apparently from David included:
> I sent a message to Andy Green some months ago but went unreplied.
Sorry about that, I did look at the patches at the time fwiw.
> 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
> 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 older version of the tree carried around a lot of generated files
from my autotools versions like ltmain.sh which you're patching here. I
eventually understood it's just making trouble and should be created on
the build box. Today there's a single magic script that recooks
everything using your own autotools.
You're right AC_PREREQ could go. However it was the protection for the
bits you change afterwards which are only in newer autotools....
LT_INIT(shared) is the right command already, AC_PROG_LIBTOOL is a
deprecated way of saying the same thing.
AM_PROG_CC_CC_O is already in HEAD configure.ac
Overall this patch is adding support for ancient autotools rather than
> 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) .
I think this is nice but I am not sure good things will happen if we
just have it built in all contexts like WIN32.
What we can perhaps do to make a start is add a configure flag that
we're building for uclibc, and build this contingent on that, how does
> 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.
No ping test is working OK here on glibc build on Fedora.
> 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.
Thanks for the resend... my difficulty I don't have a uclibc setup to
test them with, although having it work in uclibc is certainly interesting.
More information about the Libwebsockets