[gnutls-dev] Re: gnutls 1.2.8 and mingw32
Enrico Tassi
gareuselesinge at users.sourceforge.net
Sat Oct 29 15:18:05 CEST 2005
On Tue, Oct 25, 2005 at 12:58:29PM +0200, Simon Josefsson wrote:
> Enrico Tassi <gareuselesinge at users.sourceforge.net> writes:
>
> > On Mon, Oct 24, 2005 at 03:52:09PM +0200, Simon Josefsson wrote:
> >> > We hope to release soon a new version of FreePOPs based on
> >> > libcurl-gnutls and then we will have a feedback from the users
> >> > (even if only a small part of FreePOPs plugins use https://).
> >>
> >> That would be good. I am preparing the GnuTLS 1.2.9 release now, and
> >> fixing the inet_ntop problem is the only pending issue I have right
> >> now. There weren't any other mingw32 problems building GnuTLS 1.2.8,
> >> where there? Let me know, and I'll try to resolve them.
> >
> > I use the mingw debian package and the main remaining issue is that
> > there is no dll for wsock32.dll so I had to hack the libtool/configure
> > just to add the proper -l option (I'm not an autotools guru, so maybe
> > the solution was cleaner). In mingw I have only wsock32.a that, if
> > statically linked, closes all the unresolved symbols of libgnutls.dll
> > producing a "nice" dll. Maybe the solution should come from mingw...
> > I've not investigated furter.
> >
> > JFYI I attach the .sh script I use to compile the dll
>
> Thanks, I'll look into fixing this.
>
> Btw, I believe I have fixed inet_ntop, please test:
> http://josefsson.org/daily/gnutls/gnutls-20051025.tar.gz
I've tested 20051029 and I attach the patch to make the doc/examples/
stuff compile cleanly (but it will not work, since there is no inet_pton
under mingw).
--
Enrico Tassi
-------------- next part --------------
diff -ruN examples.old/ex-cert-select.c examples/ex-cert-select.c
--- examples.old/ex-cert-select.c 2005-09-23 02:23:03.000000000 +0200
+++ examples/ex-cert-select.c 2005-10-29 14:58:29.000000000 +0200
@@ -2,16 +2,22 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+
+#ifdef _WIN32
+ #include <windows.h>
+ #define inet_pton(x,y,z)
+#else
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+#endif
+
#include <unistd.h>
+
#include <sys/stat.h>
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
/* A TLS client that loads the certificate and key.
diff -ruN examples.old/ex-client1.c examples/ex-client1.c
--- examples.old/ex-client1.c 2005-08-11 02:23:02.000000000 +0200
+++ examples/ex-client1.c 2005-10-29 14:59:43.000000000 +0200
@@ -2,10 +2,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#ifdef _WIN32
+ #include <windows.h>
+#else
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+#endif
#include <unistd.h>
#include <gnutls/gnutls.h>
diff -ruN examples.old/ex-client2.c examples/ex-client2.c
--- examples.old/ex-client2.c 2005-08-13 02:23:03.000000000 +0200
+++ examples/ex-client2.c 2005-10-29 15:00:17.000000000 +0200
@@ -2,10 +2,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#ifdef _WIN32
+ #include <windows.h>
+#else
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+#endif
#include <unistd.h>
#include <gnutls/gnutls.h>
diff -ruN examples.old/ex-serv1.c examples/ex-serv1.c
--- examples.old/ex-serv1.c 2005-09-23 02:23:03.000000000 +0200
+++ examples/ex-serv1.c 2005-10-29 15:01:33.000000000 +0200
@@ -2,10 +2,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#ifdef _WIN32
+ #include <windows.h>
+#else
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+#endif
#include <string.h>
#include <unistd.h>
#include <gnutls/gnutls.h>
diff -ruN examples.old/ex-serv-anon.c examples/ex-serv-anon.c
--- examples.old/ex-serv-anon.c 2005-09-23 02:23:03.000000000 +0200
+++ examples/ex-serv-anon.c 2005-10-29 15:02:03.000000000 +0200
@@ -2,10 +2,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#ifdef _WIN32
+ #include <windows.h>
+#else
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+#endif
#include <string.h>
#include <unistd.h>
#include <gnutls/gnutls.h>
diff -ruN examples.old/ex-serv-export.c examples/ex-serv-export.c
--- examples.old/ex-serv-export.c 2005-09-23 02:23:03.000000000 +0200
+++ examples/ex-serv-export.c 2005-10-29 15:02:38.000000000 +0200
@@ -2,10 +2,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#ifdef _WIN32
+ #include <windows.h>
+#else
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+#endif
#include <string.h>
#include <unistd.h>
#include <gnutls/gnutls.h>
diff -ruN examples.old/ex-serv-pgp.c examples/ex-serv-pgp.c
--- examples.old/ex-serv-pgp.c 2005-09-23 02:23:03.000000000 +0200
+++ examples/ex-serv-pgp.c 2005-10-29 15:03:10.000000000 +0200
@@ -2,10 +2,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#ifdef _WIN32
+ #include <windows.h>
+#else
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+#endif
#include <string.h>
#include <unistd.h>
#include <gnutls/gnutls.h>
diff -ruN examples.old/ex-serv-srp.c examples/ex-serv-srp.c
--- examples.old/ex-serv-srp.c 2005-09-23 02:23:03.000000000 +0200
+++ examples/ex-serv-srp.c 2005-10-29 15:03:32.000000000 +0200
@@ -2,10 +2,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#ifdef _WIN32
+ #include <windows.h>
+#else
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+#endif
#include <string.h>
#include <unistd.h>
#include <gnutls/gnutls.h>
diff -ruN examples.old/tcp.c examples/tcp.c
--- examples.old/tcp.c 2005-08-12 12:13:40.000000000 +0200
+++ examples/tcp.c 2005-10-29 14:58:29.000000000 +0200
@@ -1,10 +1,17 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+
+#ifdef _WIN32
+ #include <windows.h>
+ #define SHUT_RDWR SD_BOTH
+ #define inet_pton(x,y,z)
+#else
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+#endif
#include <unistd.h>
#define SA struct sockaddr
More information about the Gnutls-dev
mailing list