[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] compiling libmicrohttpd 0.4.1 on Windows under MinGW
From: |
Christian Grothoff |
Subject: |
Re: [libmicrohttpd] compiling libmicrohttpd 0.4.1 on Windows under MinGW/MSYS |
Date: |
Fri, 20 Mar 2009 08:43:56 -0600 |
User-agent: |
KMail/1.11.0 (Linux/2.6.27-11-generic; KDE/4.2.0; i686; ; ) |
Dear Brecht,
I don't maintain the W32 port, Nils Durner does this. Also, since this may be
of general interest to others, it should go to the MHD mailinglist ;-).
Best,
Christian
On Friday 20 March 2009 04:59:14 am Brecht Sanders wrote:
> Hi,
> I just built libmicrohttpd 0.4.1 on Windows under MinGW/MSYS.
> However, the following adjustments below were required in order to succeed.
> I hope this helps you to get libmicrohttpd more cross platform.
> It's a great library and I intend to use it in a future project of mine
> that will also run on Windows.
> Regards
> Brecht Sanders
>
> 1) sys/socket.h doesn't exist on Windows
> --Workaround--
> mkdir sys
> echo > sys/socket.h << EOF
> #include <winsock2.h>
> typedef int socklen_t;
> EOF
>
> 2) src/include/plibc.h defines things that already exist
> --Workaround--
> patch -ulb src/include/plibc.h << EOF
> --- src/include/plibc.h Sat Dec 27 08:49:29 2008
> +++ src/include/plibc.h Fri Mar 6 16:27:34 2009
> @@ -341,3 +341,3 @@
> const char *hstrerror (int err);
> - void gettimeofday (struct timeval *tp, void *tzp);
> + //void gettimeofday (struct timeval *tp, void *tzp);
> int mkstemp (char *tmplate);
> @@ -345,3 +345,3 @@
> char *ctime (const time_t * clock);
> - char *ctime_r (const time_t * clock, char *buf);
> + //char *ctime_r (const time_t * clock, char *buf);
> const char *inet_ntop (int af, const void *src, char *dst, size_t size);
> EOF
>
> 3) pthread_mutex_t is not found in src/daemon/https/tls/gnutls_global.h
> --Workaround--
> #include <pthread.h> at the top of src/daemon/https/tls/gnutls_global.h
>
> 4) undefined things in src/daemon/daemon.c (MSG_DONTWAIT and
> non-blocking stuff)
> --Workaround--
> patch -ulb src/daemon/daemon.c << EOF
> --- src/daemon/daemon.c Thu Mar 19 05:06:42 2009
> +++ src/daemon/daemon.c Fri Mar 20 09:17:59 2009
> @@ -64,2 +64,5 @@
> #endif
> +#ifndef MSG_DONTWAIT
> +#define MSG_DONTWAIT 0
> +#endif
> #endif
> @@ -1278,3 +1281,7 @@
> {
> +#ifdef __MINGW32__
> + unsigned long sk_flags;
> +#else
> int sk_flags;
> +#endif
>
> @@ -1293,2 +1300,6 @@
> * The others must immediately return. */
> +#ifdef __MINGW32__
> + sk_flags = 1;
> + return ioctlsocket(socket_fd, FIONBIO, &sk_flags);
> +#else
> sk_flags = fcntl (socket_fd, F_GETFL);
> @@ -1298,2 +1309,3 @@
> goto thread_failed;
> +#endif
> EOF
>
> 5) when running make check there is a reference to random which doesn't
> exist on Windows
> --Workaround--
> run configure with CFLAGS="-Drandom=rand"
- Re: [libmicrohttpd] compiling libmicrohttpd 0.4.1 on Windows under MinGW/MSYS,
Christian Grothoff <=
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- [libmicrohttpd] Re: compiling libmicrohttpd 0.4.1 on Windows under MinGW/MSYS, Nils Durner, 2009/03/31