[Libwebsockets] Fix compilation for uClibc

"Andy Green (林安廸)" andy at warmcat.com
Sat Jan 12 14:27:30 CET 2013


On 12/01/13 20:12, the mail apparently from "Andy Green (林安廸)" included:
> On 12/01/13 19:42, the mail apparently from David included:
>> Hello.
>> 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
>> 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 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
> uclibc.
>
>> 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
> that sound?

The first patch I'll leave for now.  If your autotools are reasonably 
modern it seems it will already work with uClibc.

I adapted your second patch to depend on a --enable-builtin-getifaddrs 
configure flag... there were also some -Wall -Werror failures on the BSD 
code I fixed up, and added it to the README.  It's committed here -->

http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit/?id=c4ef7b16092d370ede7420a1c468a4271526edc5

Thanks for your patches.

-Andy




More information about the Libwebsockets mailing list