[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] Patches for Windows version of libmicrohttpd
From: |
Christian Grothoff |
Subject: |
Re: [libmicrohttpd] Patches for Windows version of libmicrohttpd |
Date: |
Thu, 19 Aug 2010 11:56:04 +0200 |
User-agent: |
KMail/1.13.3 (Linux/2.6.32-trunk-vserver-amd64; KDE/4.4.4; x86_64; ; ) |
On Thursday 19 August 2010 11:42:30 Gerrit Telkamp wrote:
> It was a bit tricky to build libmicrohttpd (SVN trunk) for Windows.
> I'm using the newest MSYS/MinGW environment (GCC 4.5.1).
> I've optimized the autoconf feature, so this should be easier in future.
> Please find enclosed my patches.
>
> In detail:
> 1- libmicrohttpd needs the "PlibC" library under Windows (libplibc.a).
> Methods of PlibC are referenced by src/daemon/daemon.c.
> autoconf assumes that PlibC is installed on the Build environment and
> does not check this.
> If PlibC is not installed, the pthreads check (see "acinclude.m4") will
> fail and stops with the wrong error message "Your system is not
> supporting pthreads". This is very confusing.
>
> The patch includes an additional check for PlibC, before pthreads is
> used. The check is only done under cygwin and mingw environments.
Good idea.
> Furthermore, an older version of plibc.h was in the include directory.
> This gives some problems if you are using a newer version of the PlibC
> library. So I propose to exclude src/include/plibc.h from the SVN
The problem is that UNIX users won't have PlibC installed on their system, but
we need the header to
#define SHUTDOWN shutdown
and the like (otherwise the code won't compile). That's why it is shipped
with MHD right now, and while I think we should keep it up-to-date. Nils
should worry about backwards-compatibility. Maybe one way to do this would be
to split it into a plibc_unix.h and a plibc_w32.h -- and then we might only
ship plibc_unix.h and avoid most compatibility issues in the future.
Nils, what do you think of this idea?
In any case, I don't think removing plibc.h is an option.
> Files affected:
> acinclude.m4 (modified)
> configure.ac (modified)
> src/include/plibc.h (deleted)
>
> 2- setsockopt() uses a different parameter type under Windows ("optval"
> is const char). This caused an error when src/daemon/daemon.c was compiled.
>
> The patch enclosed includes a different call of the setsockopt() on
> Windows machines.
We'll fix that.
> Important: IPV6_V6ONLY is not available on Windows machines < Windows 7!
> So this parameter is "0". But there is a TODO comment, maybe someone has
> an idea how to solve this on Windows XP machines.
Well, your change simply takes it out on W32 always; I think we should do at
least something like
#ifdef IPV6_V6ONLY
...
#endif
(instead of using "0").
> Files affected:
> src/daemon/daemon.c (modified)
>
> I have tested the patch on a MinGW / MSYS environment only.
I'll see about integrating some approximation of your changes soon ;-).
Best,
Christian